【发布时间】:2014-01-28 10:56:36
【问题描述】:
我想使用 ffmpeg libavcodec 从 UDP 地址(如 udp://:1500)读取视频流。我正在使用此代码:
char *url = "udp://:1500";
char *format = "mpegts";
AVInputFormat *fmt = NULL;
AVFormatContext *oc = NULL;
int res;
fmt = av_find_input_format(format);
res = avformat_open_input(&oc, url, fmt , NULL);
if(res!=0){
printf("Could not open the stream\n");
exit(1);
}
但是当我运行这段代码时,程序在执行 res = avformat_open_input(&oc, url, fmt , NULL); 后永远停止。
你知道是什么问题吗?
【问题讨论】:
标签: ffmpeg udp libavcodec