[FFmpeg-user] Comments about audio sync invited

James Linder jam at tigger.ws
Thu Jul 11 03:29:01 CEST 2013

On 10/07/2013, at 10:19 PM, Nicolas George wrote:

> Le duodi 22 messidor, an CCXXI, James Linder a écrit :
>> [dvr] /home/dvr [132]% ./ffmpeg -f pulse -i default -f v4l2 -i /dev/video0 -vtag divx -s 384x288 -r pal -q:v 5 -f tee  -map 0:a -map 1:v Wed.avi | cat >Wed1.avi
> The tee muxer in this command line does not make any sense. The cat is
> completely useless too. 

Hi Nicolas

Please explain a little more.

I want to output the pipe to ffplay or mplayer but after a while my display and my recorded file show pauses every 5 seconds or so of 100mS or so. The cat command would isolate the display process from the mix. vmstat, top, iostat and gnome-system-monitor do not give any clues to the reason for jerky display - they look the same when steady and jerky recording is taking place.

Cat also gives two files that I may inspect to confirm they are identical before proceeding with record-and-display.
Why is my cat completely useless?

snip from 1st post: (well the whole post :-) -----------------------------------------------------------------------------
Some years ago I setup a record-v4l-camera-from-interface with audio on line in using transcode. Perfect, but at kernel 2.6.32

I modernized the recording system only to find transcode still uses VIDIOC_S_PARM ioctls that were removed from kernel cica 2.6.33

I use ffmpeg now. All good except the audio is not synced. I apply -itsoffset and all is good for an hour or two then the recording hesitates every 5 or so seconds for say 100mS. I've looked at top, vmstat, iostat even gnome-system-monitor and can see nothing that would be causing it.

ffmpeg -f pulse -itsoffset 0.2 -i default -f v4l2 -i /dev/video0 -vtag divx -s svga -r pal -q:v 5 file.avi -s svga -f rawvideo - | ffplay -f rawvideo -i - -s svga

There is not any swap or obvious unusual disk activity.

Any ideas welcome

I tried avconv instead of ffmpeg and the stuttering ceased (joy, rapture) but I cannot sync audio (sad)
avplay stutters where ffplay does not


More information about the ffmpeg-user mailing list