Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # externremux.sh
- ### GENERAL CONFIG START
- ###
- # Pick one of DSL/WLAN
- QUALITY="LOW"
- ###
- ### GENERAL CONFIG END
- case "$REMUX_VPID" in
- ''|0|1) CONTENTTYPE='audio/mpeg';;
- *) CONTENTTYPE='video/mpeg';;
- esac
- QUALITY=${REMUX_PARAM_QUALITY:-$QUALITY}
- case "$QUALITY" in
- LOW|low) VBR=700K; ABR=64K; VSIZE=ega;;
- DSL|dsl) VBR=640K; ABR=64K; VSIZE=hd480;;
- WLAN|wlan) VBR=1500K; ABR=128K; VSIZE=hd480;;
- *) error "Unknown quality '$QUALITY'";;
- esac
- ABR=${REMUX_PARAM_ABR:-$ABR}
- VBR=${REMUX_PARAM_VBR:-$VBR}
- VSIZE=${REMUX_PARAM_VSIZE:-$VSIZE}
- FPS=${REMUX_PARAM_FPS:-$FPS}
- if [ "$SERVER_PROTOCOL" = HTTP ]; then
- echo -ne "Content-type: ${CONTENTTYPE}\r\n"
- echo -ne '\r\n'
- # abort after headers
- [ "$REQUEST_METHOD" = HEAD ] && exit 0
- fi
- /home/server/bin/ffmpeg -f mpegts -i - \
- -filter:vf yadif -filter:v scale=${VSIZE} \
- -c:v libx264 -preset fast -crf 21 -maxrate ${VBR} -map 0:v:0? -deinterlace -bufsize 1024K -profile:v high -level 4.0 \
- -c:a aac -map 0:m:language:hun? -map -0:m:language:eng? -ignore_unknown -b:a ${ABR} -ar 44100 -ac 2 -async 50 -sn \
- ${FPS:+-r $FPS} \
- -f mpegts pipe:1
RAW Paste Data