This tutorial is about transcoding video fom one codec into another using FFMPEG. I got deeper into FFMPEG when I wanted to transcode into FLV (Flash Video) and it works very well. I developed the Riva FLV Encoder, a GUI for FFMPEG.
Update 26.10.2006: This tutorial is a little outdated as there were many changes in FFMPEG like the switch from CVS to Subversion and the workflow to compile FFMPEG under Windows has become more difficult. For the new tweaks check this tutorial.
- Download MinGW ” MSYS current releases (Window Exe Binaries MSYS-1.0.10.exe & MinGW-3.1.0-1.exe)
- Install MinGW
- Install MSYS
- HINT: During the Postinstall be sure to set the right path to MinGW with a “/” instead of a Windows-”". If you did it wrong anyway re-install MSYS to the same directory and do the postinstall right (I missed it a few times)
- Download and compile Lame
- Extract Lame to your MSYS home-directory
- Open MSYS and change to your lame-directory (cd ../lame-XXX)
- Enter the following commands:
./configure //(takes a few minutes) make //(lame is being comiled; takes a few minutes, too) make install
- After installing you will recognize that there are new directories and files in MSYS/local which we will use while compiling ffmpeg with mp3-support
- Download Subversion Client like Tortoise SVN (http://http://tortoisesvn.tigris.org/) and install it
- Check out the sourcecode from svn://svn.mplayerhq.hu/ffmpeg
- Compile FFMPEG
- Change the directory in MSYS to your ffmpeg-directory (cd ../ffmpeg)
- Enter the command:
./configure --enable-memalign-hack --enable-mingw32 --enable-mp3lame --extra-cflags=-I/local/include --extra-ldflags=-L/local/lib
- HINT: you can paste into MSYS by pressing your center mouse-button
- “–enabled-memalign-hack” is a Windows hack. Without this option ffmpeg always crashs with the message “removing common factors from framerate” when encoding AVIs.
- “–enable-mingw32″. I see no difference without it but we compile with MinGW and it would not do a harm when ffmpeg knows this
- “–enable-mp3lame”: Enable transcoding audio with the open-source mp3-lame-codec
- “–extra-cflags=-I/local/include –extra-ldflags=-L/local/lib”: The cflags- and ldflags-parameter sets the right path to your lame-installation which you did in step 3.d.
- Enter command: make (ffmpeg is being compiled; takes a few minutes)
- With “make install” you could now copy the ffmpeg.exe to c:Program Filesffmpeg. But there is no need to.
- Use FFMPEG
- Copy your compiled ffmpeg.exe from your MSYS directory to the directory where you like to transcode with ffmpeg
- Open the Dos-Shell and change to the directory where you copied the ffmpeg.exe
- Copy a test.mpg into your directory and enter the following command:
ffmpeg -i test.mpg -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 test.flv
- Your first FLV should be encoded now
- Render Images from a Video
- Enter command:
ffmpeg -an -y -t 0:0:0.001 -i test.flv -f image2 test%d.jpg
- HINT: With -t you set the length of images to be extracted. Above we entered 1 millisecond the extract one image. If you miss this parameter all images of the video will be extracted
ZLib Support (e.g. for TSCC and Quicktime codecs). This should be compiled into FFMPEG. It is not an explicit compile in the configure statement. Do the following steps and after configure you should see that zlib is “on”.
Download and compile ZLib
Extract the files to your mysys directory
Change the directory in MSYS to that directory
Enter command ./confugure, make and make install.
AC3 Support
Add “–enable-a52 –enable-gpl” to your configure command
3GP Support
If you want to enable 3GP support you have to add the AMR audio codec. Download the TS26.104
REL-5 V5.1.0 26104-5??.zip here. Extract the codec into libavcodec/amr_float and add “–enable-amr_nb” to your configure command
XVID Support (thanks to garvin.thornten at datel.co.uk)
Download and install the codec from www.xlib.org (see xvidcore-xxxx/doc/install). Add “–enable-xvid –enable-gpl” to your configure command. When compiling with xvid codec in MinGW or cygwin you will get a “mkstemp” error when compiling “xvidff.c”. To fix this edit “libavcodec/xvidff.c” and add the following after the #includes. This will probably be fixed in a future ffmpeg release: ´
/* Added for windows compile ----------------- */ #include int xvid_ff_2pass(void *ref, int opt, void *p1, void *p2); void xvid_correct_framerate(AVCodecContext *avctx); int mkstemp(char* template) { char temppath[512]; if(GetTempPath(512,temppath)!=0) { if(GetTempFileName(temppath,"fil",0,template)!=0) { FILE *pFile; pFile=fopen(template,"w+"); if(pFile!=NULL) return (int)pFile; } } return -1; } /* ------------------------------------------- */
Link about qscale
removed “-f singlejpeg” as its identical to “-f mjpeg”






Audio doesn’t seem to work with ffmpeg. I tried it on a linux machine, but I did it with lame, so it shouldn’t be any problem.
Any ideas?
No idea. There should be no problems. Post your problem more detailed in the ffmpeg-mailinglist.
Cheers,
Sönke
About 10.XVID Support (thanks to garvin.thornten at datel.co.uk)
Which file should I add ur codes? xvidff.c?
Thanks!
And how about faac and faad2 enable for ffmpeg? Looking forward to it …
The file is xvidff.c as mentioned there.
faac and faad2 have to be enabled while configuring:
–enable-faac
–enable-faad
I am not sure if extra libraries have to be installed/compiled for this. maybe you can give it a try and report.
Cheers,
Sönke
zlib-support is also required for many Quicktime files b/c they can have their headers compressed with Zlib. I suggest to compile *always* with zlib support
Sönke,
Thanks so much for your information. I found this with Google. Between your wisdom and other snippets I’ve found on the web, I have a compiled FFmpeg that I’m very happy with.
I must say, your code addition to get –enable-xvid was a lifesaver. As far as I can tell, you are the only one on the web who has published this important info. May I ask how you learned how to do it? I’m starving for more info on FFmpeg. The code worked great once I included the full path to the windows.h include. For some reason msys couldn’t find it.
Also, you need the extra libraries if you –enable-faac and –enable-faad.
Hi,
thanks for the kind feedback but the xvid hack wasn’t me. Look at the thanks to in the xvid part. He emailed me the code to add it to my tutorial.
Also thanks to RockAttack. I changed the ZLib part.
berrygood
FFmpegでswfへ変換
Import&Exportにswfが使えるんなんて、FFmpegって結構使えるのね。 こういうことは、学校で教えてください。つか、FLVエンコーダーもあるのかよ。 FFmepg(マルチメディア変換)の使い方 Sonke R…
works great - however is there a way to put the metadata into the flv at the same time as encoding? .. so it can be used with nice swf players?
FFMPEG does not support metadata. You can use FLVTool2 to inject metadata into FLVs. The Riva FLV Encoder uses both tools and supports FLV 1.1
Thanks for a nice website. I had problems while compiling ffmpeg, but thanks to your website, many things were cleared up.
Also, have you successfully compiled and run ffmpeg with the additional option -–enable-shared in the command line? The compiler complains that ld.exe cannot find -lmp3lame when -–enable-shared is added. If you have resolved this problem, please add the instruction to your ffmpeg guide as well.
Thanks.
Hi, I haven’t tried –enable-shared yet and don’t have a solution for your problem.
FFMPEG has the ability to grab video from a live source.
Has anyone successfully done this on a windows environment?
From what I know this works only on linux machines. This was discussed in the FFMPEG mailing list.
If that’s true, then I’m back to square one.
Know of any command line capture software?
I have tried a few but I don’t remember there names, sorry.
Anybody here that has build / compile instructions on howto build FAAD2 with MinGW32? I really want to build a ffmpeg version that supports as much codecs and fileformats possible, all using freely available opensource tools. To make things a bit more user-friendly I want to try and get it all working under Mingw32. Only FAAD2 is not working under Mingw32 right now. Any help / info is welcome.
Great stuff. I too would like to build a “mega ffmpeg” on linux to handle as many video input files as possible. A turorial on this..step by step…would be great in terms of the libs necessary and the order of installs, etc.
thanks!
Hi. I am trying to do the following: take an flv (audio only) file recorded with the Flash Communications Server MX and convert it to MP3 format on a
Windows XP Pro machine. I found your site and followed your excellent instructions at http://soenkerohde.com/tutorials/ffmpeg/
I was able to get everything to compile (although for others trying I should mention that there was one small problem not documented. When compiling LAME it
could not find some files in C:\msys\1.0\home\Admin1\lame-3.96.1\libmp3lame. The solution was to edit line 13 of one of the header files and then LAME
compiled fine). So after everything, I put some flv files record from the flashcom sample app into a directory called c:\video, navigated there in DOS and
tried to run:
ffmpeg -i a.flv m.mp3
and got the following error:
ffmpeg version CVS, build 3277056, Copyright (c) 2000-2004 Fabrice Bellard
configuration: –enable-memalign-hack –enable-mingw32 –enable-mp3lame –extra-cflags=-I/local/include –extra-ldflags=-L/local/lib
built on Nov 6 2005 21:04:20, gcc: 3.4.2 (mingw-special)
[flv @ 006C5D14]Unsupported audio codec (5)
Input #0, flv, from ‘a.flv’:
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: 0×0005, 8000 Hz, mono
Output #0, mp3, to ‘a.mp3′:
Stream #0.0: Audio: mp3, 8000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec (id=0) for input stream #0.0
I tried a lot of other ffmpeg parameters but could not get anything to work. Do you have any ideas how to make this work? I know it can be done because I
have seen other sites doing this. Thanks very much for any help - you seem to be the resident guru on this topic!
Also, I should mention that I found some other suggestions such as using:
ffmpeg -i $input_dir$movie -hq -acodec mp3 -ar $22050 -ab 56 -f flv -s 320×240 -aspect 4:3 -y $output_dir$filename.flv
which supposedly is based off your own software! However when I try:
ffmpeg -i a.flv -hq -acodec mp3 -ar $22050 -ab 56 -f flv -s 320×240 -aspect 4:3 -y a.mp3
this I get:
ffmpeg version CVS, build 3277056, Copyright (c) 2000-2004 Fabrice Bellard
configuration: –enable-memalign-hack –enable-mingw32 –enable-mp3lame –extra-cflags=-I/local/include –extra-ldflags=-L/local/lib
built on Nov 6 2005 21:04:20, gcc: 3.4.2 (mingw-special)
[flv @ 006C5D14]Unsupported audio codec (5)
Input #0, flv, from ‘a.flv’:
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: 0×0005, 8000 Hz, mono
c:\ffmpeg\ffmpeg.exe: unrecognized option ‘-hq’
which I don’t understand at all! If I take out the -hq I will get this error:
$ ffmpeg -i a.flv -acodec mp3 -ar $22050 -ab 56 -f flv -s 320×240 -aspect 4:3 -y a.mp3
ffmpeg version CVS, build 3277056, Copyright (c) 2000-2004 Fabrice Bellard
configuration: –enable-memalign-hack –enable-mingw32 –enable-mp3lame –extra-cflags=-I/local/include –extra-ldflags=-L/local/lib
built on Nov 6 2005 21:04:20, gcc: 3.4.2 (mingw-special)
[flv @ 006C5D14]Unsupported audio codec (5)
Input #0, flv, from ‘a.flv’:
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: 0×0005, 8000 Hz, mono
Output #0, flv, to ‘a.mp3′:
Stream #0.0: Audio: mp3, 2050 Hz, mono, 56 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
Of course I tried Riva but I get the following error:
Encoding has failed
This can be caused by a not supported combination of parameters or by a not supported video codec
and the log file says:
ffmpeg version 0.4.9-pre1, build 4751, Copyright (c) 2000-2004 Fabrice Bellard
configuration: –enable-memalign-hack –enable-mp3lame –enable-mingw32 –extra-cflags=-I/local/include –extra-ldflags=-L/local/lib –enable-amr_nb
built on Mar 29 2005 07:26:02, gcc: 3.2.3 (mingw special 20030504-1)
[flv @ 0040F954]Unsupported audio codec (5)
Input #0, flv, from ‘C:\video\a.flv’:
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: 0×0005, 8000 Hz, mono
Output #0, flv, to ‘C:\video\a.flv’:
Stream #0.0: Audio: mp3, 22050 Hz, mono, 56 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec (id=0) for input stream #0.0
which I don’t understand either. Could you offer any suggestions? Thanks very much for any help.
Hi,
sorry no idea but I would try to ask the ffmpeg-mailinglist.
Your website is absolutely been a savior. It’s held the solutions to many of the problems that were encountered while compiling ffmpeg.
lame failed to compile with the following changes listed below.
the compiler does not have lame/mpglib in its list for include files. simple fix: edit libmp3lame/mpglib_interface.c line 13 to #include “../mpglib/interface.h”
May I suggest that you take this wonderful page and start a compressive wiki page to help people with their attempts to compile and use ffmpeg I’d be willing to help as well.
To get –enable-shared to work, I had to copy libxvidcore.a and libmp3lame.a to the MinGW\lib folder .. for some reason it wasn’t accepting the
–extra-ldflags=-L/local/lib
*shrugs* once I copied them the enable-shared option worked.
-jeremy
How can I conver a flv file to 3gp format file?
I found the way myself.
./configure –enable-memalign-hack –enable-amr_nb
http://www.xlib.org is down.
I wonder if xvidcore-1.1.0-beta2.zip from http://www.xvid.org/downloads.html can be used instead… I will give it a try
I have just compiled it with all the options you mention, using your excellent instructions.
A couple of hints:
I jumped into an error about lrintf, similar to this : http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/23188
I fixed it (I think) the same way: replace
static always_inline long int lrintf(float x)
with
static inline long int lrintf(float x)
in file libavutil/common.h.
(Maybe it wouldn´t have been necessary if I had done the next change before…)
Also, lame 3.96a was giving me trouble, I tried several older versions but finally achieved it with lame-3.97beta2, which I download form sourceforge. http://lame.sourceforge.net/ is outdated, use http://sourceforge.net/projects/lame and get it from to the Files section
Good luck!
I can’t add –enable-mp3lame to build the ffmpeg.Why?Should I download a lame and build?What I should do?
Yes, please check part 2. of my tutorial.
Thanks for your great site!
I need to build ffmpeg with AC3 encoding capabilities. I know i need to add ‘-enable-a52bin -extra-libs=”-la52″‘ to the line of configure. I’d installed A52DEC but I don’t know why, it’s not enough. Do you know what I must do now?
Cheers
You are welome but sorry, I dont know what you exactly have to do to include AC3
Great tutorial! very appriciated! Now one question
Lets say i put a swf containing a flv-player on site A 10mbit host and some flv files on a site B 100mbit host. i tell the flv-player at site A to play the flv’s at site B. Now some user goes watching the clip on my site, does he download the flv from site B or does the swf download the flv and broadcast it via site A?
Hi again. i have one more question. My movies encode succesfully with ffmpeg in linux but when i watch them with some flv player on my site, the “progressbar”-thing isnt “scrollable” until the whole movie is downloaded, i guess its because there’s no cue points added in the movie with ffmpeg. is this fixable with flvtool2? if so, whats the commando? i like your riva encoder though i must do this in linux since its takes forever to download the movie from my server and then reupload it. any help appriciated.
Hi ! thanx for the tut!
i did everything mentioned, but when i want to do the make command for the ffmpeg.exe, i get a bunch of parse errors like this:
avcodec.h:1987: warning: data definition has no type or storage class
avcodec.h:1988: parse error before “flv_decoder”
avcodec.h:1988: warning: type defaults to `int’ in declaration of `flv_decoder’
avcodec.h:1988: warning: data definition has no type or storage class
avcodec.h:1989: parse error before “rv10_decoder”
avcodec.h:1989: warning: type defaults to `int’ in declaration of `rv10_decoder’
avcodec.h:1989: warning: data definition has no type or storage class
avcodec.h:1990: parse error before “rv20_decoder”
Anyone an idea?
Hi,
@32: There is no broadcast but simply a download when you don’t use a special server like the Flash Media Server.
@33: it’s not because of the cuepoints but because of the missing metadata. you can inject the missing metadata with flvtool2: http://inlet-media.de
@34: sorry, no idea. I would ask the ffmpeg-mailinglist …
Ähmm it starts like this:
make[1]: Entering directory `/c/msys/1.0/home/ffmpeg/libavcodec’
gcc -O3 -g -Wall -Wno-switch -I/local/include -DHAVE_AV_CONFIG_H -I.. -I’/../c/ msys/1.0/home/ffmpeg’/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GN U_SOURCE -c -o bitstream.o bitstream.c
In file included from bitstream.c:28:
avcodec.h:14:20: avutil.h: No such file or directory
In file included from bitstream.c:28:
avcodec.h:436: parse error before “int16_t”
avcodec.h:436: warning: no semicolon at end of struct or union
avcodec.h:437: warning: type defaults to `int’ in declaration of `AVPanScan’
avcodec.h:437: warning: data definition has no type or storage class
avcodec.h:672: parse error before “uint8_t”
do i have to put the specified files to the same folder ?
Do you try the latest version from CVS?
I would ask the FFMPEG list for such questions …
Cheers,
Sönke
Hi,
Just wondering if you had any info on compiling ffmpeg for Windows Mobile. I’ve asked at the ffmpeg mailing list and at corecodec.com (tcpmp uses ffmpeg) but have not received any replies. I’ve tried a number of things (wince toolchains, configure options) but nothing has worked. Any help would be very much appreciated.
P.S. Great guide for compiling for Win32. It saved my butt.
Sorry, no idea. but good luck!
Hi, i’m just follow your instruction and
after compiling and installing of ffmpeg.
The error message popup was shown and it say that
“This application has failed to stard because libmp3lame-0.dll was not found.Re-installing the application may fix this problem”
Anyone an idea?
Thanks for the great tutorial. I followed the instructions for everything except xvid, and it all worked fine. Now I can create flv’s with video AND audio. NICE!
Do you, or anyone reading this, have any links to or examples of the command line to make ffmpeg generate a 3gp with both video and audio?
I have 15 second video clip that I’ve broken into a series of jpegs and a single .wav file. I can now, thanks to this site, encode that as a flv with both the video and audio, but I’m not able to figure out the right set of command line parameters to encode it as a 3gp. I have an earlier version of ffmpeg (precompiled from the Gallery2 source forge project) that I am able to generate an mp4 with, and by simply changing the extension to .3gp the file plays on my Samsung cellphone, but it does not have audio.
Any advice, links or examples anyone?
Hey gugcula:
I had the same problem. Simply look in your msys’s local\bin and the libmp3lame-0.dll file is there. Copy that into the same directory as your ffmpeg.exe and you are good to go.
On my setup, that directory is C:\msys\1.0\local\bin
After compiling and copying lib are completed, i’m trying
to convert but it always display these message
C:\Program Files\FFmpeg>ffmpeg.exe -y -i legendheroes_ot_psp_101805.mpg sample.flv
Input #0, mpeg, from ‘legendheroes_ot_psp_101805.mpg’:
Duration: 00:01:06.7, bitrate: 1528 kb/s
Stream #0.0: Video: mpeg1video, 320×240, 29.97 fps, 1350 kb/s
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 128 kb/s
Output #0, flv, to ’sample.flv’:
Stream #0.0: Video: flv, 320×240, 29.97 fps, q=2-31, 200 kb/s
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Fatal error: mp3 data is not padded!
Could you guys offer any solutions?
hi gugcula,
sorry no idea. I would ask in the ffmpeg-mailinglist.
ok i’ll go there thank you for provide this good tutorial
Hi,
i want to do video processing using opencv and VC++
i don’t now how to install ffmpeg for windows and how to use ffmpeg with opencv and vc++ to do video processing could please anyone give me the stepwise procedure to do this.
I want to use ffmpeg to convert from 3GP to FLV. Unfortunatly the video-stream is not converted correctly. The video of the resulting FLV runs almost twice as fast, as in the origianl 3GP. I a,lso notice this in ffmpeg’s output:
…Input
Stream #0.0: Video: h263, 176×144, 11.51 fps
…Output
Stream #0.0: Video: flv, 176×144, 20.00 fps, q=2-31, 200 kb/s
I use the following command:
ffmpeg -i 77493_1139671907306.3pg -y -ar 22050 test.flv
Does anyone have an idea about this? The option -r does not fix my problem.
I use ffmpeg version 0.4.9-pre1, build 4718
Thnaks alot and kind regards, hans
Ah, sorry. I need to add, that this tutorial helped me alot getting ffmpeg started
Hi Hans,
i don’t know where the problem is. I would ask the ffmpeg-mailinglist.
Hi Sönke,
thanks for your quick answer. I should have checked out the latest version from the CVS-Repository in first place. After a little bit of struggeling with the make-process I compiled it and everything is running fine now.
Kind regards, Hans
Hi Sonke,
Just wanted to thanks for the great info.
Thank you so much for great tutorial here. I have been trying to compile ffmpeg with AAC on windows. I followed everything as you explained but somehow ffmpeg failed to find the ffmpeg libraries. I am able to compile AAC and xvid sepertly and set the path. I used follwing configure command
./configure –enable-shared –disable-static –enable-memalign-hack –enable-
faac –extra-cflags=-I/C/mplayer/msys/faac/include –extra-ldflags=-L/c/mplayer
/msys/faac/libfaac/Debug
but got the following build error
make -C libavutil all
make[1]: Entering directory `/ffmpeg/libavutil’
gcc -shared -Wl,-soname,avutil.dll.49 -Wl,–output-def,avutil.def,–out-implib,libavutil.dll.a -o avutil.dll mathematics.o integer.o rational.o intfloat_readwrite.o -lm -lfaac -lz
c:\mplayer\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lfaac
collect2: ld returned 1 exit status
make[1]: *** [avutil.dll] Error 1
make[1]: Leaving directory `/ffmpeg/libavutil’
make: *** [lib] Error 2
I am sure you can help me here. Thanks in advance
I could solve the problem by copying libfacc.dll into Mingw32 include directory i.e. MinGW/lib/gcc/mingw32/3.4.2 and use the following config to build ffmpeg with xvid and aac
./configure –enable-shared –disable-static –enable-memalign-hack –enable-
xvid –enable-gpl –extra-cflags=-I/C/mplayer/msys/xvidcore/src –extra-ldflags
=-L/C/mplayer/msys/xvidcore/build/win32/bin –enable-faac –extra-cflags=-I/C/
mplayer/msys/faac/include –extra-ldflags=-L/c/mplayer/msys/faac/libfaac/Debug
now i get following errors
Cannot export .idata$4: symbol not found
Cannot export .idata$5: symbol not found
Cannot export .idata$6: symbol not found
Cannot export .text: symbol not found
Cannot export xvidcore_NULL_THUNK_DATA: symbol not found
Creating library file: libavcodec.dll.a
faac.o(.text+0×3f): In function `Faac_encode_init’:
C:/mplayer/msys/ffmpeg/libavcodec/faac.c:42: undefined reference to `faacEncOpen@16′
faac.o(.text+0×4c):C:/mplayer/msys/ffmpeg/libavcodec/faac.c:47: undefined reference to `faacEncGetCurrentConfiguration@4′
faac.o(.text+0xdb):C:/mplayer/msys/ffmpeg/libavcodec/faac.c:88: undefined reference to `faacEncSetConfiguration@8′
faac.o(.text+0×134):C:/mplayer/msys/ffmpeg/libavcodec/faac.c:80: undefined reference to `faacEncGetDecoderSpecificInfo@12′
faac.o(.text+0×181):C:/mplayer/msys/ffmpeg/libavcodec/faac.c:50: undefined reference to `faacEncClose@4′
faac.o(.text+0×1f5): In function `Faac_encode_frame’:
C:/mplayer/msys/ffmpeg/libavcodec/faac.c:102: undefined reference to `faacEncEncode@20′
faac.o(.text+0×224): In function `Faac_encode_close’:
C:/mplayer/msys/ffmpeg/libavcodec/faac.c:119: undefined reference to `faacEncClose@4′
collect2: ld returned 1 exit status
make[1]: *** [avcodec.dll] Error 1
I compiled faac using visual studio 7
hi, really good stuff both this and the riva gui!
i do have problems with my ffmpeg install, as the sound comes out all distorted and uhm buzzy. ive installed amr_nb and lame. riva converts the file just fine though. ever noticed anything like this?
thanks for your information on –enable-xvid.
It is really helpful. there is nobody provided such information on internet exept here.
I share some my experience on –enable-xvid here:
First, I changed in ffmpeg configure:
1, point to right xvidcore library directory:
–enable-xvid) xvid=”yes”
extralibs=”$extralibs -L/usr/local/lib -lxvidcore”
2. if test “$?” != “0″ ; then
rm config.h
mv -f $TMPH config.h
else
echo “config.h is unchanged”
fi
because it can not mv to config.h.
3. here is my configure command line:
./configure –disable-static –enable-shared –enable-memalign-hack –enable-
xvid –enable-gpl –enable-mingw32 –extra-cflags=-I/local/include –extra-ldfl
ags=-L/local/lib
4.
make change in xvidff.c and xvid_rc.c
pointing xvid.h to right position.
On my pc this is the case, different from PC to PC:
#include “../../../../local/include/xvid.h”
5.
add the scripts mentioned above in xvidff.c
6,make
just found out why i got distorted buzz instead of the correct audio. turns out i needed to compile with amr_nb-fixed as well.
There’s a space between “windows” and “.h” in your code.
Just found that out cuz cp & paste didn’t work
#include
Thanks for the hint but this is a problem of the blogsoftware I am using. I have to upgrade to a newer version but had no time yet.
Does ffmpeg can convert the file with extends “.wmv”, what is the command line.
yes, but only wmv7/8.
http://ffmpeg.sourceforge.net/ffmpeg-doc.html#SEC19
For people who want to install faad2 on msys
Download faad2 using cvs
After downloading ./bootstrap then ./configure and finally make
Thanks Man!
this is was so simple and powerful for me… got things get started….
i get can not find video graber device?
any idea about what i am missing?
thanks
Kani
from what i know grabbing does not work under windows. to be sure i would ask in the ffmpeg mailinglist.
that’s fine!
now i am able to covert the videos but there is no audio in my output flv, what i am missing?
i have followed everything you said above…
upto 6 …
i didn’t do anything after 6
ZLib Support (e.g. for TSCC and Quicktime codecs).
please help me.
Which command did you use.
I would recommend asking this in the ffmpeg mailinglist.
Great guide, I fololow it in all steps but when i digit make for compile ffmpeg I obtain
this stack with 2 error at the end? can i resolve it? how? thanks
$ make
make -C libavutil all
make[1]: Entering directory `/c/ffmpeg/libavutil’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/c/ffmpeg/libavutil’
make -C libavcodec all
make[1]: Entering directory `/c/ffmpeg/libavcodec’
gcc -O3 -g -Wall -Wno-switch -I/local/include -Wdeclaration-after-statement -DHAVE_AV_CONFIG_H -I.. -I/c/ffmpeg/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o mpegvideo.o mpegvideo.c
In file included from c:/ffmpeg/libavutil/avutil.h:24,
from avcodec.h:14,
from mpegvideo.c:28:
c:/ffmpeg/libavutil/common.h:596: warning: static declaration of ‘lrintf’ follows non-static declaration
mpegvideo.c: In function `MPV_encode_picture’:
c:/ffmpeg/libavutil/common.h:596: sorry, unimplemented: inlining failed in call to ‘lrintf’: redefined extern inline functions are not considered for inlining
mpegvideo.c:2554: sorry, unimplemented: called from here
make[1]: *** [mpegvideo.o] Error 1
make[1]: Leaving directory `/c/ffmpeg/libavcodec’
make: *** [lib] Error 2
Did you use the latest CVS version?
I would recommend asking this in the ffmpeg mailinglist.
i use the WinCVS 2.0.2.4 build 4 and for download ffmpeg i use the string that you have posted
i have installed ffmpeg and lame in Linux, and enabled mp3lame using ./configure –enable-mp3lame, but i still got a message like “Unsupported codec for output stream #0.0″ when i trying to transfer a .wmv file or .wav file to mp3. any idea?
the whole messages are:
[root@xl2 ffmpeg-0.4.9-pre1]# ffmpeg -i input/kids.wav -acodec mp3 zz.mp3
ffmpeg version 0.4.9-pre1, build 4718, Copyright (c) 2000-2004 Fabrice Bellard
built on Mar 22 2006 13:19:59, gcc: 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Input #0, wav, from ‘input/kids.wav’:
Duration: 00:01:26.6, bitrate: 88 kb/s
Stream #0.0: Audio: pcm_u8, 11025 Hz, mono, 88 kb/s
Output #0, mp2, to ‘zz.mp3′:
Stream #0.0: Audio: 0×0000, 11025 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec for output stream #0.0
lame is woking fine in my Linux and i can transfer a .wav file to .mp3 useing command lame kids.wav test.mp3.
and in /usr/local/lib/ directory, i can see :
libmp3lame.la
libmp3lame.so -> libmp3lame.so.0.0.0
libmp3lame.so.0 -> libmp3lame.so.0.0.0
libmp3lame.so.0.0.0
please help me.
Derek, do you receieve any linking errors when you compile with the lame lib files? - my only concern is, is that its not actually linking into the ffmpeg executable, - have you tried to convert from wave to mp3 using just the lame binary? and if so does it work
I have no idea about these,
I just follow the ZLib support then make again.
C:/msys/1.0/home/Administrator/ffmpeg/qt-faststart.c:152: undefined reference to `fseeko64′
C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccg5baaa.o(.text+0×516):C:/msys/1.0/home/Administrator/ffmpeg/qt-faststart.c:164: undefined reference to `fseeko64′
C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccg5baaa.o(.text+0×51e):C:/msys/1.0/home/Administrator/ffmpeg/qt-faststart.c:16
an alternative is
int mkstemp(char* template)
{
mkstemps(template,0);
}
then add the library libiberty ( -liberty )
gcc -I../libvo -I../../libvo -fno-PIC -O4 -march=pentium3 -mtune=pentium3 -p
ipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I. -Ig:/MinGW/include/freetype2 -Ig:/MinGW/include -I./libavutil -
I./libavcodec -o mplayer.exe mplayer.o m_property.o mp_msg.o asxparser.o code
c-cfg.o cpudetect.o edl.o find_sub.o m_config.o m_option.o m_struct.o parser-cf
g.o playtree.o playtreeparser.o spudec.o sub_cc.o subreader.o vobsub.o unrarli
b.o mixer.o parser-mpcmd.o subopt-helper.o osdep/mplayer-rc.o libvo/libvo.a li
bao2/libao2.a vidix/libvidix.a libmpcodecs/libmpcodecs.a loader/libloader.a l
oader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a libaf/libaf.a libmpdemux/
libmpdemux.a input/libinput.a postproc/libswscale.a osdep/libosdep.a -Llibmpdvd
kit2 -lmpdvdkit libavcodec/libavcodec.a libavformat/libavformat.a libavutil/l
ibavutil.a libavcodec/libpostproc/libpostproc.a -ltheora -lmp3lame -lxvi
dcore -lpng -lz -static -lz -ljpeg -lx264 -Lg:/MinGW/lib -lfreetype /m
ingw/share/live//liveMedia/libliveMedia.a /mingw/share/live//groupsock/libgroup
sock.a /mingw/share/live//UsageEnvironment/libUsageEnvironment.a /mingw/share/l
ive//BasicUsageEnvironment/libBasicUsageEnvironment.a -lstdc++ -lws2_32 -lgdi
32 -lgdi32 -lwinmm -ladvapi32 -lole32 -lungif libfaad2/libfaad2.a mp3li
b/libMP3.a liba52/liba52.a libmpeg2/libmpeg2.a tremor/libvorbisidec.a -static
-lopengl32 -lgdi32 -lws2_32 -static -liconv -lm -liberty
sorry
int mkstemp(char* template)
{
return mkstemps(template,0);
}
How can I use FFMPEG libs to create jpg files from a video file?
I have write some code to get a frame from video, but I do not know how to convert this frame to a jpeg file. I have tryed to convert FFMPEG AVFrame to a GD gdImage, and then save this GD gdImage to a jpeg file(ffmpeg-php use this kind of method), but the jpeg file I generated is incorrect.
Can you help me? thanks a lot.
you can extract the first image with
ffmpeg -an -y -t 0:0:0.001 -i test.flv -f image2 test%d.jpg
without -t 0:0:0.001 all frames are extraced.
i have installed ffmpeg into my linux system.
and i am able to covert the videos,
but there is no audio in my output flv, what i am missing?
what’s wrong ?
here are my commands , but both can’t create the flv file with audio . can u help me ?
thank you!
ffmpeg -i test.mpg -ab 56 -ar 22050 -b 500 -r 15 -s 320×240 test.flv
ffmpeg -i test.mpg test.flv
i have enabled AC5 in config command line already
ffmpeg -i amc.avi amc.flv
But amc.flv there is no audio in it, I don’t know why… who can tell me, thanks!!!!!
liukai-1982.5.11@vip.citiz.net
Thanks!!!
在学校的时English没有好好学,现在看不懂洋鬼子的文章,哪个好心看的懂中文的人加加我教小弟一下..
QQ:925483
Keynes , i get the same thing with you .
there is no audio in my flv file .
i’m using redhat linux , and found that the soundcard can’t be initialized correctly .
is that the reason ?? not sure …
can somebody tell me ? thanks !
Hi,
if you have problems with ffmpeg-commands I recommend asking the ffmpeg-mailinglist.
I want convert JPEG,GIF,WBMP files formats to various resolutions of JPEG formats. Can u suggest me how I can do in java?
No idea, sorry
Keynes , i get the same thing with you .
there is no audio in my flv file .
i’m using redhat linux , and found that the soundcard can’t be initialized correctly
again, this is a tutorial for compiling ffmpeg under windows. for such specific questions i recommend the ffmpeg-mailinglist.
how to convert avi(yuv422p mjpeg) to avi(simple profile no b frames)
how to compile ffmpeg.c under mingw studio developer?
please tell me how to setup lib or h?thx.
Hi guys — is it possible to download a copy of FFMPEG that is already compiled to have LAME enabled? It would be awesome, not sure if its possible, sorry i’m very new to this
Thanks!!
Paul
Ok so also — CODE:
cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
This part returns to me that the server is actively refusing the connection. it seems that that server is down, is there an alternative out there?
First off, thanks for sharing this. This step-by-step is awesome.
I got
MinGW-3.1.0-1
MSYS-1.0.10
lame-3.97
FFMPEG - got it from TortoiseSVN and input the link on ffmpeg(svn://svn.mplayerhq.hu/ffmpeg/trunk)(i can’t get it from step 3)
Following the steps, but got stuck when try to “make” ffmpeg with following error
mp3lameaudio.c:27:23: lame/lame.h: No such file or directory
mp3lameaudio.c:31: parse error before “lame_global_flags”
mp3lameaudio.c:31: warning: no semicolon at end of struct or union
mp3lameaudio.c:35: parse error before ‘}’ token
mp3lameaudio.c:35: warning: type defaults to `int’ in declaration of `Mp3AudioContext’
mp3lameaudio.c:35: warning: data definition has no type or storage class
mp3lameaudio.c: In function `MP3lame_encode_init’:
mp3lameaudio.c:39: `s’ undeclared (first use in this function)
mp3lameaudio.c:39: (Each undeclared identifier is reported only once
mp3lameaudio.c:39: for each function it appears in.)
mp3lameaudio.c:46: warning: implicit declaration of function `lame_init’
mp3lameaudio.c:48: warning: implicit declaration of function `lame_set_in_samplerate’
mp3lameaudio.c:49: warning: implicit declaration of function `lame_set_out_samplerate’
mp3lameaudio.c:50: warning: implicit declaration of function `lame_set_num_channels’
mp3lameaudio.c:52: warning: implicit declaration of function `lame_set_quality’
mp3lameaudio.c:54: warning: implicit declaration of function `lame_set_mode’
mp3lameaudio.c:54: `JOINT_STEREO’ undeclared (first use in this function)
mp3lameaudio.c:55: warning: implicit declaration of function `lame_set_brate’
mp3lameaudio.c:58: warning: implicit declaration of function `lame_set_VBR’
mp3lameaudio.c:58: `vbr_default’ undeclared (first use in this function)
mp3lameaudio.c:59: warning: implicit declaration of function `lame_set_VBR_q’
mp3lameaudio.c:61: warning: implicit declaration of function `lame_set_bWriteVbrTag’
mp3lameaudio.c:62: warning: implicit declaration of function `lame_init_params’
mp3lameaudio.c:65: warning: implicit declaration of function `lame_get_framesize’
mp3lameaudio.c:73: warning: implicit declaration of function `lame_close’
mp3lameaudio.c: In function `MP3lame_encode_frame’:
mp3lameaudio.c:139: `s’ undeclared (first use in this function)
mp3lameaudio.c:147: warning: implicit declaration of function `lame_encode_buffer_interleaved’
mp3lameaudio.c:155: warning: implicit declaration of function `lame_encode_buffer’
mp3lameaudio.c:165: warning: implicit declaration of function `lame_encode_flush’
mp3lameaudio.c: In function `MP3lame_encode_close’:
mp3lameaudio.c:201: `s’ undeclared (first use in this function)
make[1]: *** [mp3lameaudio.o] Error 1
make[1]: Leaving directory `/home/ffmpeg/libavcodec’
make: *** [lib] Error 2
Anyone has an idea?
My files are being converted …. but they output with a 0kb file size… none of the videos work.. but they do output to that 0kb file size.. What could be the problem?
Also I’m not really familiar with MSYS and MinGW. Using them can I compile ffmpeg so that I can used it on Debian?
Thanks for your help!
Daveren
This seems to be the best place for information on ffmpeg. Thanks Sonke!
I’m using Debian and I’m installing all my packages using apt-get. But I can’t figure out where the ffmpeg directory has been created. So I’m having a hard time trying to figure out how to configure ffmpeg to work with lame. Does anybody have any idea how to do this.
Thanks in advance for any help that anybody can provide!
Daveren
I have some problem:
ffmpeg -i xxx.3gp -ss 00:00:05 -t 00:00:01 -s 100×100 -r 1 -f jpeg image%d.jpg
I got
Unknown input or output format: jpeg
Anyone has an idea?
I am not sure but try “-f mjpeg”
Thnx, it works
[FLASH]Flash视频播放…
看了土豆的视频播放,了解了一下基于Flash的视频解决方案。大致就是把各种格式的视频上传到服务器后进行转化成flv文件,然后用Flash播放。
查了一下目前转换格式的方案,如下:
客户端…
Flash 视频(FLV)编码,转换,录制,播放方案一网打尽…
Flash 视频(FLV)编码,转换,录制,播放方案一网打尽…
Flash 视频(FLV)编码,转换,录制,播放方案一网打尽…
Collected links to Flash Video Encoding Tools …
[…] http://www.xvid.org/downloads.html http://soenkerohde.com/tutorials/ffmpeg/ […]
Flash 视频(FLV)编码,转换,录制,播放方案一网打尽…
Flash 视频(FLV)编码,转换,录制,播放方案一网打尽…
Hi,
This surely helped me lot for working in command line to create thumnail from video files
Hi dudes,
We need to convert video files into flash files.for this we are using ffmpeg.Can anyone suggest me how can we use ffmpeg in asp and in windows enviornment.we used riva encoder it woirked fine but we need to embed in our server so that whenever user uploads it will automatically will convert into .flv files.can anyone please guide me.
How to disable the version of the output filename?
as:avcodec-51.17.0.dll->avcodec.dll
In the last version it output three the same file but except the version, it must out put them? Can i only output one usefull file? THX!
Luogo interessante, buon disegno, lo gradisco, signore! =)
Is there any way you guys could put together an “idiots guide to installing ffmpeg on windows”??
This tutorial is all giberish to me
Sorry but this is free information which I produced in my freetime.
If you look for commercial consulting drop me a mail.
Hello! Thanks for this post I think it is very useful!
I have a problem converting a video to FLV. The audio is not included in flv file. Below you can find the FFMPEG output:
command: ffmpeg -i test.mpg -ab 56 -ar 22050 -b 500 -r 15 -s 320×240 test.flv
FFmpeg version SVN-r6891, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: –enable-shared –disable-static –enable-memalign-hack –enable-amr_wb –enable-amr_nb
libavutil version: 49.0.2
libavcodec version: 51.24.0
libavformat version: 51.6.0
built on Nov 6 2006 10:56:33, gcc: 3.4.5 (mingw special)
Input #0, mpeg, from ‘test.mpg’:
Duration: 00:00:01.8, start: 0.000000, bitrate: 1802 kb/s
Stream #0.0[0×1e0]: Video: mpeg1video, yuv420p, 352×288, 104857 kb/s, 25.00 fps(r)
Stream #0.1[0×1c0]: Audio: mp2, 44100 Hz, stereo, 64 kb/s
Output #0, flv, to ‘test.flv’:
Stream #0.0: Video: flv, yuv420p, 320×240, q=2-31, 0 kb/s, 15.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0 frame= 77 q=31.0 Lsize= 79kB time=5.1 bitrate= 126.4kbits/s video:78kB audio:0kB global headers:0kB muxing overhead 1.752008%
I think AMR audio codec is properly enabled because it appears when I run “ffmpeg -formats”.
Thanks for your help.
Sorry for previous question. I solved the problem. I had not mp3 lame enabled.
How come when i try to execute ./configure the console says “./configure exec: bash: not found”
Check the tutorial I linked at the beginning of my tutorial (Update …)
About Riva FLV Encoder 2.0, I’ve found a bug about ffmpeg not detecting ac3 audio format when trying to convert an mpeg to FLV vidéo.
I’ve tried with an other ffmpeg.exe but it doesn’t accept the -hq ans the quality is really poor !!!
Any idear ?
Thanks in advance
-hq is not supported in the latest ffmpeg-builds.
I am afraid this could only work if the Riva FLV Encoder get an update because -hq is set by default.
Thanks a lot Sönke for your quick answer !
Yes , I’ve seen that Riva FLV Encoder put the -hq in the command line.
For testing, I’ve remove the -hq in the file “encode.bat” generate, and then it works but the quality is really poor !!
So I’m asking me how to keep a good quality without the -hq option …
Thanks again.
Hi YannX,
sorry, but I have no idea and I would recommend your ask in the ffmpeg mailing list.
Hi,
Please help me. When i convert my movie file(wmv,mpg etc) to flv, it doesnt have a sound/audio. I already install LAME, mencoder. I follow this line:
ffmpeg -i test.mpg -ab 56 -ar 22050 -b 500 -r 15 -s 320×240 test.flv
Thanks,
mike
Please ask in the ffmpeg mailinglist.
Hi,
ok thanks, But just for an info. I think avi, wmv wont be properly converted since it is made from windows. I try to install a ffmpeg to windows and generated .flv works fine. I already triend install a LAME and MPlayer to my CENTOS box but still no sounds. Thanks anyways.
mke
Hey Guys,
When i got to ./configure ffmpeg from MSYS im returned the following error:
No compatible shell script interpreter found
The configure script requires a POSIX compatible shell such as bash or ksh
This bash version (2.04.0.(1)-release)is broken on your platform.
Upgrade to a later version if available.
Im not evern sure where to start with this…anyone help :???
Well…firstly thansk for a great tute…I got this working, at least locally.
Im trying to run this from a web server now, sending the command line option using PHP.
For some reason, its seems to work (the videos encoded!) But my browser out puts:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
I cant work this out at alll…any help?
Hi,
I did not try it but this looks promising: http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2006-October/004773.html
Hi,
thanks for this great tutorial…
Well, i needed some days to compile ffmpeg and all the needed libraries on my Windows-Machine (cause im not familar with MSYS & MINGW).
But now i’ve made my first stable build today (from SVN revision 7218) including avisynth-support and lame-mp3 encoding.
Feel free to download my build here: http://vergin.org/files/FFInstall.exe
greetings,
Dominique
nice job !
LAME installed successfully, but when I try to configure ffmpeg I get error =(
krig@KRIG-LAPTOP /ffmpeg_svn
$ ./configure –enable-memalign-hack –enable-mingw32 –enable-mp3lame –extra-
cflags=-I/local/include –extra-ldflags=-L/local/lib
No compatible shell script interpreter found.
This configure script requires a POSIX compatible shell
such as bash or ksh.
This bash version (2.04.0(1)-release) is broken on your platform.
Upgrade to a later version if available.
@krig: you have to use a bash > 2.04 for MSYS.
this one works fine: bash-3.1-MSYS-1.0.11-snapshot.tar.bz2
[…] FFMPEG Sunday 27 February 2005 @ 2:22pm […]
I tried with given command but did not found audio with
flv converted file.Can anybody help me?
Please help me!!!I have successfully compiled ffmpeg, but how can I add ,ffmpeg support(ffmpeg-php) extension to my PHP 5.1.6. I am working under Windows XP. I compiled and built ffmpeg under Msys+MingW.Please help me!!!
Hi Paul,
sorry but this is no support forum. please use the ffmpeg mailinglists for this purpose.
hi I am using ffmpeg in debian I stuck in a problem regarding conversion of 3gp, mov and avi. plzz tell me the proper command for linux.
as I am not a linux user it would make sense to ask in the ffmpeg mailinglist
great one and the code worked too.I made thumbnails and also converted movie to .flv format
[…] FFMPEG tutorial(英文) […]
[…] weblink Posted on Wednesday, March 7th, 2007 at 1:58 am In Uncategorized | Comments RSS […]
Hi,
I’m trying to use ffmpeg launching it from java. Though I’m able to use it from the command line, I receive the following error from Java
Executing c:\ffmpeg.exe -i c:\test.mov -b 40k -r 10 -s qcif -target pal-vcd c:\test.3gp
ERROR>FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
ERROR> configuration: –enable-memalign-hack –extra-cflags=-I/local/include –extra-ldflags=-L/local/lib
ExitValue: 1
ERROR> libavutil version: 49.3.0
ERROR> libavcodec version: 51.38.0
ERROR> libavformat version: 51.10.0
ERROR> built on Mar 6 2007 12:40:35, gcc: 3.2.3 (mingw special 20030504-1)
ERROR>c:\ffmpeg.exe: unrecognized option ‘-i c:\test.mov’
Please help me!!
sorry but this is no support forum. please use the ffmpeg mailinglists for this purpose.
Hi Soenke,
Great Work !! The info that u’ve published is helping me a lot.
I am a newbie to video encoding - audio encoding stuff .
I know that u’ve mentioned it a cpl of times earlier as a response that this isn’t a support forum but pls can u just write in the command to generate an flv output from two or more video[mpg ..] files using ffmpeg.
I want to concatenate two video files and write an flv output.
Any help would be greatly appreciated.
Thanks in Advance.
Kreez.
I do not know the exact command and recommend searching the ffmpeg maillinglist archive. I remember that this usecase was mentioned a few times.
[…] All three use the excellent ffmpeg tool, which is available for all major operating systems. Sönke Rohde wrote a nice tutorial on how to use it to convert videos to flash video files. Although that particular tutorial is for Windows users, it is still relevant for Mac and Linux. […]