Streaming is slow and choppy


#1

I got the browser streaming robot working and notice the streaming is choppy on my wifi. Both the iPad and robot are about 20 feet from the wifi router with full strength connection. I took a look at raspberry_pi_camera_streamer and it doesn’t have an easy way to change the resolution to something lower like 320x240. Anyone have a handy trick for setting the resolution to something lower so that it streams more consistently?

I ported the GoPiGo to use with BrickPi and plan to contribute it once I get the documentation written.

thanks

peter


#2

I found a partial solution to the choppy streaming. Updating the firmware seems to have improve the streaming so that it lags a lot less.

sudo rpi-update

it still isn’t smooth streaming, but it’s better than before.


#3

Hey peter,
Sorry for your woes. I think it might be because of you WiFi connection only. The best performance that we found with the streaming example was with a WiFi connection in the same room as the GoPiGo and with very few other device apart from the GoPiGo and the host device. It would be great if you could try to test this with something like a portable wifi hotspot from your mobile to see if that helps.

Thanks for the pull with the browser streaming example for the BrickPi.

-Karan


#4

I tried it with 2 different wifi routers. 1 is an older linksys, which had quite a bit of lag and skipping at my in-laws house. At home I have a netgear R6300v2, which seems to much better.

looking at the video, it’s taking full resolution, so I’m trying to figure out how to reduce the resolution to 320x240 or 640x480 to make it smoother. If I figure it out, I will update my github and make another pull request so others can get smoother streaming on slower wifi rouers.

peter


#5

I had to read the source code for raspberry_pi_camera_streamer to figure out how to pass width and height. turns out it is straight forward like this.

self.cameraStreamerProcess = subprocess.Popen(
[ “/usr/local/bin/raspberry_pi_camera_streamer”,“320”,“240” ] )


#6

FYI by default raspberry_pi_camera_streaming is set to 640 x 480 and port 8080 for httpd.


#7

I’m happy to report that with a Wifi AC router and the resolution set to 320x240 the video streaming is more consistent and works well. I did try it at the higher res and found performance wasn’t as consistent.


#8

Hey,
Thanks a lot for letting us know about this. Hope that this helps someone else in the future too.

-Karan


#9

Thanks for this, it definitely helped me. At 320x240 it’s a lot smoother, actually works very well. There was way too much lag at 640x480. Using it with my Samsung Mega, and the picture looks great, movement is smooth.

Now, if I could just figure out how to “flip” the streamed image so you don’t have to twist the ribbon cable. I searched high and low, and found arguments vf and hf, but I couldn’t get it to work with streaming video, it works fine when taking stills with the camera.

If anyone has ideas on how to flip the image, please pass it on.

Glen


#10

The camera streamer libraries doesn’t support flipping he image. Atleast not based on the source code that I see up on bitbucket. https://bitbucket.org/DawnRobotics/raspberry_pi_camera_streamer/src/83dcbf1dc3f0bb2902945934f1122183f5d3ce2c/src/main.cpp?at=master

There’s two ways I can think of. The first is update the streaming to support it. The second is to use OpenCV to flip the image. I have a tutorial on using OpenCV on my blog if you want to get it installed on Raspberry Pi. http://electronsfree.blogspot.com/2015/01/making-it-easier-to-install-opencv-on-pi.html

hope that helps