FFmpeg学习问题集合记录

1.FFmpeg源码编译之后未生成ffplay。

a.参照其他网站个人使用修改Makefile对应的config.mak中的CONFIG_FFPLAY 为Yes未生效。

b.参考http://blog.chinaunix.net/uid-11344913-id-3936227.html  未完全生效

    1. wget http://libsdl.org/release/SDL-1.2.15.tar.gz  下载最新版
    2. tar zxvf SDL-1.2.15.tar.gz
    3. cd SDL-1.2.15
    4. ./configure --prefix=/usr
    5. make -j16
    6. 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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值