Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added git submodule for adaptive-streaming and some setup scripts #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Intel_Edison/Debian/.vagrant
Nvidia_JTX1/Ubuntu/jetpack_download
Nvidia_JTX1/Ubuntu/JetPack-L4T-2.3.1-linux-x64.run
Nvidia_JTX1/Ubuntu/.vagrant
Common/Ubuntu/adaptive-streaming
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Common/Ubuntu/adaptitve-streaming"]
path = Common/Ubuntu/adaptitve-streaming
url = https://github.com/shortstheory/adaptive-streaming
1 change: 1 addition & 0 deletions Common/Ubuntu/adaptitve-streaming
Submodule adaptitve-streaming added at 28e573
25 changes: 25 additions & 0 deletions RPI2/Raspbian/9_setup_adaptive_streaming.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# RPi2 setup script for use as companion computer

if [ $(id -u) -ne 0 ]; then
echo >&2 "Must be run as root"
exit 1
fi

set -e
set -x

#GStreamer deps
apt install libgstreamer-plugins-base1.0* libgstreamer1.0-dev libgstrtspserver-1.0-dev

#For building
pip3 install meson
apt install ninja-build

cd
git submodule foreach --recursive git pull
cd Common/Ubuntu/adaptive-streaming/
meson build
cd build
ninja install
26 changes: 26 additions & 0 deletions RPI2/Raspbian/start_adaptive_stream
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -e
set -x

function fail() {
echo "Fail: $*"
exit 1
}

STREAM_TO_IP=$1
if test -z "$STREAM_TO_IP"; then
fail "Need an IP to stream to"
fi
shift


# Load the RPi Camera V4L2 Driver
sudo modprobe bcm2835-v4l2

# For getting a stream which automatically adjusts the quality according to the
# connection quality. Use the following gst-launch command to make it work:
# gst-launch-1.0 -v rtpbin latency=0 name=rtpbin udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=96" port=5000 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false host=10.0.1.128
# By default, port 5000 is used for RTP and port 5001 is used for RTCP

adaptive_streaming /dev/video0 $STREAM_TO_IP raw