编译ffmpeg
启用libx264
./configure --enable-libx264 --enable-gpl --enable-shared
参考
http://maczulu.blogspot.com/2011/11/ffmpeg install with libx264 h264 on.html
问题1
yasm/nasm not found or too old. Use --disable-yasm for a crippledbuild错误
安装ffmpeg过程中,执行./configure时,报yasm/nasm not found or too old. Use --disable-yasm for a crippledbuild错误,分析、解决如下:
分析:yasm是汇编编译器,ffmpeg为了提高效率使用了汇编指令,如MMX和SSE等。所以系统中未安装yasm时,就会报上面错误。
解决:安装yasm编译器。安装方法如下:
在http://www.tortall.net/projects/yasm/releases下面找到适合自己平台的yasm版本。然后进行安装。举例如下:
1)下载:wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
2)解压:tar zxvf yasm-1.3.0.tar.gz
3)切换路径: cd yasm-1.3.0
4)执行配置: ./configure
5)编译:make
6)安装:make install
参考自
https://blog.csdn.net/yzhang6_10/article/details/75635734
pc客户端flash播放环境搭建
https://www.cnblogs.com/tinywan/p/6692098.html
https://github.com/mangui/flashls
https://github.com/videojs/videojs flash
直接搭建 HLS 加密服务
https://github.com/arut/nginx rtmp module/wiki/Directives#hls_keys
安装好了ffmpeg后,如果你使用ffmpeg工具去把某个视频文件转成h264视频编码、mp3音频编码or其他ffmpeg自身不带的xxx编码类型,就会看到报错信息,unknown encoder 'xxx'。此刻你需要的只要去安装其他的编码器就行了,本质上其实是把其他的编码器以库的形式安装好,例如,把正确的libx264.so or libx264.a存放在/usr/lib下 or /usr/local/lib下。
ffmpeg安装第三方编码器(encoder)库,ffmpeg编码h264(完)
https://my.oschina.net/michaelyuanyuan/blog/68616
步骤
获取、编译、安装x264
git clone git://git.videolan.org/x264.git
cd ~/x264
./configure --enable-shared --enable-static
make && sudo make install
获取编辑安装 mp3lame
https://sourceforge.net/projects/lame/files/lame/3.100/lame 3.100.tar.gz
https://sourceforge.net/projects/lame/files/lame/3.100/lame 3.100.tar.gz
tar -xvf lame_3.100.tar.gz
cd ~/lame_3.100.tar.gz
./configure
make && sudo make install
重新编译ffmpeg
./configure --enable-gpl --enable-libx264 --enable-libmp3lame
make clean && make && make install
出现 ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory的解决方法
https://www.jianshu.com/p/277fc2300f1e
通过建立软连接
ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib64/libmp3lame.so.0
將 MP4 儲存為 AES 加密及如何播放
cd /tmp
openssl rand 16 > file.key
echo file.key >> file.keyinfo
openssl rand -hex 16 >> file.keyinfo
file.key 為一二進制檔案
启动编译
ffmpeg -i 1.mp4 -hls_time 10 -hls_list_size 0 -hls_key_info_file file.keyinfo ./test_aes/out.m3u8