|
Post by rhastie on Jul 18, 2014 13:07:48 GMT -8
Hi,
Has anyone managed to get RaspiConnect to successfully stream a video feed being generated off the Pi Camera module.
I have successfully managed to get this to operate for "stills" but would ideally like a proper stream video feed.
I've been thinking of using "motion" but as this will have to operate on a different port I think the only way would be to do a re-direct in a Remote Picture Webview control.
Has anyone done a video stream? Does anyone have any advice or a working solution?
Many Thanks....
|
|
|
Post by faraday on Jul 18, 2014 13:59:54 GMT -8
Hi rhastie,
I've been planning to do the same thing for my MouseAir project, but I haven't gotten to it yet.
As the Remote Picture Webview control is a Webkit window (like Safari), I've been planning to do it that way using one of the streaming packages available on the Raspberry Pi. When I looked at it I didn't see any problem (I ended up generating just a couple of movies because I was fooling around on Project Curacao - located 3500 miles away from me and I was sucking down the current with a live picture and since it was solar powered, I just couldn't do that all the time! Good idea, maybe after I add a couple of solar panels in September....)
Let me know how you get on.....
Faraday (www.switchdoc.com)
|
|
|
Post by rhastie on Jul 19, 2014 2:56:30 GMT -8
Interesting feedback.... Have you seen the B+ model. Apparently it uses less power. I also know there is an A+ plus variant coming... Might make a nice swap in September. You might get some more out of your panels/batteries  I terms of the streaming video if I get time I'll bang me head against the challenge over the weekend - I think simplicity is the key here so I need to have a deeper think about it 
|
|
|
Post by faraday on Jul 19, 2014 15:40:20 GMT -8
I just got my first B+ model. Haven't powered it up yet.
I'm using an model A in Curacao. An A+ would be cool, even if it just shaves off 20%, which it might.
Let me know what you try as far as streaming video.
Faraday
|
|
|
Post by rhastie on Jul 26, 2014 12:22:00 GMT -8
Well I've got it working - I'm actually surprised how well it actually turned out. On a fairly rough and ready WiFi link from my son's Pi robot we are getting a video stream of 500x500 pixels @ 5 FPS. I actually think we probably could get more if I had the patience. In terms of the solution its a bit of a hack and at the moment uses a hard-coded IP address. The key points are below: 1. I used the following code - github.com/silvanmelchior/RPi_Cam_Web_Interface. This brings a Web Cam up on the default port 80 and allows you to tune things from the default web-page 2. Unfortunately, the settings aren't persistent so I edited the /etc/raspimjpeg file to use 5 FPS, 500 width and 500 height 3. Next I edited the /var/www/index.html page to remove most of the noise and to just display the WebCam image and cycle it. You can use the script_min.js which is a lot cleaner. To help have a look at Section 9 @ elinux.org/RPi-Cam-Web-Interface4. You can check the video stream just by connecting to the Pi using a default browser (I used Chrome on my Mac) 5. You can make this automatically start on Pi boot by running ./RPi_Cam_Web_Installer.sh autostart_yes Ok. This should give you a simple and working video stream of the right size operating on the Pi's default port. To get this running inside RasPiConnect on the iPad I did the following 1. I edited the Project Curacao "Remote Picture Webview" HTML (thanks faraday!!) to use an iframe instead of displaying the image. Inside the iframe I loaded the index.html on the correct RPi port to load the Web Cam stream 2 This worked ok but had some nasty borders floating around - I had to re-edit both the Remote Picture Webview HTML and the index.html to remove these. I used <style>body,html,iframe{margin:0;padding:0;border:0}</style> to clean it up 3. Finally to stop the page refreshing as it was now streaming into the RasPiConnect app I had to disable AutoRefresh in the RasPiConnect app - you can do this simply in the settings section Example code here: index.html for RPi_Cam_Web_Interface (located in /var/www) <!DOCTYPE html> <html> <head> <title>WebCam</title> <style>body,html,iframe{margin:0;padding:0;border:0}</style> <script src="script_min.js"></script> </head> <body onload="setTimeout('init();', 100);"> <img id="mjpeg_dest"> </body> </html>
Remote Picture WebView code in RaspiConnectServer Local.py file based on the Project # RW-1 Remote Webview Photo elif (objectServerID == "RW-1"): #check for validate request if (validate == "YES"): outgoingXMLData += Validate.buildValidateResponse("YES") outgoingXMLData += BuildResponse.buildFooter()
return outgoingXMLData # normal response requested
responseData = "<html><head>" responseData += "<title></title><style>body,html,iframe{margin:0;padding:0;border:0}</style>" responseData += "</head>" responseData += "<body><iframe src=\"" responseData += "http://192.168.1.23\" " responseData += "frameborder=\"0\" width=\"500\" height=\"500\" seamless>" responseData += "</iframe>" responseData +="</body>" responseData += "</html>" outgoingXMLData += BuildResponse.buildResponse(responseData)
if (Config.debug()): print outgoingXMLData
If you need any advice on above just ping me and I'll do my best to help.... Good luck!!! My next steps are to clean up the code and remove the hard-coded IP address etc. Have fun.... Rich.
|
|