构建一个实时播放的TCP协议的stream实例

1. tcp文件命名为stream_tcp.c,放置在stream目录下。

2. 将stream_udp.c的代码拷贝到文件中。

3. 构建一个新的stream_info_t实例stream_info_tcp_extern:

stream_info_t stream_info_tcp_extern = {
  "H.264 over TCP streaming",
  "tcp",
  "J.B.Song",
  "native tcp support",
  tcp_stream_open_extern,
  { "tcp", NULL},
  NULL,
  0 // Urls are an option string
};

 

同时需要将stream.c中的表示stream的数组auto_open_streams[]的数组增加一个成员:

 

extern stream_info_t stream_info_tcp_extern;

stream_info_t* auto_open_streams[]中 = {
/*tcp */
  &stream_info_tcp_extern,

 

错误:

Win32 LoadLibrary failed to load: avisynth.dll, /usr/local/lib/codecs/avisynth.dll, /usr/lib/win32/avisynth.dll, /usr/local/lib/win32/avisynth.dll
怀疑解码器不对,下载外置的解码器

 

事实证明上述操作是错误的。

4. 由于所购建的流需要解析文件头,使用实时播放的时候由于采用了UDP协议的方式进行,不能保存文件头造成不能正确解析格式。

将文件头保存下来,里利用其中的seek和read函数进行转换,可以完成。

 

OK。

有需要电子邮件

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值