Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

55 lines (54 sloc) 3.778 kb
---
ffmpeg: "# Getting infos from a video file\n\n ffmpeg -i video.avi\n\n\
# Turn X images to a video sequence\n\n ffmpeg -f image2 -i image%d.jpg video.mpg\n\n\
This command will transform all the images from the current directory (named image1.jpg, image2.jpg, etc\xE2\x80\xA6) to a video file named video.mpg.\n\n\
# Turn a video to X images\n\n ffmpeg -i video.mpg image%d.jpg\n\n\
This command will generate the files named image1.jpg, image2.jpg, \xE2\x80\xA6\n\n\
The following image formats are also availables : PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI.\n\n\
# Encode a video sequence for the iPod/iPhone\n\n 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 320x180 -title X final_video.mp4\n\n\
Explanations:\n\n\
* Source: source_video.avi\n\
* Audio codec: aac\n\
* Audio bitrate: 128kb/s\n\
* Video codec: mpeg4\n\
* Video bitrate: 1200kb/s\n\
* Video size: 320px by 180px\n\
* Generated video: final_video.mp4\n\n\
# Encode video for the PSP\n\n ffmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4\n\n\
Explanations:\n\n\
* Source: source_video.avi\n\
* Audio codec: aac\n\
* Audio bitrate: 32kb/s\n\
* Video codec: xvid\n\
* Video bitrate: 1200kb/s\n\
* Video size: 320px by 180px\n\
* Generated video: final_video.mp4\n\n\
# Extracting sound from a video, and save it as Mp3\n\n ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3\n\n\
Explanations:\n\n\
* Source video: source_video.avi\n\
* Audio bitrate: 192kb/s\n\
* Output format: mp3\n\
* Generated sound: sound.mp3\n\n\
# Convert a wav file to Mp3\n\n ffmpeg -i son_origine.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3\n\n\
# Convert .avi video to .mpg\n\n ffmpeg -i video_origine.avi video_finale.mpg\n\n\
# Convert .mpg to .avi\n\n ffmpeg -i video_origine.mpg video_finale.avi\n\n\
# Convert .avi to animated gif(uncompressed)\n\n ffmpeg -i video_origine.avi gif_anime.gif\n\n\
# Mix a video with a sound file\n\n ffmpeg -i son.wav -i video_origine.avi video_finale.mpg\n\n\
# Convert .avi to .flv\n\n ffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flv\n\n\
# Convert .avi to dv\n\n ffmpeg -i video_origine.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_finale.dv\n\n\
Or:\n\n ffmpeg -i video_origine.avi -target pal-dv video_finale.dv\n\n\
# Convert .avi to mpeg for dvd players\n\n ffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 finale_video.mpeg\n\n\
Explanations:\n\n\
* target pal-dvd: Output format\n\
* ps 2000000000 maximum size for the output file, in bits (here, 2 Gb)\n\
* aspect 16:9 : Widescreen\n\n\
# Compress .avi to divx\n\n ffmpeg -i video_origine.avi -s 320x240 -vcodec msmpeg4v2 video_finale.avi\n\n\
# Compress Ogg Theora to Mpeg dvd\n\n ffmpeg -i film_sortie_cinelerra.ogm -s 720x576 -vcodec mpeg2video -acodec mp3 film_termin\xC3\xA9e.mpg\n\n\
# Compress .avi to SVCD mpeg2\n\n\
NTSC format:\n\n ffmpeg -i video_origine.avi -target ntsc-svcd video_finale.mpg\n\n\
PAL format:\n\n ffmpeg -i video_origine.avi -target pal-svcd video_finale.mpg\n\n\
# Compress .avi to VCD mpeg2\n\n\
NTSC format:\n\n ffmpeg -i video_origine.avi -target ntsc-vcd video_finale.mpg\n\n\
PAL format:\n\n ffmpeg -i video_origine.avi -target pal-vcd video_finale.mpg\n\n\
# Multi-pass encoding with ffmpeg\n\n ffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2\n\n\
# Convert file to Matroska container without re-encoding\n\n ffmpeg -i input_file.wmv -vcodec copy -sameq -acodec copy -f matroska output_file.mkv"
Jump to Line
Something went wrong with that request. Please try again.