Tuesday, 22 March 2016

Video/Audio Streaming Testing

The following options were looked into for video streaming and/or VoIP:

  • uv4l
  • Motion
  • MJPG-Streamer
  • Asterisk & freebpx
The first attempt at achieving this function was using 'uv4l', which allows for streaming video and audio over various platforms. It was able to be hosted on the RPi. The primary reason for trying this software was due to the convenience of how both video and audio could be streamed between the RPi and another device in a browser. The software is exactly what was required. However, testing the server on a mobile device showed how it would not work on mobile - although this was on iOS, and is likely to have worked on Android. This was due to the software using video files that the mobile device did not understand. As a result of this I decided to look into other options.

Motion was the next option looked into, where the software features the ability to detect motion in the video. Instead of being an encoded video, it was images captured from the camera and then encoded into a format that would be able to be viewed on any device. Out of all of the software tested, Motion was by far the easiest to setup and configure. It was configured to update the the feed every second, but if motion was detected (which is done by detecting a specified amount of change from the previous frame) then the fps would increase to around 5fps to get a smoother stream. The biggest drawback with using Motion is that only a video stream is produced, there is no audio - so the research continued.

Similar to Motion, MJPG-Streamer compiled images into a simple video stream of JPG images. Motion was easier to setup and implement, however MJPG-Streamer performed better and allowed for both cameras to run, this can be seen below when it was implemented onto the website. As this simple stream did not use stream audio, I carried on my research in an attempt to find a better solution which supported 2-way audio streaming.



The final software looked into was the software Asterisk and freebpx. These are to be used together as a pure VoIP method. This would be accessed externally to the video stream, and would require the use of an external VoIP app such as Zoiper.

However, in attempts to do this, the Asterisk and freebpx did not work and resulted in the use of just streaming video - not audio. As a result, I needed to make sure the video streaming was optimised for the project. Therefore, further testing using MJPG-Streamer to ensure the best output for mobile and ensuring the RPi would not be overloaded by the process.

Initially, at 640 by 480 resolution for each camera without compression, each stream took up between 35-45% of the CPU and showed a lot of delay in the FPS along with approx. 600ms latency. To help all of the issues here, I decided to use different parameters. Below shows the results.



This resulted in the choice to use 160x120 without compression at 20 FPS. The compressed version was not chosen because the image was noticeably worse.

No comments:

Post a Comment