Compile FFmpeg on Debian, Ubuntu or Mint

This guide for supported releases of Debian, Ubuntu,  and Linux Mint will provide a local install of the latest FFmpeg tools and libraries including several external encoding and decoding libraries (codecs). This will not interfere with repository packages.

You may also refer to the Generic FFmpeg Compilation Guide for additional information.

Recent static builds are also available for lazy people or those who are unable to compile. The static builds do not support non-free encoders.

Note: FFmpeg has returned in Ubuntu 15.04 Vivid Vervet. You may still wish to compile if you experience a bug or want to customize your build, and it will not interfere with the ffmpeg package in the repository.

Get the Dependencies

Copy and paste the whole code box for each step. First install the dependencies:

sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev

Note: Server users can omit the ffplay and x11grab dependencies: libsdl1.2-dev libva-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev. And use this line:

aptitude -y install autoconf automake build-essential libass-dev libfreetype6-dev libtheora-dev libtool libvorbis-dev pkg-config texinfo zlib1g-dev cmake mercurial nasm

Now make a directory for the source files that will be downloaded later in this guide:

mkdir ~/ffmpeg_sources

Compilation & Installation

You can compile ffmpeg to your liking. If you do not require certain encoders you may skip the relevant section and then remove the appropriate ./configure option in FFmpeg. For example, if libopus is not needed, then skip that section and then remove –enable-libopus from the Install FFmpeg section.

This guide is designed to be non-intrusive and will create several directories in your home directory:

  • ffmpeg_sources – Where the source files will be downloaded.
  • ffmpeg_build – Where the files will be built and libraries installed.
  • bin – Where the resulting binaries (ffmpeg, ffplay, ffserver, x264, and yasm) will be installed.

You can easily undo any of this as shown in Reverting Changes Made by This Guide.

Yasm

An assembler for x86 optimizations used by x264 and FFmpeg. Highly recommended or your resulting build may be very slow.

If your repository offers a yasm package = 1.2.0 then you can install that instead of compiling:

sudo apt-get install yasm

Otherwise you can compile:

cd ~/ffmpeg_sources
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="/usr/bin"
make
make install
make distclean

One line copy paste:
cd ~/ffmpeg_sources && wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && tar xzvf yasm-1.3.0.tar.gz && cd yasm-1.3.0 && ./configure --prefix="$HOME/ffmpeg_build" --bindir="/usr/bin" && make && make install && make distclean

libx264

H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with --enable-gpl --enable-libx264.

If your repository offers a libx264-dev package = 0.118 then you can install that instead of compiling:

sudo apt-get install libx264-dev

Otherwise you can compile:

cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="/usr/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="/usr/bin" --enable-static
PATH="/usr/bin:$PATH" make
make install
make distclean

One line copy paste:
cd ~/ffmpeg_sources && wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 && tar xjvf last_x264.tar.bz2 && cd x264-snapshot* && PATH="/usr/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="/usr/bin" --enable-static && PATH="/usr/bin:$PATH" make && make install && make distclean

libx265

H.265/HEVC video encoder. See the H.265 Encoding Guide for more information and usage examples.

sudo apt-get install cmake mercurial
cd ~/ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
PATH="/usr/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install
make distclean

One line copy paste:
cd ~/ffmpeg_sources && hg clone https://bitbucket.org/multicoreware/x265 && cd ~/ffmpeg_sources/x265/build/linux && PATH="/usr/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source && make && make install && make distclean

libfdk-aac

AAC audio encoder. See the AAC Audio Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with --enable-libfdk-aac (and --enable-nonfree if you also included --enable-gpl).

cd ~/ffmpeg_sources
wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master
tar xzvf fdk-aac.tar.gz
cd mstorsjo-fdk-aac*
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

One line copy paste:
cd ~/ffmpeg_sources && wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master && tar xzvf fdk-aac.tar.gz && cd mstorsjo-fdk-aac* && autoreconf -fiv && ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && make && make install && make distclean

libmp3lame

MP3 audio encoder.

Requires ffmpeg to be configured with --enable-libmp3lame.

If your repository offers a libmp3lame-dev package = 3.98.3 then you can install that instead of compiling:

sudo apt-get install libmp3lame-dev

Otherwise you can compile:

sudo apt-get install nasm
cd ~/ffmpeg_sources
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared
make
make install
make distclean

One line copy paste:
cd ~/ffmpeg_sources && wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz && tar xzvf lame-3.99.5.tar.gz && cd lame-3.99.5 && ./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared && make && make install && make distclean

libopus

Opus audio decoder and encoder.

Requires ffmpeg to be configured with --enable-libopus.

