Closed Bug 1827703 Opened 2 years ago Closed 2 years ago

Use OpenH264 decoder's output timestamp for decoded frames

Categories

(Core :: Audio/Video: GMP, defect, P3)

defect

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

ffmpeg supplies SBufferInfo::uiInBsTimeStamp to DecodeFrameNoDelay:
https://github.com/FFmpeg/FFmpeg/blob/1179bb703e35543e15401f05a4cc81cc389756ba/libavcodec/libopenh264dec.c#L146

and takes SBufferInfo::uiOutYuvTimeStamp as the frame's new timestamp:
https://github.com/FFmpeg/FFmpeg/blob/1179bb703e35543e15401f05a4cc81cc389756ba/libavcodec/libopenh264dec.c#L146

where Firefox supplies no SBufferInfo:
https://github.com/cisco/openh264/blob/openh264v2.3.1/module/gmp-openh264.cpp#L825

and reuses the input timestamp as the output timestamp:
https://github.com/cisco/openh264/blob/openh264v2.3.1/module/gmp-openh264.cpp#L913

This causes videos such as https://html5videoplayer.net/html5video/mp4-h-264-video-test/ to appear janky when decoding using the OpenH264 2.3.1 plugin.

To fix this, we require changes on the OpenH264 side and the gecko side. This bug tracks the Gecko changes.

Assignee: nobody → aosmond
Status: NEW → ASSIGNED

This patch bumps the API version for the OpenH264 decoder in order to
add new methods to GMPVideoi420Frame, SetDecodedTimestamp and
DecodedTimestamp. If the API version is sufficient, the OpenH264 library
will convert the encoded sample timestamp (SBufferInfo::uiInBsTimeStamp)
to the decoded frame timestamp (SBufferInfo::uiOutYuvTimeStamp).

If it is not supported, it will default to the old behaviour and use the
encoded sample timestamp instead.

Attachment #9328220 - Attachment description: Bug 1827703 - Prefer timestamp from the OpenH264 decoder if available. → WIP: Bug 1827703 - Reuse sample metadata with GMPVideoDecoder decoded frames.
Attachment #9328220 - Attachment description: WIP: Bug 1827703 - Reuse sample metadata with GMPVideoDecoder decoded frames. → Bug 1827703 - Reuse sample metadata with GMPVideoDecoder decoded frames.
Attachment #9328220 - Attachment description: Bug 1827703 - Reuse sample metadata with GMPVideoDecoder decoded frames. → Bug 1827703 - Improve integration with OpenH264 decoder.
Pushed by aosmond@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2608d24551f9 Improve integration with OpenH264 decoder. r=media-playback-reviewers,padenot
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Regressions: 1831342
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: