Opened 11 years ago

Last modified 11 years ago

#3178 new defect

AVFrame.best_effort_timestamp and/or AVFrame.pkt_dts gives wrong output

Reported by: gjdfgh Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Clément Bœsch)

The test file can be found in http://www.cccp-project.net/beta/test_files/ under the filename given in the log. As you can see, the first timestamp is 42 instead of 0. This is because pkt_dts returns the second packet's timestamp, instead of the first packet's. Apparently, pkt_dts is supposed to follow the codec delay (and in the case, the codec delay is 1), and the first packet's dts is supposed to be negative. However, this is not how it works for vfw-muxed MKV (this file; has DTS starting with 0), mpeg4 in AVI files (have DTS starting with 0), and mpeg4 in OGM (has DTS starting ewith 0, and PTS incorrectly set to DTS).

Log follows. It has the patch "[PATCH] ffprobe: output best_effort_timestamp" from ffmpeg-devel applied to print the best_effort_timestamp. If you want "full uncut console output", please increase TRAC's ticket description limit to at least 566 KB.

$ ./ffprobe /tmp/\[CCCP\]_Mega_Lossless_Audio_Test.mkv  -select_streams 0 -show_frames
ffprobe version N-58486-g52bbc4f Copyright (c) 2007-2013 the FFmpeg developers
  built on Nov 28 2013 11:37:00 with gcc 4.8 (Debian 4.8.2-5)
  configuration: --prefix=/tmp/ffmpeg-bin
  libavutil      52. 55.100 / 52. 55.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.102 / 55. 21.102
  libavdevice    55.  5.101 / 55.  5.101
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
Input #0, matroska,webm, from '/tmp/[CCCP]_Mega_Lossless_Audio_Test.mkv':
  Metadata:
    title           : Macross Plus - Episode 4 Intro
    creation_time   : 2006-08-03 02:20:28
  Duration: 00:00:56.22, start: 0.000000, bitrate: 15003 kb/s
    Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 672x464 [SAR 1:1 DAR 42:29], SAR 58:63 DAR 4:3, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Metadata:
      title           : Macross Plus - Episode 4 Intro
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : AC3 6ch Audio
    Stream #0:2(jpn): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : AC3 2ch Audio
    Stream #0:3(eng): Audio: flac, 48000 Hz, 5.1(side), s16
    Metadata:
      title           : FLAC 6ch Audio
    Stream #0:4(jpn): Audio: flac, 48000 Hz, stereo, s16
    Metadata:
      title           : FLAC 2ch Audio
    Stream #0:5(eng): Audio: tta, 48000 Hz, 5.1, s16
    Metadata:
      title           : TTA 6ch Audio
    Stream #0:6(jpn): Audio: tta, 48000 Hz, stereo, s16
    Metadata:
      title           : TTA 2ch Audio
    Stream #0:7(eng): Audio: wavpack, 48000 Hz, 5.1, s16p
    Metadata:
      title           : WV Lossy 6ch Audio
    Stream #0:8(jpn): Audio: wavpack, 48000 Hz, stereo, s16p
    Metadata:
      title           : WV Lossy 2ch Audio
    Stream #0:9(eng): Audio: wavpack, 48000 Hz, 5.1, s16p
    Metadata:
      title           : WV Hybrid 6ch Audio
    Stream #0:10(jpn): Audio: wavpack, 48000 Hz, stereo, s16p
    Metadata:
      title           : WV Hybrid 2ch Audio
    Stream #0:11(eng): Audio: wavpack, 48000 Hz, 5.1, s16p
    Metadata:
      title           : WV Lossless 6ch Audio
    Stream #0:12(jpn): Audio: wavpack, 48000 Hz, stereo, s16p
    Metadata:
      title           : WV Lossless 2ch Audio
    Stream #0:13(eng): Subtitle: subrip (default)
    Metadata:
      title           : English Subtitles (SRT)
    Stream #0:14(eng): Subtitle: subrip
    Metadata:
      title           : Closed Captions (SRT)
[mpeg4 @ 0x91779a0] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using a tool like VirtualDub or avidemux to fix it.
[FRAME]
media_type=video
key_frame=1
pkt_pts=N/A
pkt_pts_time=N/A
pkt_dts=42
pkt_dts_time=0.042000
best_effort_timestamp=42
best_effort_timestamp_time=0.042000
pkt_duration=41
pkt_duration_time=0.041000
pkt_pos=7412
pkt_size=16700
width=672
height=464
pix_fmt=yuv420p
sample_aspect_ratio=58:63
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]

Change History (3)

comment:1 by Clément Bœsch, 11 years ago

Description: modified (diff)

comment:2 by Clément Bœsch, 11 years ago

Description: modified (diff)

(Added command)

comment:3 by gjdfgh, 11 years ago

Actually not sure about mpeg4 in OGM. But I suspect that case is messed up in its own way.

Note: See TracTickets for help on using tickets.