If your repository offers a libopus-dev package = 1.1 then you can install that instead of compiling:

sudo apt-get install libopus-dev

Otherwise you can compile:

cd ~/ffmpeg_sources
wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar xzvf opus-1.1.tar.gz
cd opus-1.1
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make clean

One line copy paste:
cd ~/ffmpeg_sources && wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz && tar xzvf opus-1.1.tar.gz && cd opus-1.1 && ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && make && make install && make clean

libvpx

VP8/VP9 video encoder and decoder. See the VP8 Video Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with --enable-libvpx.

cd ~/ffmpeg_sources
wget http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2
tar xjvf libvpx-1.5.0.tar.bz2
cd libvpx-1.5.0
PATH="/usr/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests
PATH="/usr/bin:$PATH" make
make install
make clean

One line copy paste:
cd ~/ffmpeg_sources && wget http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2 && tar xjvf libvpx-1.5.0.tar.bz2 && cd libvpx-1.5.0 && PATH="/usr/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests && PATH="/usr/bin:$PATH" make && make install && make clean

ffmpeg

cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="/usr/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="/usr/bin" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
PATH="/usr/bin:$PATH" make
make install
make distclean
hash -r

One line copy paste:
cd ~/ffmpeg_sources && wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && tar xjvf ffmpeg-snapshot.tar.bz2 && cd ffmpeg && PATH="/usr/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="/usr/bin" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree && PATH="/usr/bin:$PATH" make && make install && make distclean && hash -r && source ~/.profile

Conclusion

Installation is now complete and ffmpeg is now ready for use. Your newly compiled FFmpeg programs are in /usr/bin.
Usage

There are several methods to use your new ffmpeg.

Navigate to /usr/bin and execute the binary: cd /usr/bin && ./ffmpeg -i ~/input.mp4 ~/videos/output.mkv (notice the ./)
Or use the full path to the binary: /usr/bin/ffmpeg -i ../input.mp4 ../videos/output.mkv

If you want the ffmpeg command to just work from anywhere:

Log in and log out
Or run source ~/.profile (Already added to the FFMPEG one line copy paste)

Note: ~/bin is included in the standard Ubuntu $PATH by default (via the ~/.profile file), but only when the ~/bin directory actually exists. This is why you must log out then log in or run source ~/.profile if you just created ~/bin. See Ubuntu Wiki: Persistent Environment Variables for more info.

Documentation

If you want to run man ffmpeg to have local access to the documentation:

echo "MANPATH_MAP /usr/bin $HOME/ffmpeg_build/share/man" >> ~/.manpath

You may then have to log out and then log in for man ffmpeg to work.

HTML formatted documentation is available in ~/ffmpeg_build/share/doc/ffmpeg.

You can also refer to the online FFmpeg documentation, but remember that it is regenerated daily and is meant to be used with the most current ffmpeg (meaning an old build may not be compatible with the online docs).

Additional Notes

  • See the H.264 Encoding Guide for some encoding examples.
  • If you do not see FFmpeg developers in your ffmpeg console output then something went wrong and you’re probably using the fake “ffmpeg” from the repository (the counterfeit “ffmpeg” was eventually removed and the real ffmpeg returned in 15.04).
  • You can delete the ffmpeg_sources directory if you want to.

Updating FFmpeg

Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First you need to delete (or move) the old files:

rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffplay,ffserver,vsyasm,x264,x265,yasm,ytasm}

Now just follow the guide from the beginning.

Reverting Changes Made by This Guide

rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffplay,ffserver,vsyasm,x264,x265,yasm,ytasm}
sudo apt-get autoremove autoconf automake build-essential cmake libass-dev libfreetype6-dev libmp3lame-dev libopus-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libvpx-dev libx264-dev libxcb1-dev libxcb-shm0-dev ibxcb-xfixes0-dev mercurial texinfo zlib1g-dev
sed -i '/ffmpeg_build/c\' ~/.manpath
hash -r

Posted on

Simcity cheats codes

While playing the game in Sandbox mode, enter one of the following codes to activate the corresponding cheat function:

Result Cheat Code
Add 100,000 Simoleons to city budget [Alt] + W
Increase budget by $5,000 per hour [Ctrl] + [Alt] + W
Toggle Air Pollution [Alt] + A
Toggle Crime [Alt] + C
Toggle Fire [Alt] + F
Toggle Garbage [Alt] + G
Toggle Ground Pollution [Alt] + P
Toggle Health Issues [Alt] + M
Toggle Homeless Sims [Alt] + H
Toggle Sewage [Alt] + S

Infinite water

If you place a water pump (using filtration pumps) directly next to a sewage treatment plant, it allows for unlimited water. The sewage treatment plant adds back into the ground water table at that spot. The filtration pumps ensure your water will not get polluted from the ground pollution that occurs. When using this trick, you can pick one of the four clustered cities in your tradable region to keep using the trick repeatedly. This will provide a massive amount of water that can be purchased. You can then buy from that massive source while building the other three cities. This will save you the need to place a water source and sewage treatment plant. This can be done for any utility/service.

Disasters

Successfully complete the indicated task to unlock the corresponding disaster:

    Big Lizard: Burn 100 tons of garbage in an Incinerator at the Garbage Dump.Earthquake: Mine 100 tons of coal or raw ore in your city.Meteor Strike: Have 200 tourists arrive on flights at the Municipal Airport in a day.Tornado: Have 24 Wind Turbines at Wind Power Plants.UFO Encounter: Ship any resource to a Space Center Great Work.Zombie Attack: Add a Diagnostic Lab to a Hospital, and have 15 Sims die in a day.

Achievements

Successfully complete the indicated task to unlock the corresponding achievement:

City Management

    Sand Through My Fingers: Have total expenses of $15,000+ per month.Money Cube: Have a total income of $15,000+ per hour.Good Credit: Pay off $1,000,000 in bond debt.Multi-Millionare City: Have $10,000,000 in your treasury.Busy Downtown: Have at least 100 Commercial buildings in your city.Big Government: Place one of each of the City Hall departments on a single City Hall.Quid Pro Quo: Place one of each of all the modules on a single Mayor’s Mansion.Industrial Revolution: Have 100 Industrial buildings in your city.Suburb City: Have 10,000 residents living in your city.Population Boom: Have 50,000 residents living in your city.Metropolis!: Have 100,000 residents living in your city.Jumbo Region!: Have 500,000 residents living in a regionMega-Region!: Have 1,000,000 residents living in a region.Suburbitopia: Have 500 Residential buildings in your city.My Favorite Mayor: Have 24 hours of a 75% or better Approval Rating.’Worst. Mayor. Ever.: Hold an Approval Rating of below 50% for 24 hours.Best Mayor Ever!: Have an Approval Rating of 95% or more.

City Services

    Reolving Doors: Have 25 criminals released from jail cells in one day due to overcrowding.Bad Move, Creeps: Have your Police capture their first criminal.Redemption of the Sims: Rehabilitate 50 criminals in a day!SimCity University!: Have a University with each School module.No Child Left Behind: Plop 20 School Bus Stops in one city.High Tech Fire Fightin’: Add the HazMat Garage, the Fire Helipad, and the Fire Marshal Office to a Large Fire Station in your city.You’re on Fire!: Extinguish 1 HazMat fires in your city in a day!Only You Can Prevent City Fires: Put out more than 10 fires in a day.Green Plumbobs: Pick up 10 tons of recyclables in your city in a day!Dump City!: Have 560 tons of garbage in your Garbage Dumps!Garbage Man!: Pick up 10 tons of garbage in a day!Medical Miracle: Plop a Hospital and treat 200 sick Sims in a day.EMT ASAP: Pick up and treat 50 injured Sims in one day.All-Powerful Region: Place of each type of power source in a region (Coal, Oil, Wind, Solar and Nuclear).Super-Powered: Have a city that consumes over 300 mW of power per hour.Ick or Treat!: Treat 200 kgal/hr of sewage at a Sewage Treatment Plant.Sewage Stuffing: With 10,000 or more residents, prevent sewage issues using only Sewage Outlet Pipes.Main Attraction: Have 300 low wealth tourists leave your city satisfied in one day.Sunday! Sunday! Sunday!: Run a successful stadium event in your city.Cruisin’ Along: Have 2,000 Sims take a cruise in a day.A Streetcar Named SimCity: Have 1,000 Sims travel by streetcar in a day.All Aboard: Have 1,000 Sims take the train in a day.Sludge-Free H-2-0!: Pump 50 kgal of fresh, clean water in an hour.Aqua Max: Have a city that has over 100 kgal of water needed per hour.

City Specialization

    You Mean Business!: Plop every City Specialization HQ in the game.King Coal: Extract a total of 100 tons of coal.Electrical Magic: Assemble 4,000 crates of processors in a day.Sin City: Place one of each type of Casino in a single city.Penny Slots: Generate $200,000 in total revenue from casinos.Blast Furnace: Smelt a total of 100 tons of metal.All Oiled Up: Pump 10,000 barrels of crude oil in a day.Refined Tastes: Refine 40 barrels of fuel and 40 crates of plastic in a single city in one hour.To Be Ore Not To Be: Extract a total of 100 tons of raw ore.A Lot of Lots: Place 6 unique Storage Lot types on any Trade Depot or Trade Port.Trading Empire: Ship 250,000 Global Market export shipments.Moving Pictures: Assemble 100 crates of TVs in one day in a single city.Specialist First Class: Select “Guide Me” for any city specialization.

