I have read many posts on compiling FFMPEG for wince on the Internet, but I am still confused by a newbie like me.
After several days of research, I learned something about it and shared it. I believe that according to my steps, the DLL can be compiled.
Environment: cygwin is used in Windows XP. If cygwin is not used, please google it. I will not talk about it here.
The compiler uses an cygwin-cegcc-mingw32ce-0.51.0-1 that can be downloaded on SourceForge.
Source code: I use ffmpeg-export-2008-09-03, can be downloaded on the FFMPEG official website.
The following is the beginning:
1. Unzip the cygwin-cegcc-mingw32ce-0.51.0-1 to cygwin installation directory, if the installation directory in cygwin is C:/cygwin,
After decompression, the cegcc directory should be C:/cygwin/opt/mingw32ce.
2. Extract the source code, wherever you want, assuming C:/ffmpeg-export-2008-09-03
3. Open cygwin, enter the source directory, such as CD/cygdrive/C/ffmpeg-export-2008-09-03
4. Modify the path and enter Path =/opt/mingw32ce/bin: $ path in the command line.
5. Start compilation and enter the following configure options:
./Configure -- enable-memalign-hack -- target-OS = mingw32ce -- arch = arm -- enable-Cross-compile/
-- Cross-Prefix = arm-wince-mingw32ce--- enable-small/
-- Enable-static -- enable-shared/
-- Disable-MMX -- disable-zlib -- disable-ipv6 -- disable-Debug/
-- Disable-FFMPEG -- disable-ffserver -- disable-ffplay/
-- Disable-encoders -- disable-Network -- disable-muxers -- disable-decoders -- disable-filters/
-- Disable-demuxers -- disable-devices -- disable-protocols -- disable-BSFs -- disable-parsers/
-- Enable-decoder = MPEG4/
-- Enable-decoder = h264 -- extra-cflags = "-March = armv4-mtune = XScale"
6. Open C:/cygwin/opt/mingw32ce/arm-wince-mingw32ce/include/errno. h
Delete 11 rows // # ifdef _ coredll __
12 rows // # include_next <errno. h>
13 rows/# else/* _ coredll __*/
Row 3/# endif/* Not _ coredll __*/
Then, enter libavutil, libavcodec, libavformat, and make respectively in order to obtain the DLL and Lib.
7. At this time, the Lib file cannot be used directly in vs2005 or vs2008. To use it, you can use the tool Lib in vs to generate it.
See http://www.geocities.com/yongweiwu/stdcall.htm for details
8. Finally, if you want to use the file in a C ++ project, you need to modify the header file and add extern "C "{};
9. Enjoy it!