com.unity.webrtc icon indicating copy to clipboard operation
com.unity.webrtc copied to clipboard

[REQUEST]: Byte[] from cam.CaptureStream

Open lukaszmoskwa opened this issue 2 years ago • 3 comments

Is your feature request related to a problem?

I'm not sure whether I'm missing this feature or not, but I wasn't able to find it in the documentation. I would like to retrieve a byte[] from a MediaStream (in particular a MediaStreamTrack like a video), encoded as webm vp8 and send it in a different way with respect to the RTCPeerConnection.

This is actually possibile in other libraries in the browser that retrieve the UserMedia and store it in an array of byte buffers with a custom slice. Here I report an example from RecordRTC (https://recordrtc.org/ - check the timeSlice parameter in the configuration)

Describe the solution you'd like

If it's not already present, I would like to suggest to add a listener that would enable to retrieve the byte array

videoStream = cam.CaptureStream(1280, 720, 1000000);
videoStream.onDataAdded = data => {
    // Here data is a byte[] containing the video recorded in a certain timeSlice
}

Describe alternatives you've considered

Actually, I was thinking about taking the single images and using ffmpeg to convert them to webm vp8, but it really looks like an overkill to me

Additional context

No response

lukaszmoskwa avatar Mar 29 '22 11:03 lukaszmoskwa

Is it a same issue? https://github.com/Unity-Technologies/com.unity.webrtc/issues/635

Or, do you want to record the streaming video?

karasusan avatar Mar 30 '22 02:03 karasusan

I actually want to record the streaming video

lukaszmoskwa avatar Mar 30 '22 05:03 lukaszmoskwa

memo: WRS-281

kannan-xiao4 avatar Apr 05 '22 02:04 kannan-xiao4