[FFmpeg-user] Output PTS is different from the source

Wesley Wen delbin.wen at gmail.com
Fri Dec 19 10:51:00 CET 2014


Is avoid_negative_ts the option you're talking about to disable negative
timestamps?

>>>ffmpeg -y -i file.ts -c:v libx264 -avoid_negative_ts make_non_negative
output.mp4
ffmpeg version git-2014-12-19-c89751a Copyright (c) 2000-2014 the FFmpeg
developers
  built on Dec 19 2014 17:29:41 with Apple LLVM version 6.0
(clang-600.0.56) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags=
--enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
--enable-libvo-aacenc --enable-ffplay --enable-libfdk-aac --enable-libx265
--enable-nonfree --enable-vda
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 16.100 / 56. 16.100
  libavformat    56. 16.101 / 56. 16.101
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  4.100 /  5.  4.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'file.ts':
  Duration: 00:00:49.68, start: 0.207867, bitrate: 31307 kb/s
  Program 16
    Stream #0:0[0xff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
yuv420p(tv), 1440x1080 [SAR 4:3 DAR 16:9], 30000 kb/s, 29.97 fps, 29.97
tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x100]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, s16p, 384 kb/s
[libx264 @ 0x7fe6da00ba00] using SAR=4/3
[libx264 @ 0x7fe6da00ba00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x7fe6da00ba00] profile High, level 4.0
[libx264 @ 0x7fe6da00ba00] 264 - core 142 r2455 021c0dc - H.264/MPEG-4 AVC
codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options:
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf56.16.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
1440x1080 [SAR 4:3 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc56.16.100 libx264
    Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 48000 Hz,
stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.16.100 libfaac
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (mp2 (native) -> aac (libfaac))
Press [q] to stop, [?] for help
frame= 1490 fps= 20 q=-1.0 Lsize=   25999kB time=00:00:49.68
bitrate=4286.6kbits/s dup=1 drop=0
video:25191kB audio:756kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.199416%
[libx264 @ 0x7fe6da00ba00] frame I:41    Avg QP:21.26  size: 64244
[libx264 @ 0x7fe6da00ba00] frame P:820   Avg QP:24.40  size: 22802
[libx264 @ 0x7fe6da00ba00] frame B:629   Avg QP:25.85  size:  7095
[libx264 @ 0x7fe6da00ba00] consecutive B-frames: 31.6% 32.2% 12.3% 23.9%
[libx264 @ 0x7fe6da00ba00] mb I  I16..4: 31.2% 61.3%  7.5%
[libx264 @ 0x7fe6da00ba00] mb P  I16..4:  5.8% 10.5%  1.8%  P16..4: 36.2%
 6.5%  4.7%  0.0%  0.0%    skip:34.5%
[libx264 @ 0x7fe6da00ba00] mb B  I16..4:  0.6%  0.8%  0.1%  B16..8: 32.0%
 2.1%  0.5%  direct: 2.0%  skip:62.0%  L0:42.9% L1:54.4% BI: 2.7%
[libx264 @ 0x7fe6da00ba00] 8x8 transform intra:58.4% inter:87.3%
[libx264 @ 0x7fe6da00ba00] coded y,uvDC,uvAC intra: 43.6% 61.0% 19.6%
inter: 11.8% 21.7% 1.8%
[libx264 @ 0x7fe6da00ba00] i16 v,h,dc,p: 28% 38%  7% 26%
[libx264 @ 0x7fe6da00ba00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 18% 32%  3%
 3%  4%  3%  5%  4%
[libx264 @ 0x7fe6da00ba00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 67%  8%  3%
 2%  2%  2%  3%  2%
[libx264 @ 0x7fe6da00ba00] i8c dc,h,v,p: 47% 27% 20%  5%
[libx264 @ 0x7fe6da00ba00] Weighted P-Frames: Y:4.6% UV:1.8%
[libx264 @ 0x7fe6da00ba00] ref P L0: 58.6% 12.2% 18.8% 10.1%  0.3%
[libx264 @ 0x7fe6da00ba00] ref B L0: 80.5% 12.8%  6.7%
[libx264 @ 0x7fe6da00ba00] ref B L1: 96.4%  3.6%
[libx264 @ 0x7fe6da00ba00] kb/s:4150.65

>>>ffprobe -show_entries stream=start_time,duration output.mp4
ffprobe version git-2014-12-19-c89751a Copyright (c) 2007-2014 the FFmpeg
developers
  built on Dec 19 2014 17:29:41 with Apple LLVM version 6.0
(clang-600.0.56) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags=
--enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
--enable-libvo-aacenc --enable-ffplay --enable-libfdk-aac --enable-libx265
--enable-nonfree --enable-vda
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 16.100 / 56. 16.100
  libavformat    56. 16.101 / 56. 16.101
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  4.100 /  5.  4.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.16.101
  Duration: 00:00:49.72, start: 0.045000, bitrate: 4283 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1440x1080 [SAR 4:3 DAR 16:9], 4150 kb/s, 29.97 fps, 29.97 tbr, 30k tbn,
59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 124 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[STREAM]
start_time=0.066000
duration=49.716333
[/STREAM]
[STREAM]
start_time=0.045000
duration=49.701333
[/STREAM]

On Fri Dec 19 2014 at 3:55:10 AM Nicolas George <george at nsup.org> wrote:

> L'octidi 28 frimaire, an CCXXIII, Carl Eugen Hoyos a écrit :
> > I believe there is an option to avoid negative
> > timestamps if you don't like them.
>
> Not only there is such an option, but it is enabled by default for formats
> that do not support negative timestamps, even for cases that are perfectly
> standard and supported like this one.
>
> Disabling it should fix the issue at hand.
>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list