[FFmpeg-user] Audio/Video out of sync: -itsoffset value limit

MrNice wxcvbn2006 at iol.ie
Mon Nov 23 11:57:39 CET 2015



On 22/11/15 20:15, MrNice wrote:
> Hi,
> 
> I try to capture with the simplified command
> ./ffmpeg -debug 1 -f pulse -thread_queue_size 1024 -i
> alsa_input.pci-0000_00_14.2.analog-stereo -f v4l2 -channel 1
> -thread_queue_size 1024 -i /dev/video0 -c:v ffv1 -level 3 -g 1 -aspect
> 4:3 -pix_fmt yuv422p -top 0 -c:a pcm_s16le -channel_layout stereo
> /Store3/Test/t_`date +%Y%m%d_%H%M`.mkv
> 
> I get audio out of sync late by 1.7 second.
> If I add -itsoffset 0.70 to video input, I get audio just 1 second late.
> But when I rise the value above 1.2, I get a lot of drops. I noticed as
> well that above 1.0 the debug lines are output in burst with short
> pauses between them. Pauses time increases with value.
> 
> What is/does the limit of -itsoffset value?
> 
> BTW, I tried with:
> -af aresample=async=1 => Nothing better
> -ts mono2abs/abs => Do nothing only start audio/video value closer
> -Audio output before video output => Nothing
> -vsync passthrough => Nothing
> -ss 1.70: in video input => /dev/video0: could not seek to position
> 34725.055 and a lot of drops
> -ss 1.70 in audio input => alsa_input.pci-0000_00_14.2.analog-stereo:
> could not seek to position 1448217795.270
> -ss 1.70: in output => Nothing
> -threads 1 => Nothing
> 
> Is there another way to sync audio/video?
> Any suggestion welcome.
> 
> Many thanks
> 

I'd like to add some more info.
When I use sdl to preview while recording
./ffmpeg -debug 1 -f pulse -thread_queue_size 1024 -i
alsa_input.pci-0000_00_14.2.analog-stereo -f v4l2 -channel 1
-thread_queue_size 1024 -i /dev/video0 -c:a pcm_s16le -channel_layout
stereo -c:v ffv1 -level 3 -g 1 -aspect 4:3 -pix_fmt yuv422p -top 0
/Store3/Test/t_`date +%Y%m%d_%H%M`.mkv -aspect 4:3 -f sdl "Dazzle output"

Preview audio/video is perfectly sync even with or without -itsoffset


More information about the ffmpeg-user mailing list