This commit is contained in:
douzeb 2023-03-01 21:34:29 +01:00
parent 74d70c8455
commit 5a4a7dca98

View file

@ -56,7 +56,7 @@ then
fi
FILENAME=live-v4l-${1}-cam${V4LDEVICE}-${RESOLUTION}p-${DURATION}s-${VBITRATE}kbps-${ABITRATE}kbps-${2}.mkv
FILENAME=live-v4l-${1}-cam${V4LDEVICE}-${RESOLUTION}p-${DURATION}s-${VBITRATE}kbps-${ABITRATE}kbps-${2}
echo " "
echo Will stream to $URL for $DURATION seconds
echo and save a copy of the data sent to the peertube server to file :
@ -87,7 +87,7 @@ ffmpeg \
-channel_layout stereo \
-ar 48000 \
-pixel_format yuv420p \
-filter_complex "[1:a]volume=-10dB;[0:v]scale='size=${RESOLUTION}',drawtext='font=DejaVuSansMono:text=%{pts}: fontcolor=white: fontsize=h/7: box=1: boxcolor=black@0.43: boxborderw=5: x=mod(floor(t/10+1)\,2)*mod(t*(w-text_w)/10\,w-text_w)+mod(floor(t/10)\,2)*(w-text_w-mod(t*(w-text_w)/10\,w-text_w)): y=h/2-3*text_h/2', drawtext='font=DejaVuSansMono:text=%{localtime}: fontcolor=white: fontsize=h/7: box=1: boxcolor=black@0.43: boxborderw=5: x=(w-text_w)/2: y=h/2+3*text_h/2'" \
-filter_complex "[1:a]volume=-10dB;[0:v]scale='size=${RESOLUTION}',drawtext='font=DejaVuSansMono:text=%{pts}: fontcolor=white: fontsize=h/12: box=1: boxcolor=black@0.43: boxborderw=5: x=mod(floor(t/10+1)\,2)*mod(t*(w-text_w)/10\,w-text_w)+mod(floor(t/10)\,2)*(w-text_w-mod(t*(w-text_w)/10\,w-text_w)): y=text_h/2', drawtext='font=DejaVuSansMono:text=%{localtime}: fontcolor=white: fontsize=h/20: box=1: boxcolor=black@0.43: boxborderw=5: x=text_h: y=h-3*text_h/2'" \
-codec:v libx264 \
-preset fast \
-x264opts nal-hrd=cbr:force-cfr=1:vbv-bufsize=${BUFFERSIZE}:bitrate=${VBITRATE}:vbv-maxrate=${VBITRATE} \
@ -95,4 +95,4 @@ ffmpeg \
-g 1 -segment_format_options movflags=+frag_keyframe+empty_moov+default_base_moof -segment_time 5 -f segment \
-t ${DURATION} \
-flags +global_header \
-f tee -map 0:v -map 1:a "[f=matroska]${FILENAME}|[f=flv]${URL}"
-f tee -map 0:v -map 1:a "[f=matroska]${FILENAME}.mkv|[f=flv]${URL}"