36 lines
1.2 KiB
Bash
Executable file
36 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
echo "Press CTRL+C to exit"
|
|
|
|
source config
|
|
|
|
echo ${srt_output}
|
|
|
|
while :
|
|
do
|
|
CURRENTDATE=`date +"%Y-%m-%d %T"`
|
|
echo Start at ${CURRENTDATE}
|
|
|
|
threads=12
|
|
|
|
# gpu
|
|
hwaccel="-hwaccel vaapi -vaapi_device /dev/dri/renderD128"
|
|
input_video_filter="-vf format=nv12,hwupload"
|
|
h264_vaapi="-c:v h264_vaapi -qp 18"
|
|
|
|
#cpu
|
|
#libx264="-c:v libx264"
|
|
|
|
#calf plugins
|
|
#input_audio_filter="-af lv2=p=http\\\\://calf.sourceforge.net/plugins/Gate:c=threshold=0.04010706|knee=8|range=0.03148599, lv2=http\\\\://calf.sourceforge.net/plugins/Compressor:c=knee=8|threshold=0.125, lv2=http\\\\://calf.sourceforge.net/plugins/Limiter:c=level_out=0.71697748|limit=0.62763602"
|
|
|
|
#load normalization
|
|
#output_audio_filter="-filter:a loudnorm"
|
|
|
|
ffmpeg -hide_banner -loglevel repeat+level+info ${hwaccel} -f v4l2 -framerate 30 -pix_fmt yuv420p -video_size 1920x1080 -i /dev/video7 -f alsa -thread_queue_size 24000000 -ar 44100 -i plughw:CARD=USB ${input_audio_filter} ${input_video_filter} -f mpegts ${h264_vaapi} ${libx264} -b:v 5500k -c:a aac -b:a 192k ${output_audio_filter} -ac 2 -ar 44100 -threads ${threads} -y ${srt_output}
|
|
|
|
CURRENTDATE=`date +"%Y-%m-%d %T"`
|
|
echo End at ${CURRENTDATE}
|
|
sleep 5
|
|
done
|
|
|