[FFmpeg-user] Why the ffmpeg split the video have more than some timestamp use -t

Steven Liu lingjiujianke at gmail.com
Tue Nov 27 07:57:13 CET 2012


Hi guys


               I have a question, when i use the command  to split the
video file and transcode the file.
              I find the timestamp always more or less than the
timestamp which in input use -t

              for example:

                     ffmpeg -y -ss 00:00:10.00 -i input.mkv -strict
experimental -acodec aac -vcodec libx264 -s 800x480 -r 25 -b:v 800k
-b:a 128k -r:a 44100  -vprofile main -vlevel 3.1  -map 0  -copyts -f
mpegts -t 20 output.ts


             I don't know if you can see the attachement file, so i
paste the output context here.  and split the context use
"==================="
=================================================================================================
    ffmpeg version N-47117-g4079210 Copyright (c) 2000-2012 the FFmpeg
developers
  built on Nov 27 2012 13:26:53 with gcc 4.4.4 (GCC) 20100726 (Red Hat 4.4.4-13)
  configuration: --enable-libx264 --enable-gpl --libdir=/usr/local/lib
--enable-debug --enable-debug=3 --enable-avfilter --disable-stripping
  libavutil      52.  9.102 / 52.  9.102
  libavcodec     54. 77.100 / 54. 77.100
  libavformat    54. 37.100 / 54. 37.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 23.102 /  3. 23.102
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 17.101 /  0. 17.101
  libpostproc    52.  2.100 / 52.  2.100
Input #0, matroska,webm, from 'kaka.mkv':
  Metadata:
    creation_time   : 2009-10-07 15:23:35
  Duration: 00:01:02.44, start: 0.000000, bitrate: 13589 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x796, SAR 1:1
DAR 480:199, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      title           : Transformers.Revenge.of.the.Fallen.2009
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp,
1536 kb/s (default)
    Metadata:
      title           : DTS-HDMA core 1536k
    Stream #0:2(chi): Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Metadata:
      title           : DD2.0 192K
    Stream #0:3(eng): Audio: ac3, 48000 Hz, stereo, s16, 224 kb/s
    Metadata:
      title           : DD2.0 224K
[libx264 @ 0x1c4ff00] using SAR=288/199
[libx264 @ 0x1c4ff00] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x1c4ff00] profile Main, level 3.1
Output #0, mpegts, to 'output.ts':
  Metadata:
    encoder         : Lavf54.37.100
    Stream #0:0(eng): Video: h264, yuv420p, 800x480 [SAR 288:199 DAR
480:199], q=-1--1, 800 kb/s, 90k tbn, 25 tbc (default)
    Metadata:
      title           : Transformers.Revenge.of.the.Fallen.2009
    Stream #0:1(eng): Audio: aac, 48000 Hz, 5.1(side), fltp, 128 kb/s (default)
    Metadata:
      title           : DTS-HDMA core 1536k
    Stream #0:2(chi): Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      title           : DD2.0 192K
    Stream #0:3(eng): Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      title           : DD2.0 224K
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (dca -> aac)
  Stream #0:2 -> #0:2 (ac3 -> aac)
  Stream #0:3 -> #0:3 (ac3 -> aac)
Press [q] to stop, [?] for help
[aac @ 0x1c40fc0] Que input is backward in time
[mpegts @ 0x1c4f600] st:0 PTS: -72000 DTS: -72000 < -70424 invalid, clipping
Que input is backward in timee=       0kB time=00:00:00.00 bitrate=
0.0kbits/s dup=0 drop=8
[mpegts @ 0x1c4f600] st:0 PTS: -21150 DTS: -21150 < -20474 invalid, clipping
Encoder did not produce proper pts, making some up.0:00.77 bitrate=
0.0kbits/s dup=0 drop=23
Que input is backward in timeze=      99kB time=00:00:02.20 bitrate=
367.9kbits/s dup=0 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 190035 DTS: 190035 < 190666 invalid, clipping
Que input is backward in timeze=     339kB time=00:00:03.65 bitrate=
759.0kbits/s dup=2 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 329220 DTS: 329220 < 330886 invalid, clipping
Que input is backward in timeze=     443kB time=00:00:04.70 bitrate=
772.2kbits/s dup=3 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 406980 DTS: 406980 < 411526 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 408825 DTS: 408825 < 411527 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 410625 DTS: 410625 < 411528 invalid, clipping
Que input is backward in timeze=     648kB time=00:00:05.57 bitrate=
951.7kbits/s dup=4 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 516465 DTS: 516465 < 518986 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 518265 DTS: 518265 < 518987 invalid, clipping
Que input is backward in timeze=     781kB time=00:00:06.45 bitrate=
991.9kbits/s dup=5 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 586530 DTS: 586530 < 590086 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 588375 DTS: 588375 < 590087 invalid, clipping
Que input is backward in timeze=    1231kB time=00:00:08.77
bitrate=1148.9kbits/s dup=7 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 793845 DTS: 793845 < 797356 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 795645 DTS: 795645 < 797357 invalid, clipping
Que input is backward in timeze=    1344kB time=00:00:09.61
bitrate=1145.6kbits/s dup=8 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 865845 DTS: 865845 < 868366 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 867645 DTS: 867645 < 868367 invalid, clipping
Que input is backward in timeze=    1417kB time=00:00:10.07
bitrate=1151.8kbits/s dup=8 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 913860 DTS: 913860 < 916426 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 915705 DTS: 915705 < 916427 invalid, clipping
Que input is backward in timeze=    1487kB time=00:00:10.78
bitrate=1129.3kbits/s dup=9 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 970515 DTS: 970515 < 974026 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 972315 DTS: 972315 < 974027 invalid, clipping
Que input is backward in timeze=    1760kB time=00:00:12.42
bitrate=1160.3kbits/s dup=11 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 1116450 DTS: 1116450 < 1120006 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 1118295 DTS: 1118295 < 1120007 invalid, clipping
Que input is backward in timeze=    1897kB time=00:00:13.79
bitrate=1126.9kbits/s dup=12 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 1242180 DTS: 1242180 < 1242856 invalid, clipping
Que input is backward in timeze=    2027kB time=00:00:14.49
bitrate=1145.2kbits/s dup=13 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 1300725 DTS: 1300725 < 1302346 invalid, clipping
Que input is backward in timeze=    2347kB time=00:00:16.67
bitrate=1153.0kbits/s dup=15 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 1499445 DTS: 1499445 < 1503946 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 1501245 DTS: 1501245 < 1503947 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 1503045 DTS: 1503045 < 1503948 invalid, clipping
Que input is backward in timeze=    2602kB time=00:00:18.78
bitrate=1134.8kbits/s dup=17 drop=23
[mpegts @ 0x1c4f600] st:0 PTS: 1682820 DTS: 1682820 < 1686376 invalid, clipping
[mpegts @ 0x1c4f600] st:0 PTS: 1684665 DTS: 1684665 < 1686377 invalid, clipping
frame=  500 fps= 13 q=29.0 Lsize=    3111kB time=00:00:20.02
bitrate=1272.8kbits/s dup=19 drop=23
video:1934kB audio:838kB subtitle:0 global headers:0kB muxing overhead
12.216050%
[libx264 @ 0x1c4ff00] frame I:8     Avg QP:23.56  size: 41609
[libx264 @ 0x1c4ff00] frame P:258   Avg QP:26.60  size:  5199
[libx264 @ 0x1c4ff00] frame B:234   Avg QP:30.06  size:  1307
[libx264 @ 0x1c4ff00] consecutive B-frames: 12.0% 72.8% 12.0%  3.2%
[libx264 @ 0x1c4ff00] mb I  I16..4: 29.8%  0.0% 70.2%
[libx264 @ 0x1c4ff00] mb P  I16..4:  0.7%  0.0%  1.8%  P16..4: 39.4%
10.9%  8.3%  0.0%  0.0%    skip:38.9%
[libx264 @ 0x1c4ff00] mb B  I16..4:  0.0%  0.0%  0.1%  B16..8: 46.1%
2.8%  0.7%  direct: 0.6%  skip:49.7%  L0:41.3% L1:55.4% BI: 3.4%
[libx264 @ 0x1c4ff00] final ratefactor: 24.24
[libx264 @ 0x1c4ff00] coded y,uvDC,uvAC intra: 70.8% 77.8% 51.3%
inter: 8.3% 11.1% 1.0%
[libx264 @ 0x1c4ff00] i16 v,h,dc,p: 28% 21% 15% 36%
[libx264 @ 0x1c4ff00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 13% 19%  6%
9% 10%  7%  7%  6%
[libx264 @ 0x1c4ff00] i8c dc,h,v,p: 52% 17% 20% 10%
[libx264 @ 0x1c4ff00] Weighted P-Frames: Y:4.3% UV:0.8%
[libx264 @ 0x1c4ff00] ref P L0: 60.6% 20.7% 13.0%  5.7%  0.1%
[libx264 @ 0x1c4ff00] ref B L0: 87.1% 12.4%  0.6%
[libx264 @ 0x1c4ff00] ref B L1: 97.1%  2.9%
[libx264 @ 0x1c4ff00] kb/s:792.05
========================================================================================



And than i use ffmpeg to see the start time and the duration time, the
start time was error, and the duration is more than -t duration.

===================================================================
ffmpeg -i output.ts
ffmpeg version N-47117-g4079210 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 27 2012 13:26:53 with gcc 4.4.4 (GCC) 20100726 (Red Hat 4.4.4-13)
  configuration: --enable-libx264 --enable-gpl --libdir=/usr/local/lib
--enable-debug --enable-debug=3 --enable-avfilter --disable-stripping
  libavutil      52.  9.102 / 52.  9.102
  libavcodec     54. 77.100 / 54. 77.100
  libavformat    54. 37.100 / 54. 37.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 23.102 /  3. 23.102
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 17.101 /  0. 17.101
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x319f240] max_analyze_duration 5000000 reached at 5013333
Input #0, mpegts, from 'output.ts':
  Duration: 00:00:21.04, start: 0.364667, bitrate: 1211 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 800x480 [SAR 288:199 DAR 480:199], 25 fps, 25 tbr, 90k tbn,
50 tbc
    Stream #0:1[0x101](eng): Audio: aac ([15][0][0][0] / 0x000F),
48000 Hz, 5.1, fltp, 76 kb/s
    Stream #0:2[0x102](chi): Audio: aac ([15][0][0][0] / 0x000F),
48000 Hz, stereo, fltp, 139 kb/s
    Stream #0:3[0x103](eng): Audio: aac ([15][0][0][0] / 0x000F),
48000 Hz, stereo, fltp, 118 kb/s
At least one output file must be specified

====================================================================


Is that a bug? or there have some other parameters?
1st,  The copyts is not work.
2nd, The duration is not exact, some times more than duration or less
than duration..

Can you tell me why?And how?


Thanks


More information about the ffmpeg-user mailing list