[FFmpeg-user] Set start time offset in ts video segment output from mp4 movie clip input

Peter Chen pdchen at gmail.com
Sat Jul 6 01:47:53 CEST 2013


I'm converting an mp4 movie clip into a ts video segment using the
following command:

   > ffmpeg -i input-segment-4.mp4 -vcodec copy -acodec copy -qscale 0
-vbsf h264_mp4toannexb -y -r 24 -vf transpose=1 -f
mpegts output-segment-4.ts

This ts video segment will be part of an HLS (HTTP Live Streaming) video
stream.

The ffmpeg conversion works great.

I might not be asking the following question using the proper terminology,
but here's what I'd like to do. I'd like the output file, called
output-segment-4.ts in the ffmpeg command above, to have a start time
offset of, say, 40 seconds. So, in an HLS video stream that contains these
output ts segments, output-segment-0.ts would have a start time of 0
seconds, output-segment-1.ts would have a start time of 10 seconds, etc...

Currently, if I'm reading the output of ffprobe correctly, every ts file
shows a start time offset of about 1.4 seconds. Below is the output of
"ffprobe output-segment-4.ts". I'm basically trying to
manipulate output-segment-4.ts so "start: 1.421678" becomes "start: 40.0"
in the line "Duration: 00:00:09.95, start: 1.421678, bitrate: 1718 kb/s".

In summary, how do I set that start field?

Thanks for your help.

----------------------------------

> ffprobe output-segment-4.ts

ffprobe version N-54474-g9f89beb Copyright (c) 2007-2013 the FFmpeg
developers
  built on Jul  5 2013 07:00:23 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration:
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.101 / 55. 18.101
  libavformat    55. 11.100 / 55. 11.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 78.100 /  3. 78.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Input #0, mpegts, from 'output-segment-4.ts':
  Duration: 00:00:09.95, start: 1.421678, bitrate: 1718 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Baseline) ([27][0][0][0] / 0x001B),
yuv420p, 710x400, 29.97 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x101](und): Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp, 110 kb/s


More information about the ffmpeg-user mailing list