My personal all-around blog
My personal all-around blog

Converting MiniDV, addendum

Hi guys, I have to add this info to the subject of my previous post for completion purposes.

I tried to use ffmpeg in a script and compare the results with my Handbrake method.

To find the parameters to pass to ffmpg, so I could use the libx264 codec as I wanted, I used the info from here. Ffmpeg’s -help option was very useful too. The script with the settings I used is below:

#!/bin/bash

for FIL in `ls *dv | sort` ; do
   ffmpeg -hwaccel auto -i "$FIL" -c:v libx264 -profile:v main -preset medium -crf 20 -c:a ac3 -b:a 160k /run/media/theo/INTENSO/dvgrab/test_ffmpeg/${FIL%.*}.mp4
done

These settings represent what I had set Handbrake to do with my files by a large percentage. In short: x264 codec with ‘main’ profile for compatibility with my player, medium fast preset, constant quality of RF20, and AC3 audio codec with a bitrate of 160kbps. My verdict is that while ffmpeg is 10% faster with these settings it lacks the ‘decomb’ filter that I use in Handbrake, and I couldn’t find a replacement at first. So the final result was visibly interlaced. I mean it showed a slight horizontal miss-mach between scan lines.

The filesize was quite larger too.

I was not happy and I looked for a way to de-interlace the input file with another filter. I found the answer in video.stackexchange. The filter I was looking for was ‘yadif’ Yet Another De-Interlacing Filter. It just worked perfect without further parameter tweaking.

Now my final script was:

#!/bin/bash

for FIL in `ls *dv | sort` ; do
  ffmpeg -hwaccel auto -i "$FIL" -vf yadif -c:v libx264 -profile:v main -preset medium -crf 20 -c:a ac3 -b:a 160k /run/media/theo/INTENSO/dvgrab/test_ffmpeg/${FIL%.*}.mp4
done

Now ffmpeg was 20% faster and the filesize was 4% smaller! Just adding de-interlacing filter! How cool was that? No visible artifacts from the de-interlacing process, pure progressive video. The quality was very similar to the one which Handbrake produced. The contrast was a bit higher though, only a little, but in some dark scenes it seemed to lose information.

I think I gave you enough to choose for yourselves your own favorite method. If you have a lot of files to process with the same settings, as in my case, I think ffmpeg wins. The convenience (although not being so intuitive to use) of adjusting the output exactly as you wish with ‘Handbrake’ without reading help pages, even for a batch of files, wins on more cases, I guess…

I have to say that there is probably more digging to do if one wishes, a lot of options and parameters to explore, but I had a rather good result and I stopped there. You are free to go further down if you feel adventurous, give us a line if you do. Wish you my best.

Have fun, people!

Leave a comment

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

Spam repellent: * Time limit is exhausted. Please reload CAPTCHA.