Forked from markvdb/source-720p-videobox-udp-as-cam1.sh
Last active
November 15, 2016 19:23
-
-
Save krokodilerian/abb8209d666edb54eaebb73ebd3ef13a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
confdir="`dirname "$0"`/../" | |
. $confdir/default-config.sh | |
if [ -f $confdir/config.sh ]; then | |
. $confdir/config.sh | |
fi | |
# should come from config | |
URL=udp://227.0.0.2:9000 | |
#tunables | |
#10sec timeout on reading, 8m buffer for reading | |
URLPARAMS='?timeout=10000000&buffer_size=81921024&fifo_size=178481' | |
# note the setdar and setsar, these are needed if for some reason your | |
# input is not exactly 1280x720 and rescaling it fucks up the aspect | |
# or pixel dimensions. | |
ffmpeg -y -nostdin \ | |
-i "${URL}${URLPARAMS}" \ | |
-ac 2 \ | |
-filter_complex " | |
[0:v] scale=$WIDTH:$HEIGHT,fps=$FRAMERATE,setdar=16/9,setsar=1 [v] ; | |
[0:a] aresample=$AUDIORATE [a] | |
" \ | |
-map "[v]" -map "[a]" \ | |
-pix_fmt yuv420p \ | |
-c:v rawvideo \ | |
-c:a pcm_s16le \ | |
-f matroska \ | |
tcp://localhost:10000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment