I recently acquired some movies in Video CD format. These are from before DVD readers were common, and so a full length film would be split across two CDROMs. I normally rip DVDs on my mac using Handbrake, but this doesn’t support VCD format. Furthermore, I wanted to be able to combine video from several disks.

After failing to find a nice app that does this, I settled on the trusty ffmpeg command line tool, as suggested in this post. Here’s a wrapper that can concatenate several videos (gist):

#!/bin/bash # usage: vcd2mp4 output.mp4 input.dat [input2.dat...] if [[ $# -lt 2 ]]; then echo "usage: $0 output.mp4 input.dat [input2.dat...]" >&2 exit 1 fi output="$1" shift # concatenate inputs declare -a PARAMS if [[ $# -gt 1 ]]; then FILELIST="$(mktemp vcd2mp4_XXXX)" while [[ $# > 0 ]]; do echo "file '$1'" >> "$FILELIST" shift done PARAMS+=(-f concat -safe 0 -i "$FILELIST") else PARAMS+=(-i "$1") shift fi PARAMS+=(-vf yadif -c:v libx264 -crf 20 -c:a aac -b:a 128k -movflags +faststart) PARAMS+=("$output") echo -n "ffmpeg " for param in "${PARAMS[@]}"; do echo -n "'$param':q "; done echo ffmpeg "${PARAMS[@]}" code=$? rm "$FILELIST" exit $code

Save this as vcd2mp4 and make it executable (chmod +x vcd2mp4).

The main video file from a VCD should be a ‘.dat’ file inside the MPEGAV folder. For single-CD movies, you can create the mp4 file directly from the CD:

vcd2mp4 MyMovie.mp4 /Volumes/MYMOVIE/MPEGAV/AVSEQ01.DAT

For several CDs, copy all the DAT files to a single location before converting:

vcd2mp4 MyMovie.mp4 MyMovie1.dat MyMovie2.dat

Unfortunately, VCD video quality is atrocious (mine are 352×288 at 25fps). You might get slightly better results by disabling deinterlacing (no -yf yadif) or otherwise modifying ffmpeg parameters. However, VCD will never give particularly good quality and should only be used if the video is truly unavailable from other sources.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.