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。
有需要电子邮件