Recording scripts.

master
Karchnu 2021-12-08 20:18:53 +01:00
parent e785e9bbc1
commit 88ddc45bff
5 changed files with 67 additions and 0 deletions

14
recording/camera.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
brightness=0.07
saturation=1.8
if [ $# -eq 2 ]; then
brightness=$1
saturation=$2
fi
echo "brightness = $brightness"
echo "saturation = $saturation"
ffplay -loglevel error -f v4l2 -input_format mjpeg -vf eq=brightness=$brightness:saturation=$saturation -video_size 640x480 /dev/video1

View File

@ -0,0 +1,5 @@
#!/bin/sh
# This doesn't work as intended on my very limited computer.
# Too CPU intensive.
ffmpeg -y -loglevel error -f x11grab -framerate 30 -video_size 1920x1080 -i :0.0 -f sndio -i snd/0 $@

3
recording/record-audio.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
ffmpeg -y -loglevel error -f sndio -i snd/0 -ac 1 $@

3
recording/record-video.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
ffmpeg -y -loglevel error -f x11grab -framerate 30 -video_size 1920x1080 -i :0.0 $@

42
recording/sync.sh Normal file
View File

@ -0,0 +1,42 @@
#!/bin/sh
# This is a list of simple shell functions to handle a few inconveniences
# regarding video and audio synchronization.
# When recording a mono source as a stereo, one of the speaker is muted.
# This removes the second (muted) track from the audio source.
stereo2mono(){
/usr/bin/ffmpeg -i "$1" -c:v copy -ac 1 "mono-$1"
}
# Side note: I record both audio and video with the same file names, besides the extension.
please_read(){
/usr/bin/mpv "$1.mkv" -audiofile "$1.opus"
}
# Synchronize the audio and video.
avsync(){
if [ $# -ne 4 ]; then
echo "usage: avsync video audio delay output"
return 1
fi
/usr/bin/ffmpeg -i "$1" \
-itsoffset "$3" \
-i "$2" \
-c:a copy -c:v copy -map 0:v:0 -map 1:a:0 \
"$4"
}
# Video and audio have the same name, except for the extension.
# Example: avs my-video 1.3
avs(){
if [ $# -ne 2 ]; then
echo "usage: avs prefix delay"
return 1
fi
avsync "$1".mkv "$1".opus "$2" "$1"-sync.mkv
}