[FFmpeg-user] A/V sync problem when cutting using -ss -t

Björn Dolk mail at bjorndolk.com
Sun Jun 1 23:19:17 CEST 2014


FFmpeg is an awsome piece of SW. Its simply amazing.

However I have the following problem.

I have films from iphone and another Camera. I am cutting first 5 seconds
of each movie and joining them to a clip. My problem is A/V gets out of

Outline of method
Cut using -ss 00:00:00 -t 00:00:05   (libx264 aac mp4)
join using  -f concat -i       (copy copy mp4)

I suspect the A/V sync issue comes from the 5s clips have differnt lenghts
of audio and video. Video is 5s 0ms audio 5s 24ms.
FFmpeg complains when creating the cut clip
[swscaler @ 0xa574b60] Warning: data is not aligned! This can lead to a

I provide a link to the full clip as well as to the cut 5s clip of it.

Is it correct or incorrect that the A/V differs in lenghts? How can I
correct it or work around this problem?

Full clip 35MB

Cut clip 3 MB (with different lenghts A vs V)


ffmpeg -version
ffmpeg version N-63624-g4ba8560
built on May 31 2014 05:13:15 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32
--extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static'
--extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static'
--extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared
--disable-ffserver --disable-doc --enable-bzlib --enable-zlib
--enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl
--enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray
--enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3
libavutil      52. 87.100 / 52. 87.100
libavcodec     55. 65.100 / 55. 65.100
libavformat    55. 42.100 / 55. 42.100
libavdevice    55. 13.101 / 55. 13.101
libavfilter     4.  5.100 /  4.  5.100
libswscale      2.  6.100 /  2.  6.100
libswresample   0. 19.100 /  0. 19.100
libpostproc    52.  3.100 / 52.  3.100

/Regards Björn

More information about the ffmpeg-user mailing list