Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

Draw bounding box

naing__aung
Beginner
546 Views

I would like to extend sample_decode by drawing bounding box in rendering. Is there any example for such extensions?

0 Kudos
4 Replies
Mark_L_Intel1
Moderator
546 Views

Hi Aung,

Yes, we don't have a sample code for bounding box. But you should be able to do it by referencing to different code I listed here.

To do the bounding box, you have to use VPP (Video post processing) function in Media SDK, this is called VPP composition which requires 2 input surface(frame buffer). First you have to take the output surface from sample_decode; the you should create another surface for bounding box.

You can familiar with VPP usage by referring "simple_6_decode_vpp_postproc" sample code of our tutorial code from the following URL:

https://software.intel.com/en-us/media-sdk/training

You can also refer to following code for more complicated cases:

https://github.com/Intel-Media-SDK/MediaSDK/tree/master/samples/sample_vpp

 

Noticed to configure the VPP for composition, refer to the following code in "sample_vpp":

https://github.com/Intel-Media-SDK/MediaSDK/blob/master/samples/sample_vpp/src/sample_vpp_config.cpp#L274 ;

The developer guide to composition striation is at page 72 of following developer guide:

https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.pdf

Or the online developer guide which might be obsoleted but good enough for this time

Let me know if you have further questions 

Mark

0 Kudos
naing__aung
Beginner
546 Views

Hi Mark:

It seems Stream composition is supported ONLY for Xeon.

From sample_vpp

"Streams composition works only on the Intel ® Xeon ® processor E3-1200 v3 product family with hardware SDK
library."

Aung

0 Kudos
naing__aung
Beginner
546 Views

Please disregard comment on E3-1200 limitations. The composition function is partially functional on my i7.

I'm referring to inputs from https://software.intel.com/en-us/forums/intel-media-sdk/topic/610950

 

The output is as expected for par file.

 

primarystream=/home/movidius/Downloads/HD_1frame.yuv
width=1920
height=1080
cropx=0
cropy=0
cropw=1920
croph=1080
dstx=0
dsty=0
dstw=1920
dsth=1080
framerate=25
fourcc=nv12


stream=/home/movidius/Downloads/HD_1frame.yuv
width=1920
height=1080
cropx=0
cropy=0
cropw=1920
croph=1080
dstx=0
dsty=0
dstw=640
dsth=360
framerate=25
fourcc=nv12

 

 

However, for NV12 to be blended with RGBA case : I'm getting the following errors:

[ERROR], sts=MFX_ERR_LOCK_MEMORY(-7), OutputProcessFrame, MFX_ERR_NONE!=sts error at /home/movidius/Downloads/MediaServerStudioProfessional2018R2/MediaSamples_Linux_2018R2/samples/sample_vpp/src/sample_vpp.cpp:207

[ERROR], sts=MFX_ERR_LOCK_MEMORY(-7), main, OutputProcessFrame failed at /home/movidius/Downloads/MediaServerStudioProfessional2018R2/MediaSamples_Linux_2018R2/samples/sample_vpp/src/sample_vpp.cpp:951

Is the bug mentioned in https://software.intel.com/en-us/forums/intel-media-sdk/topic/610950 resolved?

primarystream=/home/movidius/Downloads/HD_1frame.yuv
width=1920
height=1080
cropx=0
cropy=0
cropw=1920
croph=1080
dstx=0
dsty=0
dstw=1920
dsth=1080
framerate=25
fourcc=nv12


stream=/home/movidius/Downloads/cadbury_rgba.rgb
width=494
height=390
cropx=0
cropy=0
cropw=494
croph=390
dstx=0
dsty=0
dstw=494
dsth=390
framerate=25
fourcc=rgb4
PixelAlphaEnable=1

 

 

 

 

0 Kudos
Mark_L_Intel1
Moderator
546 Views

Yes, for composition, you should use either NV12 or RGB format.

I think you have to do color converting with VPP first. See the following comment in the developer guide at page 71:

The only supported combinations of input and output color formats are:

RGB to RGB,
NV12 to NV12,
RGB and NV12 to NV12, for per pixel alpha blending use case.

Mark

0 Kudos
Reply