Re: Chapter marks not where specified.
Tom Brock <tomb-yZYHXxUkMT10YYv+nEap2lpr/1R2p/[email protected]> Fri, 06 Apr 2012 11:23:03 +0100
| Newsgroups | gmane.comp.multimedia.dvdauthor.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Lawrence, > > > Is this sufficient to demonstrate to the ffmpeg (and probably > > mplayer) developers what I believe is the case: that the > > '-force_key_frames' option in ffmpeg, while doing exactly what its > > name says it does, does not thereby fulfil the requirement stated in > > the rationale for its inclusion? > > > > That rationale was, as written by Nicolas George, who wrote the patch: > > > > "I want to use it to ensure that there is a seek point exactly at a > > place I will probably want to jump precisely sometime, the major > > example would be the end of an opening and beginning of the program > > proper. The scene change detection system will often make it happen, > > but not always if there is a fade-in." > > I don’t think MPEG itself defines any restrictions on how often > I-frames are supposed to occur. Players of MPEG files should, in > principle, be able to start playing from any I-frame, assuming they > have some way to find them. They can even start playing from a > non-I-frame, assuming the user is willing to put up with partial > garbage on-screen until the next I-frame. > > However, DVD-Video imposes additional restrictions on top of MPEG. > Seeking is done in units of whole VOBUs, and larger groupings built on > top of them (cells, programs, chapters, PGCs). There is a requirement > in the spec that VOBUs cannot be less than 0.4 seconds in length. FFmpeg > enforces this requirement, no matter how many I-frames you tell it to > insert. Yes, sorry: I should have made it clear that I was thinking only of DVD as the target. I ran ffmpeg with -target pal-dvd. The '-force_key_frames' option is implemented in do_video_out in ffmpeg.c, not in the encoder, and it doesn't depend on 'is_dvd'. C is not my first language, but is seems that the encoder processes one frame at a time, and when it's constructed a VOBU it can simply spit it out. However, to implement something like '-force_new_VOBU', it would have to hang onto the previous completed VOBU until certain that it does need to have a GOP added to it and/or that its GOPs must be reorganized so it can be split into two VOBUs, since the maximum length of a DVD VOBU is 1 s, and the maximum PAL DVD GOP size is 12 only by default. I suppose a defence of the '-force_key_frames' option would be that it works fine for mpeg2 files, but was not intended for DVDs, so that there is no mechanism by which chapter marks can be reliably and accurately placed on a DVD. To answer an earlier question of yours, I have tried playing with a few of the ffmpeg motion estimation options, but while they vary the number of I-frames and therefore move the VOBUs around a bit, the proportion of *forced* key frames that are placed first in VOBUs remains stubbornly constant, more or less, at about 15%. If one is lucky enough force an I-frame exactly where the motion estimation code had already generated one, then it stands a better change of being first in a VOBU than one forced at what, from the code's point of view, is a random point that is about 90% certain to be in the middle of a GOP. It's a marvel that I see even a 15% success rate. Tom. ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ Dvdauthor-users mailing list Dvdauthor-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/dvdauthor-users