Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
WebRTC Recording Size

After few hours of research I can't find a solution to my problem and it seems impossible.

I built a simple WebRTC chat (2 clients) where you can create / join a room.

When two clients join the same room they can talk to each other. I have one localStream which is the local user camera and one remoteStream which is the other client camera from the PeerConnection.

I created a button that allows me to start a recording (local) of the remoteStream video. So my client 1 press this button and start record the video of the client 2.

My problem is when I check video data from the remoteStream the frame rate and the video resolution change over time. When I start recording the MediaRecorder grab the current remoteStream size and create a blob which contain my video. Later I can download this video by stopping the recording and download the blob. The problem is the size (definition) of the final video will depend on the current remoteStream size when the user click the button.

So if we are unlucky we will get an entire 360p video for example, if we start the recording later we can have a 1000p video or 868p or other random value between 1p and 2160p. So the video size will depend on the timing and will never be the same.

Is that possible to create a recording which take a fix video size and ignore this WebRTC fluctuation ?

Regards

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

WebRTC implements congestion control: the size, framerate and quality of the video is varied depending on the network conditions (packet loss and packet delay).

There are some knobs to control the behaviour. The one that I've found to be most useful is the contentHint field of MediaStreamTrack; if you set this field to the string detail, then the stack will prefer to reduce framerate rather than reducing the resolution.

At the end of the day, however, there doesn't seem to be anything you can do to forcibly prevent the stack from reducing the resolution when the network conditions are bad, so your code will need to handle that case.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!