View Single Post
Old 16th December 2020, 17:57   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Quote:
Originally Posted by nji View Post


1. Why isn't vfr used more often?
I made some tests and found out that it is MUCH smaller
for movies with lots of still scenes (as you find often
at audios at youtube).
If I build a movie (H264) with one identical image (1024 x 736)
the vfr version uses 80kB (independent number of frames).
The cfr version uses 1.3kB/frame (which gives large files
if you consider fps, or the typical "audio movies" on youtube).


It's not completely independent - it also depends on the number of frames and max keyframe interval of your encoding settings. The max keyframe interval is when encoder must place a new keyframe. eg. If you fps was 24, you had 10 second video, 240 original frames, you could theoretically represent that with 1 frame if your keyframe interval was 240 or more. But some devices, scenarios have limitations on max keyframe intervals for specifications. e.g. a "24p" typical blu-ray can only have a max keyframe of 1 second (so 24 frames). Default x264 setting is 250. You can set it to "infinite".


VFR can be ok for some types of end distribution , but -

-Impaired navigation. The ability to seek in a video is determined by keyframe placement. The entire GOP has to be decoded, so it can be slow. eg. If you have a slideshow presentation with long periods of time represented by 1 keyframe - you might have to wait a long time, and sometimes cannot seek at all (depends partially on the playback software)

-It won't be "much smaller" for typical content using modern compression. There is some filesize reduction, but a typical movie with many duplicates (e.g. low fps animation), might only save 5-15%. A typical hollywood movie maybe 0.5-1%. The reason is b-frames do not "cost" a lot to encode. Yes, if you have a slideshow/presentation where there can be long periods of no change - the savings can be higher.

-Min fps on YT re-encode was 6 FPS (it might have changed) . Theoretically you could have 1 frame video for the upload 0.000001 FPS (or some small number or functional equivalen), but YT re-encodes it anyways it to 6 FPS. It can save you some bandwidth on the upload, and the YT version is still seekable to an extent, but not a massive savings on YT end.

-difficult to edit (so preferably not used for acquistion)

-Potential loss of real data. Small movements might not be detected in the VFR conversion, depending on how it's done. eg. Subtle changes like eye movement might be lost by automatic conversions if they are not QCed. Usually there is a threshold control for duplicates, but lossy compression can already cause differnces between duplicate frames . Added grain in a movie. (ie. it can difficult to determine what is supposed to be a duplicate automatically) . Often the cutoff is a grey overlapping area and needs human eyes to be accurate.



Quote:
2. Conversion cfr to vfr - is there an easy way?
(This question is often asked the other way round,
as if you want to use the timeline in any way in
a video editor it needs to deal with vfr
which most of them don't.)
Is there an easy way to turn a cfr to a vfr?
A parameter would be a similarity limit,
so if below should be taken as "still scene"?
Or do I have to do it all manually
(Identify the dupes (ffmpeg), build timecode file from that,
remove dupes, update the timecode, hopefully audio stays sync)?


2) I think handbrake can do it for "easy" and automatic without options

I prefer avisynth dedup, because you have the ability to adjust thresholds (your "similarity limits") and debug with overlays (you can "see" what you're doing and adjust), settings to decide which frame to keep (e.g. sometimes the 1st duplicate frame is higher quality, sometimes the last) . Many options like limiting strings of duplicates , and it generates timecodes for you. The main negative is the max limit is strings of 20 . It's meant for typical sources. So for slideshows/presentations with long gaps with no activity it's not as useful

Manual timecodes is not bad when you have long gaps such as presentations, because there will only be a few entries
poisondeathray is offline   Reply With Quote