View Full Version : Is there a way to prioritize video frames?
mushahidh
18th February 2016, 18:24
Hi experts,
As we see different videos in our daily life , the obvious fact is that not every frame contains equal amount of important information. I am trying to apply a protection to video frames based on their importance in video.For that i need to prioritize a frame based on criteria(which i don't know yet). What i want to know is there any quantitative measure that can calculate frame importance or priority in video streams?
LoRd_MuldeR
18th February 2016, 22:02
If with "prioritize" you mean that you want to give certain frames a higher quality (more bits) as compared to the rest, then --qpfile is what you are looking for:
https://en.wikibooks.org/wiki/MeGUI/x264_Settings#qpfile
And, if you want to do this on a per-macroblock basis instead of a per-frame basis, we are talking about ROI (region of interest) encoding. This is only possible via API, not via CLI.
How to decide which frames (or regions) you want to "prioritize", that's a totally different question and can only be answered with more context...
mushahidh
19th February 2016, 10:18
How to decide which frames (or regions) you want to "prioritize", that's a totally different question and can only be answered with more context...
Thanks for your answer. I want to add more on it. Say for instance in foreman sequence. Initially, there isn't much movement between the frames. So loss of one frame when there isn't much difference between the lost frame and previous frame won't make much difference. But in case of sudden change between the frames and previous frame in much more different from coming frame than lost of one frame cause much more problem. So i want to prioritize video frames based on the data inside it with respect to previous frame.
Hope you understand.
Sparktank
19th February 2016, 10:53
Would this be like for security videos?
Motion tracking, per se?
mushahidh
19th February 2016, 11:50
Would this be like for security videos?
Motion tracking, per se?
Not actually. Again to be more clear. For example I have IPPP structure and GOP contains 30 frames. And as we know first I frame is much more important than P frames so i will give more priority to first I frame. Then for remaining P frames initial P frames are more important than last P frames. So on what basis can i define a threshold so that i can say initial 25% percent P frames are much important that last 25% of frames?
vivan
19th February 2016, 17:58
So, number of frames referenced is a metric you are looking for.
I believe mbtree is basically this, except on per macroblock basis.
mushahidh
19th February 2016, 19:22
So, number of frames referenced is a metric you are looking for.
I believe mbtree is basically this, except on per macroblock basis.
Yeah thanks for giving me right direction. But after having some go through of this pape (http://x264.nl/developers/Dark_Shikari/MBtree%20paper.pdf)r i start believing that it won't be so much easy if i am using encoder other than x264.
LoRd_MuldeR
19th February 2016, 19:55
Not actually. Again to be more clear. For example I have IPPP structure and GOP contains 30 frames. And as we know first I frame is much more important than P frames so i will give more priority to first I frame. Then for remaining P frames initial P frames are more important than last P frames. So on what basis can i define a threshold so that i can say initial 25% percent P frames are much important that last 25% of frames?
This is called "rate control" and "frame type decision". Every (halfway decent) video encoder does this by default ;)
You only need a --qpfile option (or ROI encoding), if you want to overwrite the encoder's rate control and/or frame type decisions, in some specific places.
See also:
* http://git.videolan.org/?p=x264.git;a=blob;f=doc/ratecontrol.txt (a bit outdated, but still gives the idea)
* https://web.archive.org/web/20120910092729/http://x264dev.multimedia.cx/archives/98
kuchikirukia
21st February 2016, 15:16
I think someone needs some b-frames.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.