Implement FFmpegVideoEncoder based on modern APIs for H264
Categories
(Core :: Audio/Video, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: chunmin, Assigned: chunmin)
References
Details
Attachments
(7 files, 3 obsolete files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
While bug 1860899 will bring an FFmpegVideoEncoder for libvpx, H264 support is required for webcodecs. FFmpegVideoEncoder should support H264 encoding via openH264 or libx264.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
I am trying to build ffvpx with libopenh264: https://github.com/ChunMinChang/gecko-dev/commits/b1868403/
Assignee | ||
Comment 2•1 year ago
|
||
(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
Assignee | ||
Comment 3•1 year ago
|
||
Depends on D196206
Assignee | ||
Comment 4•1 year ago
|
||
Depends on D196251
Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 6•1 year ago
|
||
Depends on D196252
Assignee | ||
Comment 7•1 year ago
|
||
The default format for libx264 is annexb. To change the format, we need
to set x264_param_t
's b_annexb
to 0
via setting x264-params
or
x264opts
with annexb
in X264_init
[1,2,3,4,5,6]. For more details,
please read FFmpeg codecs document for libx264 options [7]
FFmpeg code references:
[1] https://github.com/FFmpeg/FFmpeg/blob/b51d9eb58eae046b08ef0a967ab2d3e863047d74/libavcodec/libx264.c#L1362
[2] https://github.com/FFmpeg/FFmpeg/blob/b51d9eb58eae046b08ef0a967ab2d3e863047d74/libavcodec/libx264.c#L1431
[3] https://github.com/FFmpeg/FFmpeg/blob/b51d9eb58eae046b08ef0a967ab2d3e863047d74/libavcodec/libx264.c#L1180
[4] https://github.com/FFmpeg/FFmpeg/blob/b51d9eb58eae046b08ef0a967ab2d3e863047d74/libavcodec/libx264.c#L1208
libx264 code refereces:
[5] https://code.videolan.org/videolan/x264/-/blob/c1c9931dc87289b8aeba78150467f17bdb97d019/common/base.c#L1385
[6] https://code.videolan.org/videolan/x264/-/blob/c1c9931dc87289b8aeba78150467f17bdb97d019/common/base.c#L886
FFmpeg libx264 options
[7] https://ffmpeg.org/ffmpeg-codecs.html#Options-35
Depends on D196674
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 8•1 year ago
|
||
Assignee | ||
Comment 9•1 year ago
|
||
Depends on D196680
Comment 10•1 year ago
|
||
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.
Comment 11•1 year ago
|
||
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.
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 12•1 year ago
|
||
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
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 13•1 year ago
|
||
Depends on D196684
Assignee | ||
Comment 14•1 year ago
|
||
Depends on D196748
Comment 15•1 year ago
|
||
Comment 16•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/090ca90a322e
https://hg.mozilla.org/mozilla-central/rev/cc02ea8a5d88
https://hg.mozilla.org/mozilla-central/rev/b5802f5738a0
https://hg.mozilla.org/mozilla-central/rev/3f038df97fef
https://hg.mozilla.org/mozilla-central/rev/7cdf2a4559b6
https://hg.mozilla.org/mozilla-central/rev/38e39dfa0f67
https://hg.mozilla.org/mozilla-central/rev/67cef656eb49
Description
•