RCI

    The Big (Insert Fruit Here): Have 50 high density, low wealth commercial buildings in your city.Technophile: Have 40 high density, high tech industrial buildings in your city!Skyscraper Magnet: Have 10 high density, high wealth commercial buildings!Billionarie’s Playground: Have 10 high density, high wealth residential buildings in your city!Elite Estates: Have 50 low density, high wealth residential buildings in your city.Office Parks: Have 50 low density, high wealth commercial buildings in your city.Apartment Rows: Have 50 high density, low wealth residential buildings in your city.

Region

    Llamahound: Have a municipal bus from a neighbor make 100 trips into your city within a year.Godfather: Have 50 crimes in one month in a region of 5,000+ residents.Extraditions: Have your police capture 50 criminals in neighbors’ cities.A Burning Region of Fire: Have 50 fires extinguished in your region in a day.Time to Relocate: Have 200+ garbage issues at once in a region.Team Mayor: Grant approvals for 10 buildings for the region.The Philanthropist: Gift $200,000 or more to a neighbor.Make Sure You’re Grounded…: Provide both power and water to a neighbor, at the same time.

Secret

    Bronze Anniversary: Play a city for 10 years.Silver Anniversary: Play a city for 25 years.Golden Anniversary: Play a city for 50 years! Take a break!Dug Too Greedily and Too Deep: Mine 100 tons of coal and metal to gain access to the Earthquake disaster.What Goes Up Must Come Down: Have 200 tourists in day arrived in your city by air to gain access to the Meteorite Crash disaster.Laboratory Outbreak: Add a Diagnostic Lab to a Hospital and have 15 Sims die in a day to gain access to the Zombie Attack disaster.What’s Cookin’?: Burn 100 tons of garbage in an Incinerator at the Garbage Dump to gain access to the Big Lizard disaster.We Are Not Alone: Ship any resource to a Space Center Great Work to gain access to the UFO Encounter disaster.Blowin’ in the Wind: Have 24 Wind Turbines at Wind Power Plants in your city to gain access to the Tornado disaster.2 Kilometer Island!: Have Nuclear Power Plant melted down.Mayor Yuck: Have 500 Sims complain about dirty water in a day.

City Nationalities

British City Set

    UK Character: Have 1,000 Sims picked up by double-decker buses from the Double-Decker Buss Terminal.

French City Set

    French Authority: Lock up 10 criminals at the French Police Station.

German City Set

    German Efficiency: Have 5,000 Sims take trips on trains from the German High-Speed Rail Station.

Posted on

Force deleting a obsolete printer in windows

Take a look at this tutorial which explains how to use the Microsoft Management Console (MMC), to remove unwanted printer driver packages.

If that does not work for you, try using the printui.exe tool.

In an admin elevated command prompt type printui /s /t2, be sure to remove the driver AND the package.

Here’s how to do it, step-by-step:

  1. Open a command line with administrative rights: Start->All Programs->Accessories->Command prompt; Right click -> Run As Administrator
  2. Run the printui tool: printui /s /t2
  3. Try deleting the printers. If that doesn’t work… (i.e., if removing the printers listed in the printui is not successful.)
  4. Click Start > Run > Services.msc
  5. Locate the Print Spooler service, and right-click > Properties > stop service.
  6. Open My Computer and browse to C:\Windows\System32\spool\Printers (you will need to click “OK” to get access to the folder).
  7. DELETE the contents of the folder you opened in step 7.
  8. Go back to services.msc and Restart the Print Spooler service.
  9. Go back into the printui utility (you might need to restart it using same method as above) and try removing printers again. This time it should work. If necessary, check the “Ports” tab and remove any TCP/IP ports that are associated with the old printer.
  10. Last but not least, check other computers on your home network to see if any of those map to the old printer, and remove these mappings

Posted on

HOWTO Change Default crontab editor in linux

I was working on some sysadmin tasks on a freshly installed server, and I found out the crontab editor was not what I expected it to be. I really like nano for command line editing, so I wanted ‘crontab -e’ to use nano instead of something else like vi (vim). To make that happen, I put this into my bashrc file (location: ~/.bashrc):

export VISUAL=nano

I keep forgetting this, so I decided to blog it. Don’t forget to reload the bashrc by doing this:

source ~/.bashrc And nano will be at your service!

Posted on