Unity-Technologies / Unity-Technologies/com.unity.webrtc

[REQUEST]: Byte[] from cam.CaptureStream

Open
#668 3 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Mar 29, 2022.

enhancement issued
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.