Converting 23.976 to 25fps [WAS: Re: [MPlayer-users] 3:2 pulldown]
Robert R. Wal
rrw at hell.pl
Sun Jan 11 18:44:11 CET 2004
On 04.01.10 Martin Emrich pressed the following keys:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Am Fr, den 09.01.2004 schrieb Martin Emrich um 17:20:
> > [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> > Hi!
> > Am Mi, den 07.01.2004 schrieb Martin Emrich um 00:51:
> > > Done. Hacked the AVI to 25fps. Sox will hopefully take care of the audio.
> > I made the audio (25/23.976) times faster (this went correct, as
> > (audiolength_before/audiolength_after) == (25/23.976)) and muxed the
> > audio file back into the hacked avi with "-oac copy -ovc copy -audiofile
> > audio-25.wav". But all I get is terrible audio desync. That much for a
> > PAL SVCD.
> Today, I started all over again:
> Took the original AVI, recoded it to very-high-bitrate MPEG4 with PCM
> audio (Hacking the audio sample rate on the origial with MP3 audio didnt
> work), plays fine, with no visible quality loss.
> Then I hacked the header to an audio sample rate of 45983Hz
> (44100*(25/23.976)). (I hacked the videe frame time to 0.0400sec =
> 0x9c40, too, but mplayer didn't care, uses still 23.976fps; wonder where
> it gets this number from...).
The problem is your expression. Think for a moment: you want to play the
sample faster and be perceived as 44100, so obviously the frequency has
to be lower. So the expression is 44100 * (23.976/25). And I did exactly
that with results in perfect sync. Only I did reencoded audio
separatelly and changed AVI fps without reencoding:
mplayer -vo null -vc copy -ao pcm -aofile in.wav in.avi
sox in.wav -r42294 -swc2 -t raw - | sox -swc2 -r 44100 -t raw - out.wav
mencoder -nosound -ovc copy -fps 25 -o out.avi in.avi
mencoder -audiofile out.wav -ovc copy -oac [audio options] -o final.avi out.avi
For 48kHz audio it would be 46034.
Robert R. Wal Bastard Operator From 188.8.131.52
mail/jabber/wpkontakt/msn: rrw at hell.pl gg: 2785415 icq: 8853661
More information about the MPlayer-users