多媒体

warning: Creating default object from empty value in /srv/www/blog.sqlitedeveloper.com/www/modules/i18n/i18ntaxonomy/i18ntaxonomy.pages.inc on line 34.

使用ffmpeg创建aes加密的hls视频码流

1. 生成秘钥
命令行下执行
>openssl rand -out file.key 16

2. 编辑aes key信息文件file.keyinfo,文件内容如下
http://www.flashavconverter.com/downloads/file.key
file.key

第一行是用来嵌入到生成的m3u8文件的key的下载地址,步骤1生成的file.key需要上传到webserver,可以通过http://xxx.xxx.xxx/file.key下载
第二行指向步骤1生成的本地文件file.key。
3. 使用下面ffmpeg命令生成aes加密的hls码流
ffmpeg -i 1.flv -hls_time 100 -hls_key_info_file file.keyinfo -hls_list_size 100 aes.m3u8

上面1.flv是输入的要加密的视频文件名 hls_time 100表示生成的视频片段是100秒间隔的,hls_key_info_file指向步骤2创建的key信息文件,hls_list_size指定最大的hls片段数,可以设置比较大的数目,否则生成的m3u8里面会缺少文件,默认值好像只有3吧。

4. 上传生成好的文件到你的webserver下面,设置允许外部读取的权限

使用gclient 同步webrtc代码

用法帮助 gclient help

修复错误
gclient sync -R
glcient revert

取特定版本

gclient sync -r src@968c9ccfe80f6f0d64991d5e997ce74774381dfa

切换编译版本是相当的慢,要下载好几G的chrome的代码

Webrtc ice错误解决办法

janus-gateway 连接时有时会报告ice failed,或者dtls timeout错误

1.首先确认stun server设置

vi /usr/local/etc/janus/janus.cfg

[nat]
;public_ip = 1.2.3.4
stun_server = stun.l.google.com
stun_port = 19302

注意google的stun从中国访问不了,可以改用stun.voipstunt.com

2.确认stun server的连通,用https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
来测试,这个也可以用来测试turn server,返回的信息一般是

0.001 1 host 1947478017 udp 172.16.100.20 62003 126 | 30 | 255
0.002 1 host 161342690 udp 2001::4137:9e76:38a4:dbe:745d:8c18 62004 126 | 10 | 255
0.002 2 host 1947478017 udp 172.16.100.20 62005 126 | 30 | 254

NV12和YV12的区别

FFMPEG Vcl Pack For Delphi 2.2发布了

新版的FFMPEG Vcl Pack增加了DirectShow设备俘获和音频过滤器的初步支持 (Beta)

下载地址:http://www.flashavconverter.com/downloads/ffmpegvcldemo221.zip
 

H264相关的一些资源

同步内容