I had the pleasure to work with some video editing resently. The background is that my sister got some 8mm cine film from our youth converted to a DVD. As this DVD contains clip from many different 8mm cine films mixed together, I would like to split them up and be able to combine them in a new way.
I got the DVD as a dmg image from a mac, so the first thing was to see what kind of dmg image it was.
xxx@stas ~/Delta $ file film-compressed.dmg film-compressed.dmg: VAX COFF executable - version 8343 |
This type is a compressed image, so the first thing I need is to decompress it. For this a tool named dmg2img is available in the Gentoo portage tree.
dmg2img -v film-compressed.dmg film-uncompressed.iso |
Then I can mount the image and copy the contents out. Now I have the raw data for my videos
sudo mount -o loop -t auto film-uncompressed.iso isoMount |
Though was the vob files with error in the form of wrong length. Opening a file in vlc or another tool indicated a length of 9 seconds even though the clip was 3 minutes long. I fixed it together with a conversion using ffmpeg. So a quick script later, my computer was working on the conversion.
#!/bin/bash FILES=./isoContents/VIDEO_TS/*1.VOB for f in $FILES do OUTPUT_FILE=`echo $f | cut -f 4 -d "/" | cut -f 1 -d "."` OUTPUT_FILE="./mp4Files/${OUTPUT_FILE}.mp4" echo "Outputfile $OUTPUT_FILE" ffmpeg -i $f -sameq -vcodec libx264 -acodec libfaac $OUTPUT_FILE done |
Now I have prepared my data, and is ready to do the editing. For this I use kdenlive.