X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=ffs;h=0570787709847c971e649a40b2612f88dca1b926;hb=87c3f2244a47ad10a031a27d0d0456f0a7defd21;hp=d63668b6e45b3736e479b37ba1851f32351b9df4;hpb=ca61084446e48fb0703ce2a203c1bd18ceaf4dfb;p=distro-setup diff --git a/ffs b/ffs index d63668b..0570787 100755 --- a/ffs +++ b/ffs @@ -186,11 +186,18 @@ else stream_res=$primary_res fi -# for 1080p, default 256k is poor quality. 500 is ok. 1500 is a bit -# better, so go with that. Also, that is about 2x what is recommended -# in https://livekit.io/webrtc/bitrate-guide (our framerate is lower). +stream_x=${stream_res%x*} +stream_y=${stream_res#*x} -bitrate=$(( ( ${stream_res/x/*} ) / 1380 )) +# leave out our i3 window borders +stream_res=$(( stream_x - 4 ))x$(( stream_y - 4)) + + +# 1000 is a bit blury, 1500 is pretty clear +# note https://livekit.io/webrtc/bitrate-guide (our framerate is lower) + +# Scale our bitrate to 1500 1080p +bitrate=$(( ( stream_x * stream_y ) / ( (1920*1080) / 1000 ) )) # 8 seems fine. be conservative by going a bit higher. framerate=10 @@ -306,7 +313,7 @@ if pkill -f ^ffmpeg.\*icecast://source.\*/fsf; then sleep 1 fi -#echo executing: ffmpeg ${opts[@]} +echo executing: ffmpeg ${opts[@]} #{ sleep 1; ffp &>/dev/null & } @@ -455,4 +462,9 @@ fi # ./configure --enable-libzmq --enable-libpulse --enable-libvorbis --enable-gpl --enable-version3 # +# note: when playing back, text is going to look aliased unless you +# watch it in a window that is exactly as bit or bigger than the +# recording: tabbed i3 window shrinks things. or, use: mpv +# --video-unscaled + ### end background/development docs ###