Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#7252 closed patch (fixed)

FFmpeg support for reordered_opaque to resolve h264 timestamp ordering problems

Reported by: tralph11@… Owned by: tralph
Priority: minor Milestone: 0.24
Component: MythTV - Video Playback Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The attached patch adds support for an FFmpeg feature that correctly orders timestamps output by the decoder.

Attachments (3)

mythtv_decoder_reorder_pts.diff (8.4 KB) - added by tralph11@… 10 years ago.
FFmpeg reordered_opaque support
mythtv_decoder_reorder_pts_v2.diff (8.9 KB) - added by tralph11@… 10 years ago.
fix memory leak and clean-up formatting
mythtv_decoder_reorder_pts_v3.diff (8.9 KB) - added by tralph11@… 10 years ago.
fix indentation

Download all attachments as: .zip

Change History (14)

Changed 10 years ago by tralph11@…

FFmpeg reordered_opaque support

Changed 10 years ago by tralph11@…

fix memory leak and clean-up formatting

Changed 10 years ago by tralph11@…

fix indentation

comment:1 Changed 9 years ago by robertm

Owner: changed from Janne Grunau to tralph
Status: newassigned

comment:2 Changed 9 years ago by tralph

Resolution: wontfix
Status: assignedclosed

Since we use DTS timestamps and they should always be in order this patch doesn't provide much benefit. It may provide benefit for videos with significant amounts of reference frames where the AV-sync could be noticeably off but that doesn't seem to be causing anyone problems. Also since reordered_opaque timestamps are basically reordered PTS timestamps which are commonly missing it would cause heavy reliance on the timestamp fixups code which I consider risky.

Closing as WONTFIX for the time being. It can always be revisited in the future if the need arises.

comment:3 Changed 9 years ago by tralph

(In [25652]) Properly initialize mpa_pic in avformatdecoder using avcodec_frame_defaults().

Refs #7252.

comment:4 Changed 9 years ago by tralph

(In [25653]) Add code the provide reordered_opaque timestamp capability. The reordered_opaque timestamps will be put to use in a future commit.

Refs #7252.

comment:5 Changed 9 years ago by tralph

(In [25654]) Add support for reordered_opaque timestamps. This feature is currently disabled with the USE_REORDERED_OPAQUE define.

Refs #7252.

comment:6 Changed 9 years ago by tralph

(In [25661]) Add reordered_opaque timestamps to video timecode debug.

Refs #7252.

comment:7 Changed 9 years ago by tralph

(In [25665]) Enable the reordered_opaque code block but only use the reordered_opaque timestamps in the event dts timestamps are missing. Also clean up some extraneous code.

The reordered_opaque timestamps are still not explicity enabled. This can be done by setting use_reordered_opaque to true.

Refs #7252.

comment:8 Changed 9 years ago by beirdo

Resolution: wontfix
Status: closednew

Seems this is not really a wontfix anymore

comment:9 Changed 9 years ago by beirdo

Status: newassigned

comment:10 Changed 9 years ago by tralph

Milestone: unknown0.24
Resolution: fixed
Status: assignedclosed

Closing since all the code is now checked in and there are no plans to backport.

comment:11 Changed 9 years ago by tralph

(In [25766]) Enable reordered_opaque as the preferred video timestamp. This also includes code to detect reordered_opaque (PTS) and DTS timestamp faults and intelligently selects which type to use.

The reordered_opaque timestamps should improve the AV-sync delta for videos that require larger decoder buffers due to the use of b-pyramid, reference frames, b-frames, ffmpeg-mt decoding, etc.

Refs #7252.

Note: See TracTickets for help on using tickets.