1.FFmpeg源码编译之后未生成ffplay。
a.参照其他网站个人使用修改Makefile对应的config.mak中的CONFIG_FFPLAY 为Yes未生效。
b.参考http://blog.chinaunix.net/uid-11344913-id-3936227.html 未完全生效
-
- wget http://libsdl.org/release/SDL-1.2.15.tar.gz 下载最新版
- tar zxvf SDL-1.2.15.tar.gz
- cd SDL-1.2.15
- ./configure --prefix=/usr
- make -j16
- sudo make install
c.参考http://www.linuxfromscratch.org/blfs/view/cvs/multimedia/sdl2.html 安装sdl2./configure --prefix=/usr && make
sudo make install
最终,下载安装sdl2之后,再次切换ffmpeg根目录./configure --enable--ffplay
make,make install 成功编译生成ffplay。
由于,ffmpeg中configure中ffplay依赖于CFLAGS-ffplay=${sdl2_cflags},ffplay_deps="avcodec avformat swscale swresample sdl2",配置期间会去检测sdl2,没有的话,则不生成ffplay。
disabled sdl && disable sdl2
if ! disabled sdl2; then
SDL2_CONFIG="${cross_prefix}sdl2-config"
if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
check_func SDL_Init $sdl2_extralibs $sdl2_cflags && enable sdl2
else
if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
check_func SDL_Init $sdl2_extralibs $sdl2_cflags && enable sdl2
fi
fi
if test $target_os = "mingw32"; then
sdl2_extralibs="$sdl2_extralibs -mconsole"
fi
fi
enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs $sdl2_extralibs
2.简单demo,编译失败。
#include<libavcodec/avcodec.h>
int main(int argc,char* argv[])
{
printf("%s",avcodec_configuration());
return 0;
}
遇到的错误。undefined reference to `avcodec_configuration'
参考http://www.cnblogs.com/pengdonglin137/p/5092335.html 多处失败,几年不搞C,编译规则都忘了,有问题直接搜索。。。
Makefile missing separator. Stop. https://stackoverflow.com/questions/18936337/makefile1-missing-separator-stop 命令前需要tab键
undefined reference to `pthread_create' 编译增加-lpthread
undefined reference to 'dlclose' https://stackoverflow.com/questions/956640/linux-c-error-undefined-reference-to-dlopen 编译增加 -ldl
Undefined reference to `pow' and `floor' https://stackoverflow.com/questions/8671366/undefined-reference-to-pow-and-floor 编译增加-lm
在下面的makefile基础上,做以上修改。最终编译成功。。。
Makefile的内容如下:参考http://www.cnblogs.com/pengdonglin137/p/5092335.html
3.m3u8转mp4过程 “Protocol ‘https’ not on whitelist ‘file,crypto’!”
更新容器协议白名单: -protocol_whitelist “file,http,https,tcp,tls”
示例:
ffmpeg -protocol_whitelist "file,http,https,tcp,tls" -i playlist.f3.m3u8 -vcodec copy -acodec copy -absf aac_adtstoasc test2.mp4