Code Monkey home page Code Monkey logo

Comments (10)

kclyu avatar kclyu commented on June 8, 2024

In normal operating environment, it should be within 300 ~ 500 ms delay. It seems to be encoded as VP8 which is WebRTC native fallback encoding.
Make sure that WebRTC H.264 encoding/decoding is enabled in Chrome.
Please check the rws log message to see if there is something similar to the following.

grep log_file raspi_encoder

(Raspi_encoder.cc:454): Raspberry H.264 MMAL encoder factory.
(Raspi_encoder.cc:480): Create Raspberry PI HW MMAL video encoder for H264
(Raspi_encoder.cc:152): InitEncode request: 320 x 240
(Raspi_encoder.cc:167): MMAL encoder drain thread initialized.
(Raspi_encoder.cc:180): RaspiEncoder Release request:
(Raspi_encoder.cc:152): InitEncode request: 320 x 240
(Raspi_encoder.cc:167): MMAL encoder drain thread initialized.
(Raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To: 400x300
(Raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To: 640x480
(Raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To: 1024x768
(Raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To: 1152x864
(Raspi_encoder.cc:180): RaspiEncoder Release request:
(Raspi_encoder.cc:500): Destroy Raspberr PI HW MMAL video encoder.
(Raspi_encoder.cc:180): RaspiEncoder Release request:
(Raspi_encoder.cc:470): MMALVideoEncoderFactory destroy

from rpi-webrtc-streamer.

quancao avatar quancao commented on June 8, 2024

Yes, I got the H.264 encoder with this log
(raspi_encoder.cc:480): Create Raspberry PI HW MMAL video encoder for H264

And from other raspi board, chromium-browser also report H.264
[7:33:0606/075041.682140:INFO:webrtcvideoengine2.cc(820)] Using codec: VideoCodec[100:H264]
[7:33:0606/075041.682529:INFO:webrtcvideoengine2.cc(859)] SetFeedbackOptions on all the receive streams because the send codec or RTCP mode has changed.

from rpi-webrtc-streamer.

kclyu avatar kclyu commented on June 8, 2024

Did you mean that there is a 10 second delay in the chromium of raspberry pi?

Chrome/chromium uses H.264 S/W decoding. Since chrome/chromium does not use H/W decoding, raspberry pi does not have sufficient speed and performance by S/W decoding.

If you want to improve performance with chromium in raspberry pi, it seems that there is no way to modify chromium's webrtc decoding to use GPU ;-)

from rpi-webrtc-streamer.

quancao avatar quancao commented on June 8, 2024

yes, it looks like the decoder of chromium on raspi have issue. It is slow down overtime.
In the first two mins, the performance is quite good. After that, it seems decoder is slow down and the delay is up to 10s.
I tried with UV4L-WebRTC, the issue did not happen. I think the different between uv4l-webrtc and rpi-webrtc-streamer is that UV4L has constant bit-rate
[driver] H264 costant bitrate: 8000000

I tried to configure rpi-webrtc-streamer to disable use_dynamic_video_resolution=false which is expected constant video bit-rate but I got crash.

from rpi-webrtc-streamer.

kclyu avatar kclyu commented on June 8, 2024

please use initial_video_resolution=true option together when disable the use_dynamic_video_resolution

use_dynamic_video_resolution=false
use_initial_video_resolution=true
...
initial_video_resolution=640x480

from rpi-webrtc-streamer.

quancao avatar quancao commented on June 8, 2024

Thank for your support.
The delay is now about 5s with fix video resolution.

from rpi-webrtc-streamer.

kclyu avatar kclyu commented on June 8, 2024

It looks like you are testing with chromium M56 and It looks good to wait for the M57 or later version to come out and test again.
Although it does not seem to be enough yet, there have been a lot of improvements related to BWE, and I'm not sure this issue(https://bugs.chromium.org/p/webrtc/issues/detail?id=6690) will fix delay issue caused by decoding delay. In the M57 and above have a related patch, so it may be better to try again later when you have latest chromium for raspberry pi.

from rpi-webrtc-streamer.

kclyu avatar kclyu commented on June 8, 2024

In the middle of waiting, it may be better to set the fps from 30 to 15 and to reduce the resolution while adjusting the decoding delay at the raspberry pi.

from rpi-webrtc-streamer.

quancao avatar quancao commented on June 8, 2024

I will try to reduce fps to 15 and check while waiting for M57.
Many thanks for your recommendations.

from rpi-webrtc-streamer.

kclyu avatar kclyu commented on June 8, 2024

Currently this issue seems to belong to Raspberry PI Chromium. First of all, this issue is close. If you have issues that require support from RWS later, please reopen.

from rpi-webrtc-streamer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.