Skip to content

Video Streaming Setup

Jacob Keeler edited this page Sep 19, 2017 · 10 revisions

SDL Core Video Stream Setup

Initial Configuration

Install Packages


sudo apt-get install git cmake build-essential libavahi-client-dev libsqlite3-dev chromium-browser libssl-dev libudev-dev libgtest-dev libbluetooth3 libbluetooth-dev bluez-tools gstreamer1.0* libpulse-dev


sudo apt-get update
sudo apt-get upgrade
sudo ldconfig

Clone the SDL Core Repository

Clone the SDL Core repository

git clone https://github.com/smartdevicelink/sdl_core.git

CD into sdl_core/ and checkout the branch, master

git checkout -b master origin/master

Clone the SDL HMI Repository

Clone the Web HMI repository

git clone https://github.com/smartdevicelink/sdl_hmi.git

CD into sdl_hmi/ and checkout the Release Branch

git checkout -b release/4.0.0 origin/release/4.0.0

Setup the Build Environment

Create build folder outside of sdl_core/ directory

mkdir  build
cd build

Run CMAKE and install application

cmake ../sdl_core
make
make install

Copy keys from bin/ to src/appMain

cp bin/myKey.pem src/appMain
cp bin/myCert.pem src/appMain

Pipe Stream Setup

Note: The default video streaming configuration streams video to an HTML5 Player in the web HMI via web sockets. To use the default streaming configurations, skip this section and jump to the "Start SDL Core" section below.

If you would rather use gstreamer for video playback, follow these directions to configure core to send video data via a pipe stream.

GSTREAMER Setup

First lets figure out what gstreamer command works in your environment

Find a raw h.264 file and see what gstreamer command actually plays it

  • Ubuntu 12.04
gst-launch-0.10 filesrc location=/path/to/file ! decodebin ! ffmpegcolorspace ! videoscale ! ximagesink sync=false

Alternative (assuming you have the correct elements installed)

gst-launch-0.10 playbin2 uri=file:///path/to/file
  • Ubuntu 13.10 - 14.04
gst-launch-1.0 filesrc location=/path/to/file ! decodebin ! videoconvert ! xvimagesink sync=false

or

gst-launch-1.0 filesrc location=/path/to/file ! decodebin ! videoconvert ! ximagesink sync=false

If you're using tcp, you can connect the stream directly with your phones ip address using

gst-launch-1.0 tcpclientsrc host=<Device IP Address> port=3000 ! decodebin ! videoconvert ! ximagesink sync=false
  • Audio Stream Pipe (Raw PCM)
gst-launch-0.10 filesrc location="audio_stream_pipe" ! audio/x-raw-int, rate=8000, channels=1, endianness=4321, width=16, depth=16, signed=true ! pulsesink

Make configuration changes to smartDeviceLink.ini

In the build folder directory, open src/appMain/smartDeviceLink.ini in a text editor and the make the following change

Under [MEDIA MANAGER] comment out the socket stream options and remove semicolon from the pipe stream options

;VideoStreamConsumer = socket
;AudioStreamConsumer = socket
;VideoStreamConsumer = file
;AudioStreamConsumer = file
VideoStreamConsumer = pipe
AudioStreamConsumer = pipe

Prerolling Pipeline

After you start SDL Core, cd to src/appMain/storage and there should be a file named "video_stream_pipe". Use the gst-launch command that worked for your environment and set file source to the video_stream_pipe file. You should see “setting pipeline to PAUSED” and “Pipeline is PREROLLING”.

Start SDL Core

In the build folder

cd src/appMain
./smartDeviceLinkCore

NOTE: If you want to use a USB connection, you must run

sudo ./smartDeviceLinkCore

Start the web HMI

CD to HMI repository and run

chromium-browser index.html

Start Video Stream

To DO: Provide public mobile application that supports video streaming.

Mobile application settings (Wifi/TCP connection):

  • Deselect Heartbeat.
  • Select MobileNavi (video source).
  • Select H264 video format.
  • Select wifi as the connection type.
  • Input the Virtual Machine's IP Address and port 12345.
  • Click Ok on App to start connection.
  • On the web HMI, click the italic "i" and select your app.
  • On the app select "start service" to request permission to stream video.
  • The HMI will prompt you to give permission to the app to stream video. Click "Ok"
  • On the app click "Start File Streaming". Depending on your video playback configuration, the video will begin playing in the web browser, or a gstreamer window open and begin playing the video.

Mobile application settings (USB connection):

  • After core is started, connect a phone to your machine with a usb cable.
  • Phone will prompt which app you want to run, select your app.
  • Now start the app on your phone.
  • Deselect Heartbeat.
  • Select MobileNavi (video source).
  • Select H264 video format.
  • Select usb as the connection type.
  • Click Ok on App to start connection.
  • On the web HMI, click the italic "i" and select your app.
  • On the app select "start service" to request permission to stream video.
  • The HMI will prompt you to give permission to the app to stream video. Click "Ok"
  • On the app click "Start File Streaming". Depending on your video playback configuration, the video will begin playing in the web browser, or a gstreamer window open and begin playing the video.