Skip to main content

ffmpeg Linux commands

· 3 min read

Getting infos from a video file

ffmpeg -i video.avi

Turn X images to a video sequence

ffmpeg -f image2 -i image%d.jpg video.mpg

This command will transform all the images from the current directory (named

image1.jpg, image2.jpg, etc…) to a video file named video.mpg.

Turn a video to X images

ffmpeg -i video.mpg image%d.jpg

This command will generate the files named image1.jpg, image2.jpg, …

The following image formats are also availables : PGM, PPM, PAM, PGMYUV, JPEG,

GIF, PNG, TIFF, SGI.

Encode a video sequence for the iPod/iPhone

ffmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb

-mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320×180 -title X

final_video.mp4

Explanations:

* Source: source_video.avi

* Audio codec: aac

* Audio bitrate: 128kb/s

* Video codec: mpeg4

* Video bitrate: 1200kb/s

* Video size: 320px by 180px

* Generated video: final_video.mp4

Encode video for the PSP

ffmpeg -i source_video.avi -b 300 -s 320×240 -vcodec xvid -ab 32 -ar 24000

-acodec aac final_video.mp4

Explanations:

* Source: source_video.avi

* Audio codec: aac

* Audio bitrate: 32kb/s

* Video codec: xvid

* Video bitrate: 1200kb/s

* Video size: 320px by 180px

* Generated video: final_video.mp4

Extracting sound from a video, and save it as Mp3

ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3

Explanations:

* Source video: source_video.avi

* Audio bitrate: 192kb/s

* Output format: mp3

* Generated sound: sound.mp3

Convert a wav file to Mp3

ffmpeg -i son_origine.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3

Convert .avi video to .mpg

ffmpeg -i video_origine.avi video_finale.mpg

Convert .mpg to .avi

ffmpeg -i video_origine.mpg video_finale.avi

Convert .avi to animated gif(uncompressed)

ffmpeg -i video_origine.avi gif_anime.gif

Mix a video with a sound file

ffmpeg -i son.wav -i video_origine.avi video_finale.mpg

Convert .avi to .flv

ffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320×240 -f flv

video_finale.flv

Convert .avi to dv

ffmpeg -i video_origine.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2

video_finale.dv

or

ffmpeg -i video_origine.avi -target pal-dv video_finale.dv

Convert .avi to mpeg for dvd players

ffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9

finale_video.mpeg

Explanations:

* target pal-dvd: Output format

* ps 2000000000 maximum size for the output file, in bits (here, 2 Gb)

* aspect 16:9 : Widescreen

Compress .avi to divx

ffmpeg -i video_origine.avi -s 320×240 -vcodec msmpeg4v2 video_finale.avi

Compress Ogg Theora to Mpeg dvd

ffmpeg -i film_sortie_cinelerra.ogm -s 720×576 -vcodec mpeg2video -acodec mp3

film_terminée.mpg

Compress .avi to SVCD mpeg2

NTSC format:

ffmpeg -i video_origine.avi -target ntsc-svcd video_finale.mpg

PAL format:

ffmpeg -i video_origine.avi -target pal-svcd video_finale.mpg

Compress .avi to VCD mpeg2

Convert file to Matroska container without re-encoding

ffmpeg -i input_file.wmv -vcodec copy -sameq -acodec copy -f matroska

output_file.mkv

NTSC format:

ffmpeg -i video_origine.avi -target ntsc-vcd video_finale.mpg

PAL format:

ffmpeg -i video_origine.avi -target pal-vcd video_finale.mpg

** Multi-pass encoding with ffmpeg**

ffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2

 

Faulting application name: SimCitySocieties.exe

· One min read

Getting the “Faulting application name: SimCitySocieties.exe, version: 1.0.4.243” and cannot play your game? Try the fix below.

Usually caused by the Tradmark characters in a folder name “™” which Windows does not support.

  1. Uninstall SimCity Societies
  2. Reinstall the game and make sure the install path is C:Program FilesElectronic ArtsSimCity Societies

Note: If the above does not work, then you need to edit the registry to change the games install path: “Install Dir” in HKEY_LOCAL_MACHINESOFTWAREElectronic ArtsSimCity Societies”

 

Enable Javascript in Internet Explorer

· One min read
Problems running Javascript and want to enable it? This is how you do it.
  1. Open Internet **Explorer **
  2. Click on the “Tools” menu.
  3. Click Internet Options
  4. Click “Security” tab at the top
  5. Click on “Custom Level,” then click on the “Enable Active Scripting” option.
  6. Click “OK”

Eliminate period after each word in letter

· One min read

Getting a period after each word in Microsoft Office? That is due to formatting marks, being enabled. To disable them follow the instructions below:

  1. Open Word
  2. Click Tools
  3. Click Options
  4. View and untick the SPACES box
  5. Click ok

Increase Internet Explorers Download Limit

· One min read

Internet Explorer limits the amount of concurrent downloads. This is how you increase it

  1.  Click Start
  2. Click Run
  3. Type in “notepad” and press enter
  4. Copy the following and paste the HKey Local machine code underneath these instructions.
  5. Save the document as “IEDownloads.reg
  6. Go to where you saved the document and double click it to merge it into the registry. If a confirmation prompt appears then accept it.
  7. Restart the computer and you should be able to download more then 8 files at a time.

 

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMAINFeatureControlFEATURE_MAXCONNECTIONSPERSERVER]

“iexplore.exe”=dword:0000000a