This question can be seen as an extension of this question. I am using the ffmpeg 2.0.1 .
The following commands is useful when you want to extract parts of one big video file given time makers.
ffmpeg -i 00402.MTS -s 1280x720 -ss 0:00:05.38608 -vcodec libxvid -qscale:v 2 -acodec ac3 -ar 48000 -ab 256k -t 0:00:06.61391 m001.avi
My problem is that in the ouput file, the start value is 0 and the there is ~50ms of shift between audio and video. What argument should I use to take into account this 'start value' when extracting severals parts of the big video file ('.mts') ? What does this 'start value' mean ?
ffprobe output from big MTS video file
ffprobe m001.MTS
ffprobe version 2.0.1 Copyright (c) 2007-2013 the FFmpeg developers built on Sep 24 2013 05:31:18 with gcc 4.8 (Debian 4.8.1-10)
configuration: --extra-cflags=-I../static/include --extra-ldflags='-L../static/lib -static' --enable-gpl --enable-version3 --enable-static --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --disable-ffserver
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpegts, from 'm001.MTS':
Duration: 00:01:18.25, start: 0.455556, bitrate: 12217 kb/s
Program 1
Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
ffprobe ouput from extract sample
Input #0, avi, from 'm001.avi':
Metadata:
encoder : Lavf55.12.100
Duration: 00:00:06.64, start: 0.000000, bitrate: 4950 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (xvid / 0x64697678), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, mono, fltp, 256 kb/s
ffmpeg -i
orffprobe
, please add the output of the console.-async 1
. Does the audio start late or early?-async 1
didn't change anything.