Opened 12 years ago

Closed 10 years ago

#1746 closed defect (fixed)

MPEG_TS: the PTS is wrong

Reported by: adam_csheng Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mpegts h264 desync
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
The PTS from FFmpeg is wrong.
How to reproduce:

reproduce by: ffprobe $STREAM_FILE -show_packets
I built the code myself with the commit:
commit 83438a0db3c61f06979d1c4159e5c85d52eda488
Merge: a593f5b d8f8e91
Author: Michael Niedermayer <michaelni@gmx.at>
Date:   Mon Sep 17 00:40:55 2012 +0200

Attachments (2)

mpegts_pts_wrong.ts (2.0 MB ) - added by adam_csheng 12 years ago.
mpegts_pts_wrong.txt (206.4 KB ) - added by adam_csheng 12 years ago.

Change History (5)

by adam_csheng, 12 years ago

Attachment: mpegts_pts_wrong.ts added

by adam_csheng, 12 years ago

Attachment: mpegts_pts_wrong.txt added

comment:1 by adam_csheng, 12 years ago

You can refer to the mpegts_pts_wrong.txt:
After the packett:
[PACKET]
codec_type=video
stream_index=0
pts=54842400
pts_time=609.360000
dts=54838800
dts_time=609.320000
duration=3600
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=2200
pos=1220872
flags=_
PACKET
is:
[PACKET]
codec_type=video
stream_index=0
pts=54381600
pts_time=604.240000
dts=54374400
dts_time=604.160000
duration=3600
duration_time=0.040000
convergence_duration=N/A
convergence_duration_time=N/A
size=103376
pos=N/A
flags=K
PACKET

comment:2 by Carl Eugen Hoyos, 12 years ago

Component: FFprobeundetermined
Keywords: mpegts h264 desync added; MPEGTS PTS removed
Reproduced by developer: set
Status: newopen

The output file is severely out-of-sync:

$ ffmpeg -analyzeduration 15M -i mpegts_pts_wrong.ts -s 640x360 -q:v 2 -t 21 out.avi
ffmpeg version N-44530-g094991e Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 16 2012 19:18:58 with gcc 4.5.3 (GCC)
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc --enable-gpl --enable-libass
  libavutil      51. 73.100 / 51. 73.100
  libavcodec     54. 56.100 / 54. 56.100
  libavformat    54. 27.101 / 54. 27.101
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.104 /  3. 16.104
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x14f0340] PES packet size mismatch
    Last message repeated 1 times
Input #0, mpegts, from 'mpegts_pts_wrong.ts':
  Duration: 00:00:12.47, start: 599.960011, bitrate: 1312 kb/s
  Program 1
    Stream #0:0[0x1011](und): Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100](chi): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, s16, 66 kb/s
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf54.27.101
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x360, q=2-31, 200 kb/s, 25 tbn, 25 tbc
    Stream #0:1(chi): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, flt, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
frame=  288 fps=130 q=2.0 Lsize=    4261kB time=00:00:21.02 bitrate=1660.1kbits/s
video:3952kB audio:271kB subtitle:0 global headers:0kB muxing overhead 0.888084%

comment:3 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Resolution: fixed
Status: openclosed

Fixed by Anton Khirnov in 4eb49fdd / 2ba68dd0

Note: See TracTickets for help on using tickets.