Everyone is welcome here --- except those who have borrowed books from me for and have not returned them yet!

How to convert videos recorded on a mini DV tape to mp4 files

Posted on avril 26, 2020 in misc

Let us imagine that you are forced to stay at home for a lengthy period of time. This may be just to right moment to convert and import those videos recorded on mini DV tapes.

I am lucky enough to have an old laptop (Dell E4300) with a IEEE 1394 (aka Firewire) connector (see Fig.1). This means that I can directly link the DV plug camrecorder to the 1398 port on the laptop running Linux Ubuntu 20.04.

Here is the hardware:

Fig.1: IEEE 1394 (aka Firewire) port Fig.1: IEEE 1394 (aka Firewire) port on the Dell E4300

Fig.2: Mini DV camrecorder Fig.2: Sony Mini DV camrecorder

Fig.3: Male-male 4-pin IEEE 1394 cable Fig.3: Male-male 4-pin IEEE 1394 cable

  • I just needed to install two programs, dvgrab and ffmpeg

    sudo apt install dvgrab ffmpeg
  • To import the videos to the harddrive, put the camrecorder in VCR mode, rewind the tape, then type the following command line (and wait until the tape is fully played -- this is real time, so a 1hour tape will take 1 hour to import):

    dvgrab --autosplit --timestamp --format dv2 mymovies-
  • The videos are imported as a series of .avi files which contain them in an uncompressed format. A 60min video tape eats about 15GB. You can dramatically decrease the size of the videos, without any noticeable loss of quality, by converting them using a codec like h264, as follows:

    for f in *.avi ; do ffmpeg -i  "$f" -deinterlace -vcodec h264 -acodec mp3 "${f%.avi}.mp4"; done
  • After checking that the .mp4 files are fine (e.g. mplayer xxx.mp4), you can delete the avi files:

    rm *.avi

VoilĂ !