Convert video files

From Ever changing code
Revision as of 14:59, 28 December 2014 by Pio2pio (talk | contribs) (→‎Winff)
Jump to navigation Jump to search

ffmpeg

The most basic way to use ffmpeg is to use -i yourinputfilename.ext folowed by outputfilename.ext.

That's it. This is, seriously, all you need do remember when it comes to the most basic (ab)use cases:

ffmpeg -i YourAwesomeMovie.dv YourAwesomeMovie.mp4

This basic example will make ffmpeg detect the input file type. The built-in input detection does work perfectly in 99% of all cases.

This basic example will also make ffmpeg assume what audio and video formats you want for your output file based on the file extension. We asked to output the filename YourAwesomeMovie.mp4. It ends with .mp4.

The .mp4 extension will make ffmpeg assume that you want a file with H.264/AVC video and AAC 2.0 audio. This happens to be the correct values for HTML5 web video in the very (as in extremely) evil proprietary HTML5 video format alternative. Moving on to more advanced encoding

The secret ffmpeg manual page is very long. It contains lots of detailed information about the numerous options available when using this tool. Whole books can be, and probably have been, written about the advanced options listed in the manual page.

Things you may want to tune when encoding include:

  • r to change the frame rate
  • b:v to set the video bitrate
  • b:a to set the audio bitrate

These options can have a huge impact on the quality and the file-size of the resulting file.

A general rule is: You can have low file-size OR high picture quality, but you can NOT have both. You will have to compromise.

This may give you an acceptable quality video file, depending on resolution:

ffmpeg -i YourAwesomeMovie.dv -r 25 -b:a 128k -b:v 4000k YourAwesomeMovie.mp4

..and this will NOT, because 256k is not enough bandwidth for acceptable quality even at small resolutions:

ffmpeg -i YourAwesomeMovie.dv -r 25 -b:a 64k -b:v 256k YourAwesomeMovie.mp4

Winff

Winff is GUI to ffmpeg that you can use to grab a cli command to be reused in text only environment.

Install

If you use the winff repository you need to accept the key AAFE086A

wget --quiet --output-document=- "http://winff.org/ubuntu/AAFE086A.gpg" | sudo apt-key add -

After that you need to add the repository to apt. You can do that by entering the line in /etc/apt/sources.list.d/winff.list. You will have to create that file, which can be done with the following command:

echo "deb http://winff.org/ubuntu lucid universe" | sudo tee /etc/apt/sources.list.d/winff.list

You can also just add the line to /etc/apt/sources.list .

You can install WinFF directly now by running:

sudo apt-get update && sudo apt-get install winff

If you don't run the standard ffmpeg and want to make use of the more extended original set of presets, which you can download in the download section.

In order to use the preset file supplied with the package you might need to remove the old preset file in ~/.winff/presets.xml , but by doing that you will also remove self-made presets. So if you made or edited the presets, you want to compare the files manually.

Troubleshooting
cat /etc/apt/sources.list.d/winff.list

References