-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video stream lags/latency #58
Comments
The latency might be introduced by this commit. |
Regarding latency, I have found VP8 to have a constant delay of around 2s on my machine, compared to VP9 and H264 seem quite buggy. Specifically, H.264 begins very well (with low latency) but quickly slows down until it gets stuck on one frame (this happens within about 5s of starting playback). Would love to know if anyone else has thoughts on achieving near realtime streaming? |
Hi! Did you end up finding some optimal settings for your use case? I'm currently in the similar boat - trying to find a way to stream videos with minimal delay using minimal bandwidth. Any pointers you have would be highly appreciated! |
@msadowski Hello. In my case problew was in Gazebosim. Gazibosim lags show in video. I understand it later. Web_video_server for real camera works "out of the box" - GOOD without lags. |
@SystemDiagnosticss: Thanks for the update! Did you play with web_video_server settings for the stream? I was trying to optimize the payload for minimal lag and bandwidth. What seems to work reasonably with my laptop camera (relatevily high res) is embedding the stream like this: I tried using theora for the default transport to save bandwidth however there is a crazy lag (over 10 seconds). Did you find anything that seems better than compressed transport? Thanks! |
Did anyone manage to use the vp8 stream? The mjpeg solution is very inefficient but the vp8 stream has so much delay it's unusable |
@IceSentry I did quite some experiments with it and never managed to use any of the streams that require a video element to run with a reasonable latency. I'm using only the sources that support elements right now. |
vp8 has always introduced latencies that build up over time. Currently for best quality I would recommend the new png method #74. It delivers noticeable improvement over mjpeg with max quality. |
Hey, what's the best solution to this? |
@msadowski did you used |
@khaledgabr77 The last time I've been looking into that was around 4 years ago so I imagine a lot could have changed. Around this time I've published a blog post: https://msadowski.github.io/ros-web-tutorial-pt3-web_video_server/ where you will find my ideas on what seemed to worked well at the time. From what I can see I was indeed using a compressed transport. |
Please use the lossless PNG streamer in your application (with |
@msadowski thanks for sharing your blog, it's was very useful. |
@viktorku what i'm working is publish 3 camera images over the server..i'm using |
also, when tried with |
Anyone solved it yet? |
This issue has existed for years, and reduce latency is also not an easy job. I have some updates on this issue.
For the client side latency, caches are the cause of most latency. We need try to do out best to reduce caches of our video player. Here is a very useful ffmpeg command to play the video with low delay. ffplay -fflags nobuffer -flags low_delay -framedrop -fflags discardcorrupt -preset ultrafast -tune zerolatency -fpsprobesize 1 -max_delay 1 -probesize 32 -analyzeduration 0 -sync ext "http://192.168.0.104:8080/stream?topic=/camera/image_raw&type=h264" 192.168.0.104 is the IP address of robot, and /camera/image_raw is the camera topic. You need to replace them with yours. If you are using an Intel CPU, This is our optimized version, h264 encoder is accelerated by VAAPI. If you are using RK3588, this is another optimized version. The package was rewrited with gsteamer, and added audio support. video encoders was accelerated by MPP. The latency is only about 100ms. If you are familiar with gstreamer, it's easy to modify it to support other GPUs. |
Video stream has big lags and latency
https://youtu.be/yXp9vstm8bA
I use mjpeg codec and firefox browser
Url: http://0.0.0.0:8080/stream?topic=/.../image_raw&width=640&height=470
I am also tested params such us quality and other type=ros_compressed.
But its not helped
What params I must use for minimal latency???
The text was updated successfully, but these errors were encountered: