Log in

View Full Version : ffmpeg goes out of sync


lagu2653
29th December 2005, 23:57
I'm trying to shrink some mpg-files with ffmpeg. The mpg file is 8 hours long. It's OK the first hour or so, but after that the picture is slightly before the sound. I tried AviDemux but you can only set the fps to the third decimal. 24.996 is too slow and 24.997 is too fast. At different parts of the movie I have to set the fps to 25.000, 24.998, 24.997, 24.9965, 24.996, 24.995. If I set the fps to 24.995 the sonud comes before the picture in the earlier parts of the mpg. I have used mencoder earlier for other purposes but when I did the sound was out of sync when played on my Windows machine.

Nic
30th December 2005, 11:41
@lagu2653: Are these captured transport stream files? Have you tried changing the -async and -vsync parameters? Try combinations of those, that often helps.

-Nic

lagu2653
31st December 2005, 14:39
They're captured from VHS via my PVR 350 TV card which has an Mpeg-2 encoder.

I suspect that there's a jump in the audio track, at least that's what # mpgtx -i tmp3.mpg says:
SuSEBurken:/mnt/hdb1/TV/inspelningar # mpgtx -i tmp3.mpg
warning: couldn't find any valid system header. I'm continuing anyway
tmp3.mpg
Mpeg 2 Program Stream File [Video/Audio]
Muxrate : 7.87 Mbps
Estimated Duration: 01:38:45.82s
Checking all time stamps (This may take a while.) ...
Time stamps jumped from 65652.826311 to 38.483900 at position 17a77a4
Time stamps jumped from 65652.826311 to 38.535900 at position 17af31c
Time stamps jumped from 95.728044 to 35.259022 at position 3cbfeea
Time stamps jumped from 53722.361600 to 503.630089 at position 13ef0d5c
Time stamps jumped from 47756.856178 to 766.752622 at position 1e49f424
Time stamps jumped from 94320.833278 to 781.534711 at position 1ee38630