0

I'll try do my best to share the steps I've taken to fix lag on video with my raspberry pi.

I'm building a robot that has a raspberry pi mounted on top of it, which talks to an app for android through uv4l. it needs to be able to get a reliable picture as the requirements for the robot need it to be responsive to changes while the video runs.

I'm running an ALFA NETWORK AIP-W525H v2 router

Raspberry Pi 3 Model B board.

Lenovo Tablet TB2-X30F

I'm trying to get 300ms between the pi and whatever device will be used to show the video. I have an android app that uses a webview of the stream provided by uv4l. http://ip-address-pi:8080/stream/video.mjpeg

I also have nginx loaded to provide a python program for saving pictures on the camera to the android phone.

Nginx has two configurations, one for providing media queries for the video based on device size, and the other running a python program with uwsgi.

I tried stopping nginx which reduces the lag slightly, but not enough to make it playable for the purpose of the robot.

I tried enable QOS on the router to give priority to the tablet, which managed to reduce the lag slightly.

It's to be expected, that if it is on the router that is provided for the robot, lag would be less. if i try it on the home network the lag is worse, sometimes being 4 seconds of lag, but that's to be expected because we have many devices using the network at any given time.

I tried using VLC to stream it to itself on another computer, but the lag was still there.

I tried seeing how much CPU and memory usage while streaming and uv4l is approximately using 20% of both while video is going.

Any help appreciated! I know someone here must have the answer to this!

1
  • Please accept the answer with a click on the tick on its left side. Only this will finish your question and it will not pop up again and again for years.
    – Ingo
    Commented Dec 8, 2019 at 14:55

1 Answer 1

1

Use UV4L with webrtc for serious realtime streaming.

I do not know why people insist with mjpeg over http.

1
  • Thank you! This is great news! I dont know why i didn't do this sooner! Commented Jan 18, 2017 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.