Video Payload Pi Update August 15 – Optimization of Video Stream

This update of the video Pi code is not required, but is a strongly recommended as it will optimize your video stream. These changes will improve the smoothness of the video and will improve the streaming ability to perform better in the event of bad network. The current build that you have will work, this is just an optimization of FFMPEG streaming.

If you would like to take advantage of this optimization, there are two means of doing so:

  1. Recommended Method: Re-flash your sd card (or flash onto a new SD card if you want to test the code first) with the updated code (either link below will download the updated video Pi code file). All the instructions for doing so are the same, but with the new image. Make sure to test that you can stream to http://eclipse.stream.live/ once completed.
    1. Video Pi Code Update August 15 download
    2. Video Pi Code Update August 15 download
  2. Manual Method: Manually change the file to incorporate optimizations: If you have made your own additions to the August 3 code update the instructions below will allow you manually update your code to take advantage of these optimizations for FFMPEG streaming. This is more technical and involves ssh-ing into the pi and changing a file as the root user. ONLY do this change if you are familiar with these practices and/or you have a backup image/card you can revert to in case a mistake is made or you encounter a problem.

Please let Shane know if you have any questions or concerns. We know this is a late update but it is worth sharing any improvement which will ehance your streams, especially those on weaker network connections.

Manually Incorporating the Optimization:

We strongly advise users to flash the new image instead of the “manual method” if possible, but in the case you already have made your own changes to the August 3 code update, we have a manual way to potentially update your code to take advantage of these optimizations. Use these instructions to update your video Pi code at your own risk and make sure you have a backup of your card/image in case something doesn’t work. This method is more technical and involves ssh-ing into the pi and changing a file as the root user. ONLY do this if you are familiar with these practices and/or you have a backup image/card you can revert to in case a mistake is made or a problem is encountered.

Instructions for updating the Raspberry Pi Streaming Configurations can be found below:

Open a terminal (Use PuTTY if in Windows)

  1. ssh pi@192.168.1.3 [ENTER] (replace ip if yours differs)
  2. On password prompt, type: raspberry [ENTER]
  3. using a file editor on the pi (vim, nano), modify /opt/stream/bin/picam-rtsp-server to match the information below or the file provided in the link: https://raw.githubusercontent.com/MSU-BOREALIS/VideoStreaming/master/fs-overlay/fs/opt/stream/bin/picam-rtsp-server

    #!/usr/bin/env bash
    WIDTH=1280
    HEIGHT=720
    BITRATE=2000000
    RTSP_PORT=8554

    `raspivid -w $WIDTH -h $HEIGHT -b $BITRATE -pf baseline -fps 24 -g 48 -ih -t 0 -n -hf -vf -o – | cvlc stream:///dev/stdin –sout ‘#rtp{sdp=rtsp://:8554/}’ :demux=h264`
  4. Restart the pi

Make sure to test that you can stream to http://eclipse.stream.live/ once completed.