gif gif

The interesting corner

gif gif

Command to record EasyCAP AV to USB with ffmpeg on linux

Introduction

My parents still have a lot of MiniDV tapes with videos from when we were kids, and since I am really loving my Immich instance, I wanted to digitize those tapes and add them to my Immich albums, so I could watch them more often. I have a JVC GR-D225 which can still play the tapes, and I use an EasyCAP AV to USB adapter to digitize the tapes.

The command

The command to convert the AV to USB input using ffmpeg is:
ffmpeg -f alsa -i hw:2 -f video4linux2 -i /dev/video2 -video_size 720x480 -vcodec libx265 -crf 28 "$1"
I put it in a script command.sh which looks like this:

#!/bin/bash
echo exucuting command: "ffmpeg -f alsa -i hw:2 -f video4linux2 -i /dev/video2 -video_size 720x480 -vcodec libx265 -crf 28 $1"
ffmpeg -f alsa -i hw:2 -f video4linux2 -i /dev/video2 -video_size 720x480 -vcodec libx265 -crf 28 "$1"
                
The parameters for this command that are crucial are the -vcodec libx265 -crf 28 parameters (from here). These make sure that the H.265 codec is used, which helps immensely with the file size. The -crf 28 parameter is the quality parameter, where 0 is lossless and 51 is the worst quality. I found that 28 is a good balance between quality and file size. The -video_size 720x480 parameter is the resolution of the video, which is the resolution of the MiniDV tapes.

The -f alsa -i hw:2 parameter is the audio input, which is the EasyCAP AV to USB adapter. This may be different with your setup. The -f video4linux2 -i /dev/video2 parameter is the video input, which is the EasyCAP AV to USB adapter as well. The $1 parameter is the output file, which is the first argument of the script.

the setup for digitizing the tapes

Why this matters (to me)

Since installing and using Immich, I noticed the importance of digitizing / backing up old videos and photos. One of the best parts about immich to me is the "today X years ago" feature, which notifies you of assets that have the same date as today only with a different year. This usually brings up photos and videos which I normally would never look at again. I usually send these memory assets to my parents or friends, to share in the nostalgia of simpler times.