FFmpeg is a complete solution for record, convert and stream audio and video in Linux.
FFmpeg is OpenSource multimedia framework which has ability to decode, encode, transcode, mux, demux, stream, filter, and more of audio / video file. FFmpeg almost supports most audio/video format that currently exist, FFmpeg contains libavcodec, libavutil, libavformat, libavdevice, libswscale and libswresample and can be used by applications (3rd party application).
Getting Information of video/audio file
- ffmpeg -i video.avi
- ffmpeg -i input_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 output_video.mp4
- ffmpeg -i input_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac output_video.mp4
you can change the value of parameters given or change source file format (mpeg, flv, others), here some explanations for two command above.
Source : input_video.avi
Audio codec : aac
Audio bitrate : 128kb/s
Video codec : mpeg4
Video bitrate : 1200kb/s
Video size : 320px par 180px
Generated video : output_video.mp4
Extracting Video to Mp3
- ffmpeg -i input.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 output.mp3
- ffmpeg -i input_video.avi output_video.mpg
- ffmpeg -i input_video.avi output_gif.gif
- ffmpeg -i sound.wav -i input_video.avi output_video.mpg
- ffmpeg -i input_video.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv output_video.flv
- ffmpeg -i input_video.flv output_video.avi
- ffmpeg -i video_origine.avi -s 320x240 -vcodec msmpeg4v2 video_finale.avi
- ffmpeg -i input_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 output_video.mpeg
Install FFmpeg in Ubuntu
You don't need to worry if FFmpeg has not been exsist in your system, you can simply install it through apt-get. you don't need to add some external repository or PPA because FFmpeg always available in default Ubuntu repository.
- apt-get install ffmpeg