Closed Bug 1868403 Opened 1 year ago Closed 1 year ago

Implement FFmpegVideoEncoder based on modern APIs for H264

Categories

(Core :: Audio/Video, task, P1)

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

Details

Attachments

(7 files, 3 obsolete files)

While bug 1860899 will bring an FFmpegVideoEncoder for libvpx, H264 support is required for webcodecs. FFmpegVideoEncoder should support H264 encoding via openH264 or libx264.

Summary: Implement FFmpegVideoEncoder based on modern APIs for openH264 → Implement FFmpegVideoEncoder based on modern APIs for H264

I am trying to build ffvpx with libopenh264: https://github.com/ChunMinChang/gecko-dev/commits/b1868403/

(In reply to C.M.Chang[:chunmin] from comment #1)
I probably should only use openh264 or libx264 when using dynamically-loading ffmpg, not in-tree libvpx

Depends on D196206

Depends on D196251

Attachment #9368343 - Attachment description: Bug 1868403 - Enable h264 via dynamically-linked ffmpeg → WIP: Bug 1868403 - Enable h264 via dynamically-linked ffmpeg
Attachment #9368344 - Attachment description: Bug 1868403 - Set H264 profile → WIP: Bug 1868403 - Set H264 profile
Attached file WIP: Bug 1868403 - Set H264 level (obsolete) —

Depends on D196252

Attachment #9368343 - Attachment description: WIP: Bug 1868403 - Enable h264 via dynamically-linked ffmpeg → Bug 1868403 - Enable h264 via dynamically-linked ffmpeg
Attachment #9368344 - Attachment description: WIP: Bug 1868403 - Set H264 profile → Bug 1868403 - Set H264 profile
Attachment #9369092 - Attachment is obsolete: true

Depends on D196680

Comment on attachment 9369121 [details]
WIP: Bug 1868403 - Add bit stream format to H264Specific

Revision D196680 was moved to bug 1870519. Setting attachment 9369121 [details] to obsolete.

Attachment #9369121 - Attachment is obsolete: true

Comment on attachment 9369122 [details]
WIP: Bug 1868403 - Add level to H264Specific

Revision D196681 was moved to bug 1870519. Setting attachment 9369122 [details] to obsolete.

Attachment #9369122 - Attachment is obsolete: true
Attachment #9369084 - Attachment description: WIP: Bug 1868403 - Set H264 level → Bug 1868403 - Set H264 level
Attachment #9369093 - Attachment description: WIP: Bug 1868403 - Set H264 encoding format → Bug 1868403 - Set H264 encoding format

If the encoding format is AVCC and global-header is not set, every key
frame (I frame) comes with a header containing SPS and PPS data [1, 2].
This patch extract those data and put it into MediaRawData's extra data
field.

[1] https://github.com/FFmpeg/FFmpeg/blob/b51d9eb58eae046b08ef0a967ab2d3e863047d74/libavcodec/libx264.c#L1174-L1175
[2] https://code.videolan.org/videolan/x264/-/blob/c1c9931dc87289b8aeba78150467f17bdb97d019/encoder/encoder.c#L3665-L3691

Depends on D196675

Attachment #9369131 - Attachment description: Bug 1868403 - Set extra data for AVCC data → Bug 1868403 - Set extra data when encoding into AVCC format
Attachment #9369131 - Attachment description: Bug 1868403 - Set extra data when encoding into AVCC format → Bug 1868403 - Set extra data in AVCC encoding

Depends on D196684

Depends on D196748

Depends on: 1870519
Pushed by cchang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/090ca90a322e Enable h264 via dynamically-linked ffmpeg r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/cc02ea8a5d88 Set H264 profile r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/b5802f5738a0 Set H264 level r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/3f038df97fef Set H264 encoding format r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/7cdf2a4559b6 Set extra data in AVCC encoding r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/38e39dfa0f67 Test case for AVCC r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/67cef656eb49 Add debugging logs r=media-playback-reviewers,padenot
Regressions: 1872152
No longer regressions: 1872152
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: