Single-pass MPEG-2 (near lossless)

Allow FFmpeg to automatically set DVD standardized parameters. Encode to DVD MPEG-2 at a frame rate of 30 frames/second:

ffmpeg -i 13.Assassins.VOB -target ntsc-dvd -sameq 13.Assassins.mpg

Encode to DVD MPEG-2 at a frame rate of 24 frames/second:

ffmpeg -i 13.Assassins.VOB -target film-dvd -sameq 13.Assassins.mpg

x264: Constant Rate Factor

Used when you want a specific quality output. General usage is to use the highest -crf value that still provides an acceptable quality. A sane range is 18-28 and 23 is default. 18 is considered to be visually lossless. Use the slowest -preset you have patience for. See the x264 Encoding Guide for more information.

For more information see the forums. You can also create a custom alias ytconvert which takes the name of the input file as first argument and the name of the .mkv container as second argument. To do so add the following to your ~/.bashrc:

Softsubs to hardsubs

If have a softsubbed video (eg. ASS/SSA subs in a mkv container like most anime) you can 'burn' these subs into a new file to be played on a device which does not support subs or is to weak to display complex subs.

Install mkvtoolnix-cli to pull out *.ass files from *.mkv files.

Recompile ffmpeg with --enable-libass if it is not already enabled in your ffmpeg build. See ABS for easy recompiling.

Pull out subs from your file. This command assumes that track #2 is the ASS/SSA track. Use mkvinfo if it is not.

mkvextract tracks YourFile.mkv 2:YourFile.ass

Recode file with ffmpeg. See sections above for suitable options. It is very important to disable sub-recording -sn and enable sub-rendering -vf ass=YourFile.ass

Output is set as *.mp4 since the default Android 4.2 player dislikes *.mkv. (But VLC on Android works with mkv). Example: