Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been trying to re-encapsulate some videos from QuickTime to MP4 with ffmpeg, but the results are somewhat messed up. The codecs are all MP4 compatible so that all works fine. The problem is that the resulting MP4 files all have huge amounts of video stutter in them. For example, it will play, then skip back half a second, then go back to where it is supposed to be, then do another skip back and so on.

I've tried various combinations of the following flags: -c copy -vcodec copy -acodec copy -copyts, but I haven't found anything that works. So what do I need to do to avoid stutter while re-encapsulating?

Here I try -c copy -copyts:

$ ffmpeg -i in.mov -c copy -copyts out2.mp4
ffmpeg version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 13 2013 00:49:34 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2013-02-13 06:40:06
  Duration: 00:45:10.08, start: 0.040000, bitrate: 503 kb/s
    Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p, 644x364 [SAR 1:1 DAR 23:13], 402 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
Output #0, mp4, to 'out2.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf54.63.104
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 644x364 [SAR 1:1 DAR 23:13], q=2-31, 402 kb/s, 25 fps, 16k tbn, 1k tbc
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 95 kb/s
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=67751 fps=15817 q=-1.0 Lsize=  166739kB time=00:45:10.04 bitrate= 504.0kbits/s    
video:133281kB audio:31756kB subtitle:0 global headers:0kB muxing overhead 1.031415%

Here I try setting the audio and video codecs to copy:

$ ffmpeg -i in.mov -vcodec copy -acodec copy out4.mp4
ffmpeg version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 13 2013 00:49:34 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2013-02-13 06:40:06
  Duration: 00:45:10.08, start: 0.040000, bitrate: 503 kb/s
    Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p, 644x364 [SAR 1:1 DAR 23:13], 402 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
Output #0, mp4, to 'out4.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf54.63.104
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 644x364 [SAR 1:1 DAR 23:13], q=2-31, 402 kb/s, 25 fps, 16k tbn, 1k tbc
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 95 kb/s
    Metadata:
      creation_time   : 2013-02-13 06:40:06
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=67751 fps=15495 q=-1.0 Lsize=  166739kB time=00:45:10.00 bitrate= 504.0kbits/s    
video:133281kB audio:31756kB subtitle:0 global headers:0kB muxing overhead 1.031400%
share|improve this question
    
Does it happen for all MOV files or just particular ones? If the latter, can you supply a sample? Can you try mp4box -add in.mov out.mp4 and see if that produces a playable file? –  slhck Aug 14 '13 at 7:27
    
Where do I get mp4box? –  CyberSkull Aug 14 '13 at 21:48
    
From gpac.wp.mines-telecom.fr/mp4box for example – it's not particularly hard to find though. I'm sorry to ask again, but does it occur with all files or just one, and would you happen to have a sample? –  slhck Aug 14 '13 at 21:53
    
@slhck Occurs on all but one file. –  CyberSkull Aug 14 '13 at 21:57
    
@slhck Do I need to get the whole GPAC package or can I just get mp4box? –  CyberSkull Aug 14 '13 at 22:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.