x

Share The Wonder

Home > Resource > Edit MPEG Videos > FFmpeg - How to Use FFmpeg to Edit and Convert Videos

FFmpeg - How to Use FFmpeg to Edit and Convert Videos

FFmpeg is a cross-platform solution to record, convert and edit audio and video. It is a command line tool to convert one video file format to another. However, you could also find a FFmpeg GUI for user-friendly video editing. In this article, we will show you how to use FFmpeg for daily tasks on both Linux and Windows.

  1. How to Install FFmpeg Command Line Tool in Windows
  2. How to Install FFmpeg Command Line Tool on Linux
  3. FFmpeg Examples for Daily Video Editing Tasks
  4. FFmpeg Alternative That Suitable for Any One to Use

How to Install FFmpeg Command Line Tool in Windows

Download FFmpeg and uncompress files to a folder, e.g. D:/temp/. Then copy /bin/ffmpeg.exe to X:/Windows/system32/ffmpeg.exe (X is your windows system drive, usually C:/). Thereafter, you can run FFmpeg in command line. To do so, go through Start/Run and enter cmd in the Run dialog box. When cmd opens, input FFmpeg. If FFmpeg version and other information show up, you installed FFmpeg on your Windows system successfully.

avidemux tutorial

Note: You get helps by typing "FFmpeg -h | more" to get help, or read next session for daily video editing tasks.

Recommended Software:

wondershare video editor
Handy FFmpeg alternative to help you create home movies in minutes. It features intuitive interface, comprehensive drag-n-drop feature, wide format support, and handy editing tools. Learn More >>
 

How to Install FFmpeg Command Line Tool on Linux

What you should know before installing FFmpeg on Linux - FFmpeg requires many modules for general usages. If FFmpeg doesn't work well, fix it by installing correct module, including LAME MP3 Codec, mplayer, libogg, libvorbis, etc. Now, follow these steps to install FFmpeg to your Linux system.

Step 1: Download modules

cd /usr/local/src/
wget www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz

Step 2: Extract modules

tar zxvf lame-3.97.tar.gz
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz
tar jxvf essential-20061022.tar.bz2
mkdir /usr/local/lib/codecs/
yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion ruby ncurses-devel -y

Step 3: Update FFmpeg and mplayer

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src/
mv /usr/local/src/essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

Step 4: Install Modules

Install LAME:

cd /usr/local/src/lame-3.97
./configure
make && make install

Install LIBOGG

cd /usr/local/src/
cd /usr/local/src/libogg-1.1.3
./configure --enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

Install LIBVORBIS

cd /usr/local/src/libvorbis-1.1.2
./configure && make && make install

Install mplayer

cd /usr/local/src/
cd /usr/local/src/mplayer
./configure && make && make install

Install FFmpeg:

cd /usr/local/src/FFmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install

export LD_LIBRARY_PATH=/usr/local/lib/

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

FFmpeg Examples for Daily Video Editing Tasks

Convert .avi video to .mpg and any other formats by typing desired formats, say wmv, mp4, mkv, flv, etc.
FFmpeg -i source_video.avi final_video.mpg

Convert a video for the iPod/iPhone using FFmpeg
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

Convert a video for the PSP using FFmpeg
FFmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4

Extracting sound from a video, and save it as MP3 using FFmpeg
FFmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3

Convert video to image sequences using FFmpeg
FFmpeg -i video.mpg image%d.jpg

Convert video to animated gif(uncompressed) using FFmpeg
FFmpeg -i source_video.avi gif_animated.gif

Split/Trim video using FFmpeg
FFmpeg -i source_video.mpg -ss 00:00:10 -t 00:00:30 final_video.mpg

Merge video files and convert to desired formats
copy /b source_video1.mp4 + source_video2.mp4 out.mp4 | FFmpeg -i out.mp4 -sameq final_video.mpg

FFmpeg Alternative That Suitable for Any One to Use

Many users may find FFmpeg program hard to interpret, and want some easy and quick editing application. If this is your case, Wondershare Video Editor (Video Editor for Mac) comes a handy FFmpeg alternative to help you create home movies in minutes. It has a very intuitive interface and includes all common editing features you may need. When you crop, trim, rotate, add transitions, effects, intro/credits, etc. on Timeline, you can conveniently check any changes in the real-time previewing window. Below is the primary window screenshot.

ffmpeg alternative

Download Wondershare Video Editor free trial:

Download Win Version Download Mac Version

Product-related questions? Speak directly to our Support Team >>

Liza_Brown
I'm afraid it's not possible using ffmpeg. You can try Wondershare Video Editor instead.
anshup
I want to have left-right,top-bottom transition effects on images while playing videos is it possible using ffmpeg ?
chiq
i think you should use double quotes "c:fullpathhome video (2014).mp4"
GRatt8191
I like it because it gives you full controle of editing and converting. However you can not use a path to your video that contains spaces in it because ffmpeg thinks it is a start of a new option. For example ( C:Documents and SettingsAdministratorMy Documents) tricks ffmpeg to think (C:Documents) is the input video and that (and) begins a new command option. Can anyone tell me if there is a way to use spaces or a way to convert the path to a 8dot3 type format that would take out spaces ?
Liza_Brown
Hi, James, FFmpeg is not GUI designed and many users find it on the difficult side. Anyway, you can have a try! If you're looking for an much easier to use alternative, you can try this video converter. It's the all-in-one solution for you to download online video, convert videos to any formats, and burn DVD at ease.
James Cord
Good or Bad?
James Cord
Some say good and some say bad. How do we know?

CONNECT WITH US

FacebookTwitterGoogle PlusPlay via Youtube

GET OUR NEWSLETTER

CHOOSE YOUR COUNTRY

Top