Otyugh

ffmpeg

numériser des vhs

##LIST ALL AUDIO DEVICE
#LANG=C pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
audio="alsa_input.pci-0000_00_14.2.analog-stereo"
video="/dev/video0"
buffer="2048"
tmax="4:0:0"
file="vhs-$(date +%H_%M)"
##Find the appropriate standard
while true
do
	read -p "Entre un standard pal/secam/.." standard
	ffplay -f v4l2 -standard $standard -i $video
	read -p "Rendu correct avec $standard ?" -n1 a
	test "$a" == "y" && break
done

ffmpeg -thread_queue_size $buffer -vf 'yadif' -f v4l2 -standard $standard -i $video -thread_queue_size $buffer -f pulse -i $audio -t $tmax $HOME/Bureau/$file.mp4


##Post processing (boreders mainly & make it lighter)
crf=29
x="720:576:0:0"
echo "ffplay -i $file.mp4 -vf 'crop=$x' -crf $crf"
echo "-ss 0 -to 4:0:0 $file-final.mp4"