Video Cropping through API on MCM

MCM version 6.3.8 onwards enables the user to crop a section of the Video that can be viewed on the Output Tile while monitoring.

Follow the steps below to crop the Video Source on the Tile using API 5.0. Please use the Basic Authorization for MCM.

Before you proceed, please ensure you have added the source and configured the output encoder. For viewing the video on the Tile, please refer to Viewing the Output Mosaic

  1. You can use the GET API with UUID to get the details of the tile to which you have assigned the source to be cropped.

    GET: http://192.168.10.131/api/5.0/tiles/config/ecc27aff-a5a2-471e-b9e6-1e0c5086c1e0/.json

  1. { "data": { "uuid": "ecc27aff-a5a2-471e-b9e6-1e0c5086c1e0", "label": "tile_beforecrop", "version": 0, "created": "2024-02-02T11:07:17.691Z", "modified": "2024-02-02T11:07:41.959Z", "content_type": "Channel", "min_width": 32, "min_height": 32, "default_width": 300, "default_height": 200, "description": "", "objects": [ { "type": "Video", "left": { "pixels": 0, "percentage": 10 }, "right": { "pixels": 0, "percentage": 10 }, "top": { "pixels": 0, "percentage": 10 }, "bottom": { "pixels": 0, "percentage": 10 }, "max_width": { "pixels": null, "percentage": 100 }, "max_height": { "pixels": null, "percentage": 100 }, "alignment": "Top Left", "index": 1, "crop": { "left": { "percentage": 0 }, "right": { "percentage": 0 }, "top": { "percentage": 0 }, "bottom": { "percentage": 0 } } } ] }, "metadata": { "config_version": 1706857250569938 } }

View the source before cropping on Output encoder

image-20240202-111555.png

 

  1. In POSTMAN under the BODY section, edit the percentage under the crop section shown below using PUT command. Please note that all percentage values must be in integers, decimal values are not supported currently.

    PUT http://192.168.10.131/api/5.0/tiles/config/ecc27aff-a5a2-471e-b9e6-1e0c5086c1e0/.json

image-20240202-113735.png

 

{ "data": { "label": "tile_aftercrop", "version": 0, "content_type": "Channel", "min_width": 32, "min_height": 32, "default_width": 300, "default_height": 200, "description": "", "objects": [ { "type": "Video", "left": { "pixels": 0, "percentage": 10 }, "right": { "pixels": 0, "percentage": 10 }, "top": { "pixels": 0, "percentage": 10 }, "bottom": { "pixels": 0, "percentage": 10 }, "max_width": { "pixels": null, "percentage": 100 }, "max_height": { "pixels": null, "percentage": 100 }, "alignment": "Top Left", "index": 1, "crop": { "left": { "percentage": 30 }, "right": { "percentage": 40 }, "top": { "percentage": 35 }, "bottom": { "percentage": 20 } } } ] }, "metadata": { "config_version": 1706857250569938 } }

 

{ "data": { "uuid": "ecc27aff-a5a2-471e-b9e6-1e0c5086c1e0", "label": "tile_aftercrop", "version": 0, "created": "2024-02-02T11:07:17.691Z", "modified": "2024-02-02T11:25:15.914Z", "content_type": "Channel", "min_width": 32, "min_height": 32, "default_width": 300, "default_height": 200, "description": "", "objects": [ { "type": "Video", "left": { "pixels": 0, "percentage": 10 }, "right": { "pixels": 0, "percentage": 10 }, "top": { "pixels": 0, "percentage": 10 }, "bottom": { "pixels": 0, "percentage": 10 }, "max_width": { "pixels": null, "percentage": 100 }, "max_height": { "pixels": null, "percentage": 100 }, "alignment": "Top Left", "index": 1, "crop": { "left": { "percentage": 30 }, "right": { "percentage": 40 }, "top": { "percentage": 35 }, "bottom": { "percentage": 20 } } } ] }, "metadata": { "config_version": 1706857250569938 } }