summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/loop+encode+stream4
-rwxr-xr-xbin/stream7
2 files changed, 6 insertions, 5 deletions
diff --git a/bin/loop+encode+stream b/bin/loop+encode+stream
index fc944fe..b767dca 100755
--- a/bin/loop+encode+stream
+++ b/bin/loop+encode+stream
@@ -17,7 +17,7 @@ FIRSTPORT=${2:-5002} # even number - next 3 ports used too
ACHANNELS=2
AFRAMERATE_OPUS=48000
-ABITRATE=32000
+ABITRATE_OPUS=32000
# TODO
HEIGHT=360
@@ -37,7 +37,7 @@ fi
ffmpeg -hide_banner -threads auto -re \
-stream_loop -1 -i "$INPUT" \
-map '0:a' \
- -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE_OPUS" -b:a "$ABITRATE" \
+ -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE_OPUS" -b:a "$ABITRATE_OPUS" \
-f rtp -payload_type 111 "rtp://$IP:$FIRSTPORT?pkt_size=1200" \
-map '0:v' \
-pix_fmt yuv420p \
diff --git a/bin/stream b/bin/stream
index 0734f83..846ebde 100755
--- a/bin/stream
+++ b/bin/stream
@@ -80,7 +80,8 @@ ACHANNELS=1
AFRAMERATE_SRC=24000
AFRAMERATE_OPUS=24000
AFRAMERATE_AAC=44100
-ABITRATE=16000
+ABITRATE_OPUS=16000
+ABITRATE_AAC=64000
# FIXME: support multiple heights
HEIGHT=234
@@ -172,7 +173,7 @@ ffmpeg -hide_banner -threads auto \
${HEIGHTS_WEBM:+\
${HASAUDIO:+-map '0:a' }${HASVIDEO:+$(printf_each ' -map [v%swebm]' "$HEIGHTS_WEBM") } -shortest \
${HASAUDIO:+\
- -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE_OPUS" -b:a "$ABITRATE" } \
+ -codec:a libopus -ac "$ACHANNELS" -ar "$AFRAMERATE_OPUS" -b:a "$ABITRATE_OPUS" } \
${HASVIDEO:+\
-pix_fmt yuv420p \
-codec:v vp8 -quality realtime -deadline 1000000 -cpu-used 15 \
@@ -188,7 +189,7 @@ ffmpeg -hide_banner -threads auto \
${HEIGHTS_MPEG:+\
${HASAUDIO:+-map '0:a' }${HASVIDEO:+$(printf_each ' -map [v%smpeg]' "$HEIGHTS_MPEG") } -shortest \
${HASAUDIO:+\
- -codec:a aac -strict experimental -ac "$ACHANNELS" -ar "$AFRAMERATE_AAC" -b:a $((ACHANNELS*64))k } \
+ -codec:a aac -strict experimental -ac "$ACHANNELS" -ar "$AFRAMERATE_AAC" -b:a $((ACHANNELS*ABITRATE_AAC)) } \
${HASVIDEO:+\
-pix_fmt yuv420p \
-codec:v libx264 -tune zerolatency -preset ultrafast \