Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoEncoder produces no frames with latencyMode "realtime" when framerate/bitrate are not given #20842

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Nov 23, 2023

ef16bd3

VideoEncoder produces no frames with latencyMode "realtime" when framerate/bitrate are not given
https://bugs.webkit.org/show_bug.cgi?id=264894
rdar://118725549

Reviewed by Eric Carlson.

When frame rate and/or bitrate is not set, use default values for them.
For frame rate, we use 30 frames.
For bitrate, we use the max bit rate as per H264 table A.1.

* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any-expected.txt: Added.
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.html: Added.
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.js: Added.
(async encoderTest):
(promise_test.async return):
(promise_test):
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.worker-expected.txt: Added.
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.worker.html: Added.
* Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 startEncodeWithSettings:numberOfCores:]):
(-[RTCVideoEncoderH264 setBitrate:framerate:]):
(-[RTCVideoEncoderH264 setEncoderBitrateBps:frameRate:]):

Canonical link: https://commits.webkit.org/271087@main

73532e8

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv-sim ✅ 🧪 mac-wk2-stress
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@youennf youennf self-assigned this Nov 23, 2023
@youennf youennf added the Media Bugs related to the HTML 5 Media elements. label Nov 23, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 23, 2023
@youennf youennf force-pushed the eng/VideoEncoder-produces-no-frames-with-latencyMode-realtime-when-frameratebitrate-are-not-given branch from 4d41308 to b282432 Compare November 23, 2023 10:17
@youennf youennf removed the merging-blocked Applied to prevent a change from being merged label Nov 23, 2023
@youennf youennf force-pushed the eng/VideoEncoder-produces-no-frames-with-latencyMode-realtime-when-frameratebitrate-are-not-given branch from b282432 to 73532e8 Compare November 23, 2023 12:26
@youennf youennf added the merge-queue Applied to send a pull request to merge-queue label Nov 23, 2023
…erate/bitrate are not given

https://bugs.webkit.org/show_bug.cgi?id=264894
rdar://118725549

Reviewed by Eric Carlson.

When frame rate and/or bitrate is not set, use default values for them.
For frame rate, we use 30 frames.
For bitrate, we use the max bit rate as per H264 table A.1.

* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any-expected.txt: Added.
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.html: Added.
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.js: Added.
(async encoderTest):
(promise_test.async return):
(promise_test):
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.worker-expected.txt: Added.
* LayoutTests/http/wpt/webcodecs/h264-encoder-default-config.https.any.worker.html: Added.
* Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 startEncodeWithSettings:numberOfCores:]):
(-[RTCVideoEncoderH264 setBitrate:framerate:]):
(-[RTCVideoEncoderH264 setEncoderBitrateBps:frameRate:]):

Canonical link: https://commits.webkit.org/271087@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/VideoEncoder-produces-no-frames-with-latencyMode-realtime-when-frameratebitrate-are-not-given branch from 73532e8 to ef16bd3 Compare November 23, 2023 20:01
@webkit-commit-queue
Copy link
Collaborator

Committed 271087@main (ef16bd3): https://commits.webkit.org/271087@main

Reviewed commits have been landed. Closing PR #20842 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit ef16bd3 into WebKit:main Nov 23, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Media Bugs related to the HTML 5 Media elements.
Projects
None yet
5 participants