[FFmpeg-trac] #681(avfilter:open): -vf mp=pullup leads to massive A/V-desync
FFmpeg
trac at avcodec.org
Wed Oct 17 16:51:39 CEST 2012
#681: -vf mp=pullup leads to massive A/V-desync
-------------------------------------+-------------------------------------
Reporter: dericed | Owner:
Type: defect | Status: open
Priority: normal | Component: avfilter
Version: git-master | Resolution:
Keywords: mpfilter | Blocked By:
pullup | Reproduced by developer: 1
Blocking: |
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by darkmoon):
Thank you, cehoyos, for your work on this. I found this ticket #681 while
searching for a filterchain to do effective ivtc in ffmpeg.
There is an excellent discussion in the Mplayer documentation of the
various ivtc options in section
[http://www.mplayerhq.hu/DOCS/HTML/en/MPlayer.html#menc-feat-telecine-
encode-mixedpt 7.2.3.4. Mixed progressive and telecine]. (The ''filmdint''
filter mentioned there, which sounds very promising, is unfortunately not
supported in ffmpeg.)
When I first found this ticket,
[http://ffmpeg.org/trac/ffmpeg/ticket/681#comment:3 this solution] was
your last update. When I tried it, I too experienced massive A/V desync.
In fact, there was desync with every other Mplayer filter I tried
''except'' the one you quote
[http://ffmpeg.org/trac/ffmpeg/ticket/681#comment:4 just above], and with
the same options—
{{{
mp=detc=am=1:dr=2
}}}
for example, also causes desync.
Section 7.2.3.4 of the Mplayer docs suggests placing the ''softpulldown''
filter before ''detc'' or ''ivtc'' in order to insure those filters have a
uniformly telecine'd stream to process. Additionally, I noticed that the
output of ''detc'' is interlaced. I was able to get good results with this
filterchain:
{{{
-vf
mp=softpulldown,mp=detc=am=0:dr=2:fr=0,yadif,setpts='N/(24000/1001*TB)' -r
24000/1001
}}}
----
Ultimately, the reason for the A/V desync with the other Mplayer filters
is the equation for ''setpts'' (='N/(24000/1001*TB)') which, according to
[http://ffmpeg.org/ffmpeg.html#Examples-14 Section 31.2.1] of the ffmpeg
docs, sets a fixed frame rate. What is needed is an equation for
''setpts'' that produces an output stream with the same '''''running
time''''' as the input stream, regardless of how many frames the preceding
filters drop. Perhaps someone with some math skills and an understanding
of the ''setpts'' internal variables could write one for us???? :)
(It seems likely that MEncoder includes code to make this calculation
internally. In every discussion I have read concerning how to ivtc with
MEncoder, there is no mention of any A/V desync problems, and no inclusion
of any sort of a ''setpts'' filter in any of the sample command
lines—these things are conspicuous by their absence. Instead, MEncoder has
separate command line options for the input stream framerate, and the
desired output framerate.)
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/681#comment:5>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list