Skip to content

Instantly share code, notes, and snippets.

@max-verem
Created May 12, 2017 09:33
Show Gist options
  • Save max-verem/56456663670c5277e73263fd98547a68 to your computer and use it in GitHub Desktop.
Save max-verem/56456663670c5277e73263fd98547a68 to your computer and use it in GitHub Desktop.
Produce live streams with decklink sdi input and intel's h264 codec
#!/bin/bash
D1="[f=hls:hls_flags=delete_segments:hls_list_size=10:hls_time=20]/var/www/html/hls2/stream.m3u8"
D2="[f=mpegts]udp://239.1.1.2:10480?localaddr=10.1.5.99&pkt_size=1316&fifo_size=1000000"
D3="[f=dash:window_size=5:extra_window_size=5:remove_at_exit=1]/var/www/html/dash2/stream.mpd"
ffmpeg \
-v verbose \
-f decklink -i "DeckLink SDI (2)@3" \
-vcodec h264_qsv -a53cc 0 \
-minrate 512k \
-maxrate 1536k \
-vb 1024k \
-profile:v main -level:v 31 \
-preset:v medium -bf 2 -g 50 -keyint_min 50 -pix_fmt nv12 \
-acodec libfaac -ab 128k -ar 48000 \
-vf "yadif=0:-1:0,scale=854:480,setdar=dar=16/9'" \
-af "volume=volume=10.0dB'" \
-threads 8 \
-flags +global_header \
-f tee -map 0:v -map 0:a \
"$D1|$D2|$D3" 2>&1 | stdbuf -i0 -o0 tr '\r' '\n' | awk '{ print strftime("%F %T : "), $0; fflush(); }' | tee SDI2-SD-qsv.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment