ffmpeg(二) 网络流转发
来源:互联网 发布:java while和do while 编辑:程序博客网 时间:2024/06/14 04:27
一种网络流转成另外一种流
先解决一个bug
在打开输入时如果摄像头没打开会一直卡死在avformat_open_input()函数这
int64_t lastReadPacktTime;
static int interrupt_cb(void *ctx)
{
int timeout=10;
if(av_gettime()-lastReadPacktime>timeout*1000*1000)
{
return -1;
}
return 0;
}
int OpenInput(string inputUrl)
{
lastReadPacktTime=av_getttime();//返回当前时间 单位微秒
inputContext->interrupt_callback.callback=interrupt_cb;//一个函数指针
int ret=avformat_open_input();
}
这个函数写的很好callback 函数指针这种方法可以预留接口
结构体里面加上函数指针
//读包的时候也要加上
av_init_packet(packet.get());
lastReadPacktTime=av_getttime();//返回当前时间 单位微秒
——————————————————————————————————
这种URL 改成对应协议就好了
//这个函数注意第三个参数 超级恶心,
//网络流转发这种
avio_open2( , ,AVIO_FLAG_WRITE)
————————————————————————————————
局域网的延时在500毫秒至1秒以内—————————————————————————————————————————————
ffmeg 一些命令
ffmpeg -i url -vcodec copy -acodec copy -f mpegts D:\
ffmpeg -i url -vcodec copy -acodec copy -f flv rtmp://127.0.0.1
- ffmpeg(二) 网络流转发
- EasyDarwin Rtsp流转发(二)
- FFMPEG对RTP直播流转发的实现
- FFMPEG对RTP直播流转发的实现
- EasyDarwin Rtsp流转发(一)
- EasyDarwin Rtsp流转发(三)
- Tcp/Ip网络要点(一)本地数据流转
- 用VLC读取摄像头产生RTSP流,DSS主动取流转发(一)
- 用VLC读取摄像头产生RTSP流,DSS主动取流转发(一)
- 用VLC读取摄像头产生RTSP流,DSS主动取流转发(一)
- QT+ffmpeg(二)
- ffmpeg编译(二)
- ffmpeg入门(二)
- FFmpeg学习(二)
- Symbian发短信(二)
- FFMPEG源码分析(二)
- FFMPEG源码分析(二)
- ffmpeg水印制作(二)
- Android 保存图片到SQLite,读出SQLite中的图片
- 【CodeForces500B】【贪心】New Year Permutation 题解
- Mybatis知识点备忘
- Spring事务的隔离级别
- 引用数组,指针数组与数组引用,数组指针
- ffmpeg(二) 网络流转发
- 寻找两个链表的第一个公共结点
- 写个swiper小demo
- SqlHelper
- linux init.rc service name 过长导致服务不可用的问题
- 数据结构学习(五)——线性表
- 乱序数组元素一升一降
- ajax调用php传过来的json数据
- windows下pip install wordcloud 的关于vc++错误解决