Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When converting a mp4 to TS, I am observing ffmpeg adding a "start" delay that the input file did not seem to possess. For my input, ffprobe reveals:

ffprobe version N-57943-g7b76976 Copyright (c) 2007-2013 the FFmpeg developers
  built on Nov  6 2013 14:00:40 with gcc 4.4.5 (Debian 4.4.5-8)
  configuration: --enable-libx264 --enable-gpl
  libavutil      52. 52.100 / 52. 52.100
  libavcodec     55. 41.100 / 55. 41.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.102 /  3. 90.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4-in-7A8FEADA-5EA6-11E3-AD13-4DD2258FBC88.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2013-11-08 15:15:12
  Duration: 00:00:11.56, start: 0.000000, bitrate: 2994 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 2807 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2013-11-08 15:15:12
      handler_name    : ?Mainconcept Video Media Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2013-11-08 15:15:12
      handler_name    : #Mainconcept MP4 Sound Media Handler

But when processed using ffmpeg:

ffmpeg -i '/tmp/test-no-qp.C2162DFC-6297-11E3-A68D-05E505A3FB93/output.mp4-in-7A8FEADA-5EA6-11E3-AD13-4DD2258FBC88.mp4' -s 1920x1080 -preset ultrafast -f mpegts -c:v libx264 -qp:v 18 `enter code here`

I get an extra start delay:

(Snipping the same headers from the input side)
Input #0, mpegts, from 'output.mp4-out-7A8FEADA-5EA6-11E3-AD13-4DD2258FBC88.mp4':
  Duration: 00:00:11.55, start: 1.400000, bitrate: 1985 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s

Duration seems to have been adjusted as well, but I didn't ask for the adjustment. How do I get rid of that? What did I do that triggered that effect? Is there something else about my ffmpeg line that looks off?

(ffmpeg version is the same as the ffprobe above.)

share|improve this question

migrated from stackoverflow.com Jan 13 '14 at 21:26

This question came from our site for professional and enthusiast programmers.

    
what is the timestamp of the first frame in the input file? – rogerdpack Jan 13 '14 at 17:03
    
This is what I see via ffprobe -of json -show_frames (reduced) { "key_frame": 1, "pkt_pts": 1001, "pkt_pts_time": "0.033367", "pkt_dts": 1001, "pkt_dts_time": "0.033367", "pkt_duration": 1001, "pkt_duration_time": "0.033367", "pkt_pos": "7356", "pkt_size": "1021", }, – swizzcheez Jan 13 '14 at 18:20
    
what about ffprobe on the new file, what are the first audio and video frames? – rogerdpack Jan 13 '14 at 18:42
    
"key_frame": 1, "pkt_pts": 126902, "pkt_pts_time": "1.410022", "pkt_dts": 126902, "pkt_dts_time": "1.410022", "pkt_duration": 3003, "pkt_duration_time": "0.033367", "pkt_pos": "564", "pkt_size": "6738", – swizzcheez Jan 13 '14 at 18:50
    
ffmpeg is a programmer tool so I'm ok with it. Maybe migrating to a/v would work...anyway I didn't see the ffprobe for the first audio packet. you might also ask on the ffmpeg-user ML – rogerdpack Jan 13 '14 at 20:58

You must log in to answer this question.

Browse other questions tagged .