1#!/usr/local/bin/bash
2
3#
4# SRT - Secure, Reliable, Transport
5# Copyright (c) 2018 Haivision Systems Inc.
6#
7# This Source Code Form is subject to the terms of the Mozilla Public
8# License, v. 2.0. If a copy of the MPL was not distributed with this
9# file, You can obtain one at http://mozilla.org/MPL/2.0/.
10#
11
12FFPLAY=`type -p ffplay || echo none`
13if [[ $FFPLAY == "none" ]]; then
14	echo >&2 "ERROR: ffplay not available to call. Please install ffplay first."
15	exit 1
16fi
17
18DIRNAME=`dirname $0`
19if [[ ! -x $DIRNAME/srt-live-transmit ]]; then
20	echo >&2 "ERROR: you need 'srt-live-transmit' tool from SRT package in the same directory as this script."
21	exit 1
22fi
23
24SRCLOC=$1
25if [[ -z $SRCLOC ]]; then
26	echo >&2 "Usage: `basename $0` <source URL>"
27	exit 1
28fi
29
30$DIRNAME/srt-live-transmit "$1" file://con/ | ffplay -
31
32