Set a video frame's side data to detection bounding boxes for use with the drawbox filter #1520
z-khan
started this conversation in
2. Feature Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scenario
Displaying object detection bounding boxes on a video frame using the drawbox filter.
By default, this filter draws one box with the specified x,y,w,h parameters. For example, we can add a drawbox filter to a graph in PyAV as:
drawbox_filter = graph.add( 'drawbox', f"x={int(box[0])}:y={int(box[1])}:w={int(box[4])}:h={int(box[3])}" )
However, when there are multiple boxes e.g. in case of object detection output, the filter allows the boxes to be sourced from the side data of the frame using the optional
box_source
parameter:drawbox_filter = graph.add( 'drawbox', "box_source=side_data_detection_bboxes")
Will it be possible to set the side data of a video frame with an array of bounding boxes to make use of the filter?
References
drawbox filter documentation
drawbox filter source
AV_FRAME_DATA_DETECTION_BBOXES side data
Beta Was this translation helpful? Give feedback.
All reactions