[FFmpeg-user] Failing to produce a clip with video start offset

Robert Krüger krueger at lesspain.de
Fri Jun 27 17:15:36 CEST 2014


Hi,

I am intentionally trying to desync video and audio of an input file
by one frame by the following command line (full output is given) but
it does not work. The resulting file has a start time of zero for all
streams (you can easily check this using ffprobe). I did this
successfully for audio by basically the same command line only with
the itsoffset applied to the second input file. I assume I am making a
stupid mistake somewhere but I don't see it atm.

ffmpeg -itsoffset 0.04 -i input.mov -i input.mov -c:v mpeg4 -q 8 -c:a
pcm_s16le -t 2 -map 0:0 -map 1:1 -y video_offset_one_frame_2s.mov
ffmpeg version N-63519-g61917a1 Copyright (c) 2000-2014 the FFmpeg developers
  built on May 28 2014 14:40:18 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration:
  libavutil      52. 87.100 / 52. 87.100
  libavcodec     55. 65.100 / 55. 65.100
  libavformat    55. 41.100 / 55. 41.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
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2012-08-16 09:03:51
    encoder         : FFmbc 0.7
  Duration: 00:00:02.00, start: 0.000000, bitrate: 12543 kb/s
    Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v /
0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 10229 kb/s, 25 fps,
25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
      encoder         : mpeg4
      timecode        : 01:00:00:00
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
stereo, s32, 2304 kb/s (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
      timecode        : 01:00:00:00
Guessed Channel Layout for  Input Stream #1.1 : stereo
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2012-08-16 09:03:51
    encoder         : FFmbc 0.7
  Duration: 00:00:02.00, start: 0.000000, bitrate: 12543 kb/s
    Stream #1:0(eng): Video: mpeg4 (Simple Profile) (mp4v /
0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 10229 kb/s, 25 fps,
25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
      encoder         : mpeg4
      timecode        : 01:00:00:00
    Stream #1:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
stereo, s32, 2304 kb/s (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
    Stream #1:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
      timecode        : 01:00:00:00
Output #0, mov, to 'video_offset_one_frame_2s.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    encoder         : Lavf55.41.100
    Stream #0:0(eng): Video: mpeg4 (mp4v / 0x7634706D), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25
tbc (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
      timecode        : 01:00:00:00
      encoder         : Lavc55.65.100 mpeg4
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2012-08-16 09:03:51
      handler_name    : DataHandler
      encoder         : Lavc55.65.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
  Stream #1:1 -> #0:1 (pcm_s24le -> pcm_s16le)
Press [q] to stop, [?] for help
frame=   50 fps=0.0 q=8.0 Lsize=    1370kB time=00:00:02.00
bitrate=5613.4kbits/s dup=1 drop=0
video:993kB audio:375kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.182681%

And the check with ffprobe:

ffprobe -show_streams -i video_offset_one_frame_2s.mov | grep start_time
ffprobe version N-63519-g61917a1 Copyright (c) 2007-2014 the FFmpeg developers
  built on May 28 2014 14:40:18 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration:
  libavutil      52. 87.100 / 52. 87.100
  libavcodec     55. 65.100 / 55. 65.100
  libavformat    55. 41.100 / 55. 41.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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_offset_one_frame_2s.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf55.41.100
  Duration: 00:00:02.00, start: 0.000000, bitrate: 5613 kb/s
    Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v /
0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 4067 kb/s, 25 fps,
25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc55.65.100 mpeg4
      timecode        : 01:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      handler_name    : DataHandler
      timecode        : 01:00:00:00
Unsupported codec with id 0 for input stream 2
start_time=0.000000
start_time=0.000000
start_time=0.000000

Thanks,

Robert


More information about the ffmpeg-user mailing list