ExternalEncoder for H.264 only used when video > 500x500x, otherwise OpenH264 encoding kicks in?

135 views
Skip to first unread message

Dominik Balogh

unread,
Jul 18, 2019, 3:33:51 AM7/18/19
to discuss-webrtc
In WebRTC internals, I can see that the External Encoder (hardware accelerated) is only enabled when the video fed to WebRTC is above about 510x510px. When the video origin is smaller than that, the OpenH264 encoder kicks in automatically.

Why is this?

My theories:

- It makes less sense on smaller video due to CPU overhead
- Maybe a Mac OS/drivers/GPU related issue
- GPU is unable to perform encoding on small video due to its H264 encoding/profiles implementation
- anything else?

Can this be fixed?

Tested on a variety of MacBooks/Mac OS/latest Chrome.

Thanks
Dominik

Bo Zhou

unread,
Jul 18, 2019, 9:39:37 AM7/18/19
to discuss-webrtc
Hi

Can you try to pad the captured image to keep the resolution larger than the restriction and send it to the encoder ?

Thanks, I'm also newbie on H264 of WebRTC.

Dominik Balogh

unread,
Jul 18, 2019, 2:07:22 PM7/18/19
to discuss-webrtc
What do you mean by "pad"? Can you share your idea in more detail?

Thanks

Bo Zhou

unread,
Jul 18, 2019, 10:20:46 PM7/18/19
to discuss...@googlegroups.com
Hi

Pad means, once the captured frame is less than the constrained size, the video encoder creates a large frame buffer and send it to the encoder.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/92916823-2628-403e-823b-8679422d668d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dominik Balogh

unread,
Jul 18, 2019, 11:02:01 PM7/18/19
to discuss...@googlegroups.com
Interesting idea! So how would I do that? Thanks!


Bo Zhou

unread,
Jul 18, 2019, 11:12:41 PM7/18/19
to discuss...@googlegroups.com
Hi !

You can use libyuv supplied by WebRTC

Here are document

Let's use fixed size, such as 720P, but the incoming size of captured video frame is smaller than this size, we could copy the captured video frame to the preserved large size frame buffer, then give the frame to encoder.

Just an idea, hopefully it works for your case to prevent crash and cover special cases.



Reply all
Reply to author
Forward
0 new messages