com.unity.webrtc
com.unity.webrtc copied to clipboard
[REQUEST]: Byte[] as video stream
Is your feature request related to a problem?
Hello,
I was wondering if there is a way to send a byte array as the video stream as opposed to a RenderTexture? The reason for this is that we're feeding a raw h264 ffmpeg stream into unity and hoping to push the byte[] over webRTC instead of using CaptureStream (ie. var videoStream = cam.CaptureStream(1280, 720, 1000000);).
Thanks!
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
@ZeoWorks I got your issue. Thank you for the feedback!
Thank you! Has this been implemented? The byte[] will be pre-encoded h264 raw data, thanks again.
@karasusan I guess this is not easy to implement. H264 encoder in native code is closely related other modules. We need to make new one which not process encoding, and path byte data through to downstream.
@karasusan I guess this is not easy to implement. H264 encoder in native code is closely related other modules. We need to make new one which not process encoding, and path byte data through to downstream.
Sounds like just removing the middle man. Instead of passing through to OpenH264 or the Nvidia SDK, we send the byte[] video stream directly over.
@ZeoWorks Usually, the bandwidth changes dynamically according to network environment, so it might not work only support the dummy encoder. I guess we need to support the callback called when changing network bitrate.
@ZeoWorks Usually, the bandwidth changes dynamically according to network environment, so it might not work only support the dummy encoder. I guess we need to support the callback called when changing network bitrate.
Yes, even a callback would do. :) The intent is to allow other developers to utilize custom third party encoding plugins. Thanks!
@ZeoWorks FYI, Sounds like you want to make the custom encoder. This idea close to WebCodecs. https://www.w3.org/TR/webcodecs/
Hi. :) Once again, we've already done this; we're using ffmpeg to push raw h264 byte[] data into Unity and all we need now is for com.unity.webrtc to read the data as media input.
memo: WRS-321