[FFmpeg-user] FFmpeg video track too fast

David Lynam david.lynam at redbrick.dcu.ie
Sat Aug 25 01:59:15 CEST 2012


Hi,

I'm trying to record using ffmpeg w/ x11grab and pulseaudio. However, when I
record my desktop, I notice that the video plays back too quickly and as such
goes out of sync with the audio. The audio also seems to sometimes speed up or
slow down for a few seconds when (for example) I play a new song.

I'm using ffmpeg 1:0.11.1-1 and pulseaudio 2.1-1 on Arch Linux x86_64. 

A sample command would be like so:

ffmpeg -i pulse -f default -acodec libmp3lame -aq 8 -i x11grab -f :0.0 -vcodec libx264
-s 1920x1080 -threads 0 -f flv output.mkv

Sorry, I'm typing this from memory (not at my desktop PC) so the arguments might be
a bit off. I've tried restricting the framerate but the video still ends up in
the same place too quickly, albeit in a much jumpier fashion due to fewer
frames.

Pulseaudio is set to 48000Hz and I have ffmpeg resampling to 44100Hz (at times)
which is necessary due to MP3 encoding.

So far I've spent days trying to get an error-free stream using ffmpeg with no
luck. Problems have been caused by pulseaudio, jack (a moment of desperation)
and ffmpeg. Weirdly enough, FFsplit on Windows (which uses ffmpeg) works
flawlessly out of the box. I haven't found a solution to this specific issue. Has anyone
else experienced it?

I use VLC and ffplay to check the state of the recorded video. Could it be that
I use ctrl-C to stop recording and that's somehow breaking the video track?

I'm guessing hardware isn't the issue. My specs are:
AMD Phenom II X6 2.8GHz
8GB DDR3 RAM
AMD Radeon HD6870 1GB

I can provide logs and other specifics on request. I apologise for not being too
thorough but I'm quite new to ffmpeg and streaming so am quite lost.

Thanks so much in advance,
David


More information about the ffmpeg-user mailing list