FFmpeg is a multi platform, open-source library for video and audio files. Using FFmpeg you can do video conversions, sound extractions etc... It's better than using VLC player & Audacity to do video conversions, sound extractions. It too has a GUI which helps us to make it more easier. That's called WinFF. WinFF is a graphical user interface for FFmpeg. It will convert almost any video file that FFmpeg will convert. WinFF does multiple files in multiple formats at one time.
It's a bit fast when you use the terminal for it. Actually that's something that I experienced. But when using multiple file it's better to use WinFF.
You would get errors like “ffmpeg - Unsupported codec for output stream #0.0” if you haven't complied FFmpeg in the first place.
So to use this, first you have to compile FFmpeg & x264 (that means the codecs).
(Don't try to deviate from the plan. Just stick to it.. !! ).
First make sure that you haven't installed FFmpeg or x264 before. To be 100% sure paste this in the terminal.
sudo apt-get remove ffmpeg x264 libx264-dev
And do an update to make sure that you gets the latest version installed.
sudo apt-get update
Next you have to get all the dependencies which you need to install x264 & Ffmpeg.
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html \
libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \
libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
When you've got all the dependencies you have to install x264. First of all you have to get the files downloaded of x264.
git clone git://git.videolan.org/x264.git
After getting to files downloaded you have to install the x264. So you have to enter the folder.
cd x264
Then install it.
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | \
cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | \
head -c 7`" --backup=no --default --deldoc=yes
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`" --backup=no --default --deldoc=yes
This will install and make a backup for you at the folder x264 which is at your home folder named as “x264_1:0.svn20100126+20fa784-1_i386.deb” (it will change a bit .. I think you get the idea).
Then you have to install lame. Then you get the ability in encoding mp3s. First thing you need to do is to get back to your home folder. Do it by this.
cd
If you have installed a previous version of mp3lame. You have to uninstall that.
sudo apt-get remove libmp3lame-dev
sudo apt-get install nasm
After that you have to download the lame files. Get that done.
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
Extract the file.
tar xzvf lame-3.98.4.tar.gz
Go into the lame 3.98.4 folder.
cd lame-3.98.4
Then start the installation.
./configure --enable-nasm --disable-shared
make
sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4" --backup=no --default \
--deldoc=yes
sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4" --backup=no –default --deldoc=yes
After installing x264 next you have to install FFmpeg. So as you are in the x264 folder you have to get back to the home folder by
cd
Then download the files to install FFmpeg.
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
Then go to the ffmpeg folder.
cd ffmpeg
Start the installation
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb \
--enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid \
--enable-x11grab --enable-libmp3lame
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \
grep Revision | awk '{ print $NF }'`" --backup=no --default --deldoc=yes
hash x264 ffmpeg ffplay
This will install and make a backup for you at the folder ffmpeg which is at your home folder named as “ffmpeg_4:0.5+svn20100126-1_i386” (this also will change a bit .. ).
The installation of FFmpeg & x264 is over. Now I you want the GUI for the FFmpeg you can install that too.
sudo apt-get install winff
Using FFmpeg In The Terminal In Ubuntu
If you are using the GUI method it's easy to enter the values at the boxes in the window. If you are trying to use to terminal for it there is some codes that would be useful for you.
Get the info of a video file
ffmpeg -i 1.mp4
You have to give the name of the video after -i at the command which I've taken as 1.mp4
This will give you the information about the video file. The things like the frame rate, bit rates of the audio and the video track, etc ...
Turn images to a video sequence
ffmpeg -f image2 -i image%d.jpg 1.mp4
This command will transform all the images from the directory (the image files named as image1.jpg, image2.jpg, etc...) to a video file named 1.mp4.
Turn a video to images
ffmpeg -i 1.mp4 image%d.jpg
This command will make the video to images. This will make images nmaed as image1.jpg, image2.jpg, etc..
The other formats are available too. The formats such as PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI.
Encode a video sequence for the i pods, i Phones, PSP or mobile phones
ffmpeg -i 1.flv -f psp -r 25.00 -b 512000 -ar 24000 -ab 64000 -vcodec mpeg4 -s 320x240 1.mp4
Input file : 1.flv
Audio codec : mp3
Audio bitrate : 64kb/s
Audio Freqency : 24000Hz
Video codec : mpeg4
Video bitrate : 512kb/s
Frame rate : 25.00 /s
Video size : 320x180
Output file : 1.mp4
These videos will work only mobile phone like Nokia N79, Nokia N85 … etc
You can use this method to convert other file formates to .mp4 files. Formats like avi, flv, ogg, ogv, divx, etc..
ffmpeg -i 1.flv 1.mp4
You can use this to covert videos to another format.
Extracting sound track from a video and saving it as mp3
ffmpeg -i 1.flv -vn -ar 44100 -ac 2 -ab 320 -f mp3 1.mp3
Input file : 1.flv
Audio bitrate : 320kb/s
Audio Frequency : 44100Hz
Output format : mp3
Output file : 1.mp3
You can extract the sound track from almost all video formates & too can convert .wav files to .mp3 files.
Mix a video with a sound file
ffmpeg -i 1.wav -i 2.avi 3.mp4
Input Audio file : 1.wav
Input videos file : 2.avi
output file : 3.mp4
You can do this with almost all will video and audio file formats.
FFmpeg is a multi platform, open-source library for video and audio files. Using FFmpeg you can do video conversions, sound extractions etc... It's better than using VLC player & Audacity to do video conversions, sound extractions. It too has a GUI which helps us to make it more easier. That's called WinFF. WinFF is a graphical user interface for FFmpeg. It will convert almost any video file that FFmpeg will convert. WinFF does multiple files in multiple formats at one time.
It's a bit fast when you use the terminal for it. Actually that's something that I experienced. But when using multiple file it's better to use WinFF.
You would get errors like “ffmpeg - Unsupported codec for output stream #0.0” if you haven't complied FFmpeg in the first place.
So to use this, first you have to compile FFmpeg & x264 (that means the codecs).
(Don't try to deviate from the plan. Just stick to it.. !! ).
First make sure that you haven't installed FFmpeg or x264 before. To be 100% sure paste this in the terminal.
sudo apt-get remove ffmpeg x264 libx264-dev
And do an update to make sure that you gets the latest version installed.
sudo apt-get update
Next you have to get all the dependencies which you need to install x264 & FFmpeg.
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev
When you've got all the dependencies you have to install x264. First of all you have to get the files downloaded of x264.
git clone git://git.videolan.org/x264.git
After getting to files downloaded you have to install the x264. So you have to enter the folder.
cd x264
Then install it.
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`" --backup=no --default
This will install and make a backup for you at the folder x264 which is at your home folder named as “x264_1:0.svn20100126+20fa784-1_i386.deb” (it will change a bit .. I think you get the idea).
After installing x264 next you have to install FFmpeg. So as you are in the x264 folder you have to get back to the home folder by
cd
Then download the files to install FFmpeg.
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
Then go to the ffmpeg folder.
cd ffmpeg
Start the installation
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac
--enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:0.5+svn`date +%Y%m%d`" --backup=no --default
This will install and make a backup for you at the folder ffmpeg which is at your home folder named as “ffmpeg_4:0.5+svn20100126-1_i386” (this also will change a bit .. ).
The installation of FFmpeg & x264 is over. Now I you want the GUI for the FFmpeg you can install that too.
sudo apt-get install winff



Tidak ada komentar:
Posting Komentar