zshortz
Posts: 3
Joined: Sun Oct 29, 2017 5:34 am

Streaming from RPI camera to android app

Sun Oct 29, 2017 5:38 am

So I am having a lot of difficulty streaming from raspberry Pi zero with camera to an android app. I have designed an android app but I keep getting errors when trying to play the video. The raspberry Pi cam and the android app are all connected on the same wifi connection using a router. Even with doing that, I am having difficulties. I am willing to pay someone to help me troubleshoot these issues and help lead me in the right direction.

null511
Posts: 6
Joined: Thu Oct 05, 2017 7:19 pm

Re: Streaming from RPI camera to android app

Sun Oct 29, 2017 2:17 pm

I'm not looking for pay, but I have a lot of experience streaming motion-jpeg [MJPEG] between devices (Android, Windows, Linux) and may be able to assist you. I'm assuming this is a motion-jpeg stream and not a true compressed video format.

- Verify your network setup. You will want to make sure the camera has a fixed LAN address instead of using DHCP. This allows your Android application to know the address of the camera to form a connection. Alternatively, you can have your camera devices broadcast their network address over UDP, allowing your Android app to automatically locate the dynamic [dhcp] address.

- Verify the camera is broadcasting a valid stream. If it is an MJPEG stream, you can simply open the address in any browser window and should be able to see your stream playing. For any other formats, you can use VLC to play almost anything.

- Verify your Android app can properly decode the MJPEG stream by trying to play a different URL. There are lots of unsecured cameras floating around the internet that you can test with. If you're having problems finding some, I can send you a few links.

If none of this helps you at all, then please be more specific with your problem :p

zshortz
Posts: 3
Joined: Sun Oct 29, 2017 5:34 am

Re: Streaming from RPI camera to android app

Sun Oct 29, 2017 5:05 pm

Thanks so much for that reply. If you could send a couple links for the cameras you were referring to that would be great. I havent tried the mjpeg way. I believe I was trying flash video.

zshortz
Posts: 3
Joined: Sun Oct 29, 2017 5:34 am

Re: Streaming from RPI camera to android app

Sun Oct 29, 2017 5:07 pm

The camera is producing a valid stream which I can view in the browser by just typing in the IP. I dont even type the port because it is all connected to same network. I think the issue is with the raspberry pi and getting it to produce a certain type of stream that my android app can open.

null511
Posts: 6
Joined: Thu Oct 05, 2017 7:19 pm

Re: Streaming from RPI camera to android app

Sun Oct 29, 2017 7:35 pm

What software are you using on the Pi to broadcast the video stream? As far as I know, there are only MJPEG [motion-jpeg] transcoders available currently. The MJPEG format is simply a stream of jpeg images, which makes it fairly universal and easy to decode from software.

It sounds like your Android application is trying to stream a true video stream though, probably MP4. Android does not have a native decoder for MJPEG, you will have to write one yourself. They are very simple though. Once I move my Android app to GitHub, I'll post a link to my decoder's code.

Return to “Networking and servers”