I am using avconv/ffmpeg to convert VOB files copied from a DVD to mp4. The command I'm using is
avconv -i "concat:1.VOB|2.VOB|3.VOB|4.VOB|5.VOB" -c:v libx264 -crf 28 -c:a libvo_aacenc -b:a 128k output.mp4
This is working, but I've seen many different commands using different kinds of arguments, and I'm wondering if this is the "right" way to do it, and if someone has suggestions about which arguments I should (not) use and why (not). The file should be compatible with mobile devices and smart TV's. I've also seen "libmp3lame" being used as audio codec, is it better to use AAC or MP3?
The file size is 732.6MB for a video lasting 00:58:37, is this reasonable? Maybe I can use something to reduce the filesize further without too much quality loss?
I'm also confused about the difference between Avconv and FFmpeg. I thought that FFmpeg is deprecated and Avconv is "newer and better", I have two installations of Linux Mint, when I run "avconv --help" on a 17.1 installations I see
avconv version 9.20-6:9.20-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
And when I run the same command on a 18.1 installation I see
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
Is avconv newer than ffmpeg or is it just a different name for the same thing?
VOB files can be strange beasts, so to concatenate VOB with ffmpeg
it is often recommended to use the dvd2concat
tool included in the FFmpeg source code. However, it's not available in the repository, but you can just download it. Also, the 2.8 release branch is old, so upgrade your ffmpeg
too. Here's how:
sudo apt install lsdvd
mkdir ~/bin
cd ~/bin
wget https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/tools/dvd2concat
chmod +x dvd2concat
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
tar xvf ffmpeg-git-64bit-static.tar.xz
mv ffmpeg-git*/ff* .
source ~/.profile
If you ever want to undo any of this:
sudo apt remove lsdvd
rm -rf ~/bin/ff*
hash -r
Now run the encoding commands:
dvd2concat /path/to/vob/files dvd.concat
ffmpeg -f concat -safe 0 -protocol_whitelist "file,subfile" -i dvd.concat -vf format=yadif,yuv420p -c:v libx264 -crf 28 -c:a aac -b:a 128k -movflags +faststart -metadata title="Movie Title" output.mp4
Note the console output from dvd2concat
/lsdvd
is not that informative, so check to see that it actually created dvd.concat
. This is a text file that ffmpeg
will use to refer to the input VOB files.
The file should be compatible with mobile devices and smart TV's.
Adding the -profile:v main
output option will help with compatibility for older devices. If your hardware is fairly modern you can omit -profile:v
to allow x264 to automatically choose the profile.
See FFmpeg Wiki: H.264 for more info.
I've also seen "libmp3lame" being used as audio codec, is it better to use AAC or MP3?
AAC. I've seen a few players have issues with certain MP4 files containing MP3 audio.
See FFmpeg Wiki: AAC for encoding suggestions.
The file size is 732.6MB for a video lasting 00:58:37, is this reasonable?
It is not possible to guess the output file size when using -crf
. File size will depend on the encoding complexity of the input, the duration, and the encoding options used.
Maybe I can use something to reduce the filesize further without too much quality loss?
Increase the -crf
value for a lower quality and therefore a smaller file size. If you must target a specific output file size use two-pass encoding. Otherwise, just stick with single-pass using -crf
like 99% of us usually do. See FFmpeg Wiki: H.264 for more info.
I'm also confused about the difference between Avconv and FFmpeg. I thought that FFmpeg is deprecated and Avconv is "newer and better". Is avconv newer than ffmpeg or is it just a different name for the same thing?
The FFmpeg project, nor it's ffmpeg
command-line tool, were ever deprecated. That message was from the Libav fork referring to their own short-lived, fake "ffmpeg
" tool. Libav didn't differentiate between FFmpeg/real ffmpeg
and their fake "ffmpeg
" which was understandably confusing to general users. For more info see: