- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to dynamically set the encoder to encode a specific ROI with high quality in respect to the rest of the image?
Or alternatively set the encoder to encode an ROI as Intra_Block_4x4?
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Yossi - You can specify an ROI size during encoder function using the mfxExtEncoderROI. This structure can be specified for every frame to be encoded and then passed to the EncodeFrameAsync call-back function. This structure specifies the ROI that the encoder has to focus on, and has to align on macro-block boundaries. You can find more information in the doc/mediasdk-man.pdf document:p112.
If you are looking for a global setting instead (where you specify the ROI for the entire video stream), you can use the Crop values in the mfxFrameInfo structure.
Hope this answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sravanthi for you quick reply.
Actually, I did try to use mfxExtEncoderROI, but after I specified the ROI using this function, I used mfxvideoencoade_Query and got status = -3 which I think indicates that ROI feature is not supported. I tested the same code on different machines (different h/w) and always got the same 'status = -3' error so I assumed that this (i.e ROI) feature is indeed not supported yet.
After reading your reply, I'll get back to the code I wrote and double-check it to see that I haven't missed something.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, after updating my HD Graphic Driver the code seems to be working fine (no more status = -3),
but IMHO the ROI doesn't look like it was encoded with higher quality.
Any advice?
Here's my code:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yossi,
Your configuration looks correct. What driver version are you using now?
To see if ROI was really treated by bitrate control differently you can check QPs of macroblocks within the ROI using some stream analyzer, e.g. Elecard's. If you'll see that there is a single QP for the whole frame then it will mean ROI wasn't applied.
Also, are you using it with AVC? With CBR or VBR bitrate control mode?
If you find it's not working please send us the tracer tool log so that we could replicate your full configuration.
Regards,
Nina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using CBR bitrate control mode, and it looks like the QP of all MB are the same.
Do you have any working example which uses MFX_EXTBUFF_ENCODER_ROI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yossi,
mfxExtEncoderROI is only supported in Windows with CQP bitrate control mode, it is not supported in CBR. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yossi,
ROI works only with the CQP bit control method, and not with CBR(which is mentioned in our manual, sorry for the confusion).
Attached is the changes you need to do to use ROI in sample_encode. cmd line : sample_encode.exe h264 -i ducks_1080p.yuv -o out_roi_async_1.h264 -cqp -qpi 17 -qpb 17 -qpp 17 -async 1 -hw -f 30 -w 1920 -h 1080
You can change the ROI size using top, bottom, left, right params.
To check if it is working fine, use Intel(R) Video Pro Analyzer to check the QP heat map, through Info overlay mode. In case this doesn't work, please let us know your system details we will look at it.
Thanks,
Surbhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Surbhi,
I ran sample_code with your changes and indeed it seems to be working (meaning, better quality for the ROI) BUT only for the first frame of the video.
Do you have any idea why?
Maybe I have to re-set the ROI option inside the Encoding Loop?!
Thanks,
Yossi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
read once more original answer from Sravanthi --> ROI extended buffer for a frame
SRAVANTHI K. (Intel) wrote:
Hello Yossi - You can specify an ROI size during encoder function using the mfxExtEncoderROI. This structure can be specified for every frame to be encoded and then passed to the EncodeFrameAsync call-back function. This structure specifies the ROI that the encoder has to focus on, and has to align on macro-block boundaries. You can find more information in the doc/mediasdk-man.pdf document:p112.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page