Community
cancel
Showing results for 
Search instead for 
Did you mean: 
naing__aung
Beginner
109 Views

Draw bounding box

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
109 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...;

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

naing__aung
Beginner
109 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

naing__aung
Beginner
109 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

 

 

 

 

Mark_L_Intel1
Moderator
109 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

Reply