In UbuntuLinux installed ffmpeg loaded sdl, compiled and run ffplay. c. tutorial01-08.c. The process record is as follows: 1. Install ffmpeg, is a naked, Haha, I did not load anything. If you are just getting started, there is no need to install so many options. You can add the options later. Currently, I only want to read the source code. 2. Install SDL: Because there is SDL in ubuntu, you can simply enter the following in the Command window: s
Install ffmpeg in Ubuntu Linux to load sdl, compile and run ffplay. c. tutorial01-08.c. The process record is as follows:
1. Install ffmpeg, which is a naked figure. I didn't load anything. If you are just getting started, there is no need to install so many options. You can add the options later. Currently, I only want to read the source code.
2. Install SDL:
Because SDL exists in ubuntu, you can simply enter the following in the Command window:
Sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev
Check if the SDL has been installed: sdl-config -- exec-prefix -- version -- cflags
2) ffmpeg does not talk about it anymore. There are a lot of online information and complicated steps. I installed a naked image.
Download source code
./Configure -- enable-shared -- enable-pthreads
Make
Make install
3. Compilation commands for files are complex:
Typical Example:
Gcc-o player ffplay. c cmdutils. c-I/home/han/soft/ffmpeg_src-lavformat-lavcodec-lavcore-lavdevice-lavfilter-lswscale-lavutil-I/usr/include/SDL-lSDL-lSDLmain
-Lm-lz
Or
Gcc-o tutorial07 tutorial07.c-lavformat-lavcodec-lavcore-lavdevice-lavfilter-lswscale-lavutil-lz-lm 'sdl-config -- cflags -- libs'
-Lz download:
Such errors:
/Usr/bin/ld: cannot find-lz
Collect2: ld returned 1 exit status
This is because the libz library is missing
I solved it like this: Enter the: apt-get install zlib1g-dev directly in the namespace
/Usr/bin/ld: cannot find-l * error solution ......
You can solve this problem by using this method (this is the case when I come across several ):
Yum-y install libtool-l *
For example:
/Usr/bin/ld: cannot find-lltdl
Solution:
Yum-y install libtool-ltdl *
-Lm: internal libraries of some mathematical formulas and other systems.
When the ffmpeg tutorial is compiled, the rint function error occurs: you only need to comment it out:
/*
Int rint (int x)
{
Return (int) (x + (x <0? -0.5: 0.5 ));
}
*/
Additional: it is best to test the movie. mpg file.