Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VLC_BIN=/usr/local/vlc-2.0.8a/bin/vlc
- if [ "$#" -lt "2" ]; then
- echo "Usage : $0 mcast port"
- exit
- fi
- while true; do
- voptions="-vcodec libx264 -profile:v main -preset:v ultrafast -b:v 1500k -aspect 16:9"
- aoptions="-acodec aac -b:a 64k -ac 2 -ar 48000 -strict -2"
- mcast=$1
- port=$2
- $VLC_BIN -I dummy --sout='#std{access=file,mux=ts,dst=/dev/stdout}' --sout-keep "udp://@$mcast:$port" vlc://quit 2>/dev/null | \
- ffmpeg -i - $voptions $aoptions -threads 0 -f mpegts -y - 2>/dev/null | \
- $VLC_BIN -I dummy \
- --sout='#std{access=livehttp{seglen=10,delsegs=true,numsegs=10,index=/var/www/html/'$mcast':'$port'/prog_index.m3u8,index-url=#######.ts},mux=ts,dst=/var/www/html/'$mcast':'$port'/#######.ts}' \
- /dev/stdin vlc://quit -vvv 2>&1
- sleep 1
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement