some-usable-scripts/recording/README.md

1.9 KiB

First of all, these scripts helped me to record my first video. Here is my youtube channel to see the result.

Scripts to record videos

Both record-audio.sh and record-video.sh do exactly what their name is saying. These are simple ffmpeg calls. Their unique parameter is the output filename.

Since I use them on OpenBSD the audio driver is sndio and not Alsa or OSS or PulseAudio or whatever.

Recording the camera

I don't record my face from my camera in a separate video stream. I just display my camera feed in a window thanks to camera.sh and my whole screen is recorded with record-video.sh..

There are two optional parameters: brightness and saturation.

Don't hesitate to tweak a bit this script: there are a few hardcoded ffmpeg parameters, such as a very low quality video size.

Synchronize audio and video

The scrpt sync.sh is to include in your environment. It adds a few shell functions, using ffmpeg and mpv to help mixing and synchronizing audio and video.

  • stereo2mono: my first error was to record a mono input in stereo, so I had audio only on the left side. This fixes the issue by removing the superflous empty track. Side note: since then, record-audio.sh was corrected (see -ac 1 option).
  • please_read: I'm like super lazy. This launches mpv with both video and audio without having to specify both files and the mpv option. Just read the source, the function is obvious.
  • avsync: this is the core function to synchronize audio and video. Usage: avsync video audio delay output.
  • avs: did I mention I'm lazy? This function is just me not wanting to type all 4 parameters for avsync. Again, read the source code, it's obvious.

Forget about record-audio-and-video.sh

This script probably does work if your computer is powerful enough. That's not the case for mine.