Convert Video Formats Using FFMPEG
Getting a video into the format you like can be important when providing media to your users on the web. Unfortunately your customer or video source may not give you media in the desired format. No problem: use the FFMPEG library to quickly and easily convert your media from and to any format you'd like.
Installing FFMPEG
sudo port install ffmpegx
The above installs FFMPEG with MacPorts. The install process took quite a while because FFMPEG required that I upgrade quite a few packages. Be patient...it's worth it.
Basic Conversion Shell Script
ffmpeg -i myVideo.mpeg myVideo.flv
This is a very basic conversion directive. Since Flash video has become the standard for embedding video, I've chosen to convert to the FLV format. If you want to control more of the conversion details, grab the documentation and experiment. I've installed FFMPEG on a few websites and used PHP to direct FFMPEG to dynamically generate videos.
If you need to take control of your media, try FFMPEG. FFMPEG also has a GUI version if you prefer to avoid command line.
You can use WinFF, it’s an other GUI for ffmpeg with presets. It works for Linux and Windows.
@Sylvain: Thanks for sharing that. I still prefer the command line — it’s faster and you can’t easily automate the GUI.
I have it configured like this:
./configure –enable-libtheora –enable-libvorbis
and am using the following command to create open videos for the new firefox 3.5 (3.1+) video tag:
ffmpeg -i sourcefile_ie.wmv -acodec libvorbis -vcodec libtheora finalfile_the.ogv
Some ffmpeg documentation:
http://www.ffmpeg.org/ffmpeg-doc.html
Awesome, thanks David.
If you’re on Windows, get Super. It’s a deeply ugly program, but it is awesomely powerful. Basically, it’s a GUI wrapper for a number of command line tools (including ffmpeg and others) and picks which tools to use depending on your input and output settings. Any format you’ve heard of and many you haven’t.
Super’s websiteand here’s the actual link to the file (finding it on the website is not easy…Super setup
Here is my collection of useful FFMPEG commands. I have done this for Linux – but should work on mac as well.
Awesome tips Binny V A! Everyone check out Binny’s link!
For mac, I use this GUI:
http://www.ffmpegx.com/
Is it possible to convert to .mov?
@Vince:
I think http://ubuntuforums.org/showthread.php?t=561087 has your answer:
“To encode a .mov you’ll need to use the target option.”
I get this on my Mac: sudo: port: command not found
Why?
@Ronny: You need to install MacPorts: http://www.macports.org/
You can try Cucusoft DVD and Video converters suite which includes Cucusoft Ultimate DVD and Video Converter Suite. It is the best all-in-one DVD and video conversion software converts DVDs and videos to play on almost any portable device including iPod, iPhone, Zune, PSP, video capable MP3 players, video capable mobile phones, and Pocket P.C., etc.
You can free download this software free from here:
http://freedvdripper.org/dvdvideoconverter/cucusoft-ultimate-dvd-video-converter-suite.html
I have converted video to FLV format. But the problem is File size is
0kb.
So, Am not getting any perfect solution on this. IF any one knows Pls help me.
@David Walsh: I’m trying to use ffmpeg on my website to dynamically ge t thumbnails created of flv fils, but it doesn’t seem to work out that well. i have checked the php.info and made sure its installed correctly, but i was wondering how to do this with php, every method i have found isntworking.
Try this to create thumbnails, I have it working. You must have the GD library installed in order for this to work!
This will create an image of the 8th second of the video
BTW I just can’t seem to be able to convert videos I get 0Kb files, but I am able to execute the same command from the command line
Any help would be appreciated, you can email me
Ffmpeg is great for converting files but complex codec and parameters setting is often required when you are using it on linux. As far windows platform is concerned, Ffmpeg is awesome.
Thunder (or anyone), I’ve been trying to get FFmpeg working on WAMP for days. Can you please help me?
I have found little info about installing and testing FFmpeg and flvtool2 on WAMP. I could really use someone’s help.
I already hFFmpegmpeg, flvtool2 and FFmpegmpeg installed but I’m not sure if I have installed the correct versions of each so they all work together.
Every test script I try gives some sort of error or I get a 0kb flv file. Maybe because the scripts are for NIX. I just don’t know.
If someone is willing to take the time, I surappreciaterechiate it :)
Shoot me an email:
jeffshead at hotmail.c0m
How can i convert videos in short time? guys anyone can please suggest…