Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
23rd April 2014, 09:31 | #1 | Link |
Registered User
Join Date: Apr 2014
Posts: 5
|
How to implement ROI(region of interest) encoding through ffmpeg/x264
Hi, I was doing a project that needs to encode video with ROI method.
And as I checked the information on Internet, still can't find how to write the command to do that. 1. Should I check "Flexible Macroblock Ordering"? and how to implement this in ffmpeg/x264? many thanks! |
23rd April 2014, 12:56 | #2 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
x264 does not support ROI encoding "out of the box", in the sense that it detects the ROI (whatever that may be) for you and then adjusts the quantizers accordingly. In other words: You can not enable ROI encoding with a simple commannd! But there is an API provided by x264 that allows for implementing ROI encoding yourself, i.e. in the calling application.
See here: http://git.videolan.org/gitweb.cgi/x...e681dc21d43ade
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 23rd April 2014 at 13:01. |
24th April 2014, 16:42 | #3 | Link |
Registered User
Join Date: Apr 2014
Posts: 5
|
so... in that case, I should try compile these files over original x264 and make it to my version?
Can I have more detail about ho do turn it on? sorry if this bothers you, cuz I've been stuck on this issue for a while. this API offers me to control quant_offsets by giving what parameter? or can you bring me any example? many many thanks! |
24th April 2014, 20:12 | #4 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
Yes. I have no complete example, but see "x264.h" for details. The interesting part is highlighted in the commit that I already linked above: http://git.videolan.org/gitweb.cgi/x...088a3b5#patch5
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 24th April 2014 at 22:10. |
|
7th May 2014, 08:04 | #6 | Link |
Registered User
Join Date: Apr 2014
Posts: 5
|
What I am trying to do is: encoding a video file by x264, and the outcome video should content a part of area that has higher quality than the other area.
let's say a 1280x720 mp4 format file for input. and output should hold the same resolution and left part area (640*720) has the better quality than the right one. Is it possible to encode that way by x264? Can you give me some suggestion? thanks! |
7th May 2014, 11:56 | #7 | Link | ||
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
Quote:
Yes. By setting the quantizer offsets accordingly. See here:
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 7th May 2014 at 11:59. |
||
7th May 2014, 17:19 | #8 | Link | |
Registered User
Join Date: Apr 2014
Posts: 5
|
Quote:
can this be done by the API you mentioned? |
|
7th May 2014, 18:20 | #9 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
YES. How many times do you want to hear that it is possible? You just have to code it
(If you can control the quantizers on a per-marcoblock basis, why it shouldn't be possible to increase/decrease compression for one half of the frame?)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 7th May 2014 at 18:42. |
Tags |
ffmpeg, fmo, roi, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|