Ffmpeg开发FAQ集
From Ffmpeg工程组
目录 |
[编辑] ffmpeg开发基本问题
- When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?
Like most open source projects FFmpeg suffers from a certain lack of manpower. For this reason the developers have to prioritize the work they do and putting out releases is not at the top of the list, fixing bugs and reviewing patches takes precedence. Please don't complain or request more timely and/or frequent releases unless you are willing to help out creating them.
- Why doesn't FFmpeg support feature [xyz]?
Because no one has taken on that task yet. FFmpeg development is driven by the tasks that are important to the individual developers. If there is a feature that is important to you, the best way to get it implemented is to undertake the task yourself.
- Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat ?
Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively, examine the source code for one of the many open source projects that already incorporate ffmpeg at (projects.php).
- I do not like the LGPL, can I contribute code under the GPL instead ?
Yes, as long as the code is optional and can easily and cleanly be placed under #ifdef CONFIG_GPL without breaking anything. So for example a new codec or filter would be OK under GPL while a bugfix to LGPL code would not.
[编辑] ffmpeg开发编译器问题
- Can you support my C compiler XXX ?
No. Only GCC is supported. GCC is ported to most systems available and there is no need to pollute the source code with #ifdefs related to the compiler.
- Can you add automake, libtool or autoconf support ?
No. These tools are too bloated and they complicate the build. Moreover, since only `gcc' is supported they would add little advantages in terms of portability.
- Why not rewrite ffmpeg in object-oriented C++ ?
ffmpeg is already organized in a highly modular manner and does not need to be rewritten in a formal object language. Further, many of the developers favor straight C; it works for them. For more arguments on this matter, read "Programming Religion" at (http://lkml.org/faq/lkmlfaq-15.html).
- I want to compile xyz.c alone but my compiler produced many errors.
Common code is in its own files in libav* and is used by the individual codecs. They will not work without the common parts, you have to compile the whole libav*. If you wish, disable some parts with configure switches. You can also try to hack it and remove more, but if you had problems fixing the compilation failure then you are probably not qualified for this.
- Visual C++ produces many errors.
Visual C++ is not compliant to the C standard and does not support the inline assembly used in FFmpeg. If you wish - for whatever weird reason - to use Visual C++ for your project then you can link the Visual C++ code with libav* as long as you compile the latter with a working C compiler. For more information, see the Visual C++ compatibility section in the FFmpeg documentation.
There have been efforts to make FFmpeg compatible with Visual C++ in the past. However, they have all been rejected as too intrusive, especially since MinGW does the job perfectly adequately. None of the core developers work with Visual C++ and thus this item is low priority. Should you find the silver bullet that solves this problem, feel free to shoot it at us.
[编辑] ffmepg开发平台问题
- Can I use FFmpeg or libavcodec under Windows ?
Yes, but the MinGW tools must be used to compile FFmpeg. You can link the resulting DLLs with any other Windows program. Read the Native Windows Compilation and Visual C++ compatibility sections in the FFmpeg documentation to find more information.
- Why are the ffmpeg programs devoid of debugging symbols ?
The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug information. Those binaries are strip'd to create ffmpeg, ffplay, etc. If you need the debug information, used the *_g versions.
[编辑] ffmpeg应用于DirectShow
- ffmpeg应用于DirectShow Filter连接出错解决办法
- 经过一天的努力,终于将ffmpeg应用于DirectShow的Filter中,遇到的主要问题是不能正常Link ffmpeg导出库中的函数,如在代码中加入av_register_all();则在编译连接时就会出错:error LNK2001: unresolved external symbol _av_register_all@0,库已经加入了工程中,但就是Link不成功,后面还是ffmpeg工程组中的“胶东农民”搞定了这个问题,那就是在VC的"project setting"中选择“ c/c++”选项卡,然后在下拉菜单中选择“Code Generation”,将“calling convention“中的"__stdcall"改为” __cdecl *“,编译通过!
- 该问题的详细内容参考ffmepg工程组论坛:ffmpeg应用于DirectShow Filter连接出错解决办法
[编辑] ffmpeg深入开发问题
- 关于解码后的data与linesize的关系
- 关于用gprof分析ffmpeg的问题
ffmpeg中的configure中有一个--disable-strip的开关,如果想用gprof来分析ffmpeg的话,需要将这个开关打开,然后再make,make install就没有问题 了。使用的时候只是加了--disable-strip这个开关,并且在所有的Makefile文件里加入了-pg的选项,就可以了。
有关该问题的讨论帖可参考ffmpeg工程组论坛中的相关讨论:
有关关于用gprof分析ffmpeg的问题的讨论
