I've been looking for a way to get Pi Cam video streaming into an Android device and all Android Source code I found is very high latency. The only one I found was the ShawnBaker ́s RPiCameraViewer app that works very well with very low latency. The only problem is that this code is very confusing and full of Libs, Activity, and complexity. I ask someone to help me to get this job done with the minimum code. Just the SurfaceView playing from a raspberry UDP video server.
My goal is have a Android code to stream Raspberry cam whith low latency.
The comand I use is:
raspivid -n -ih -t 0 -rot 0 -w 1280 -h 720 -fps 15 -b 1000000 -o - | ncat -lkv4 5001
and the UDP variation:
raspivid -n -ih -t 0 -rot 0 -w 1280 -h 720 -fps 15 -b 1000000 -o - | ncat -lv4 -u 5001
I had tried all kinds of players like Exoplayer and Vitamio without successful. Weeks looking. Any help?
1 Answer 1
I don't know what you was exactly looking for but RPiCameraViewer
application (the video streaming part of course) can be condensed to 4-5 classes and one library. If you don't need transition effects like fading controls, camera listing and so on, the interesting code is just split between the following files:
VideoFragment.java
SpsParser.java
SpsReader.java
You still need the ca.frozen.library
because you need the ZoomPanTextureView
component.
Please note that this component is available here:
The remaining code of the original app is not very clear and sometime confusing but you can work on the classes above, is no so difficult.
Best regards, Mike
4.10. Web streaming