iOS使用ffmpeg播放rstp实时监控视频数据流
一、编译针对iOS平台的ffmpeg库(kxmovie)
git clone git://github.com/kolyvan/kxmovie.git
cd kxmovie
git submodule update --init
rake
CoreAudio, AudioToolbox, Accelerate, QuartzCore, OpenGLES and libz.dylib,libiconv.dylib
libavcodec.a, libavformat.a, libavutil.a, libswscale.a, libswresample.a
ViewController *vc;
vc = [KxMovieViewController movieViewControllerWithContentPath:path parameters:nil];
[self presentViewController:vc animated:YES completion:nil];
[rtsp @ 0x906cc00]
UDP timeout, retrying with TCP
[rtsp
@ 0x906cc00] Nonmatching transport in server reply
[rtsp @ 0x906cc00]
Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing
the value for the 'analyzeduration' and 'probesize' options
Couldn't find stream
information
跟踪代码,错误是在avformat_find_stream_info获取流信息失败的时候的时候触发。
if(avformat_find_stream_info(pFormatCtx,NULL)
< 0)
{
av_log(NULL, AV_LOG_ERROR, "Couldn't
find stream information\n");
goto initError;
}
)。详细原因预计是rstp视频流。程序默认採用udp传输或者组播,导致在私有网络视频流不能正常传输。……
// Open video file
pFormatCtx = avformat_alloc_context();
//有三种传输方式:tcp udp_multicast
udp,强制採用tcp传输
AVDictionary*
options = NULL;
av_dict_set(&options, "rtsp_transport", "tcp", 0);
if(avformat_open_input(&pFormatCtx,
[moviePathcStringUsingEncoding:NSASCIIStringEncoding],
NULL,&options)
!= 0)
{
av_log(NULL, AV_LOG_ERROR, "Couldn't
open file\n");
goto initError;
}
// Retrieve stream information
if(avformat_find_stream_info(pFormatCtx,NULL)
< 0)
{
av_log(NULL, AV_LOG_ERROR, "Couldn't
find stream information\n");
goto initError;
}
iOS使用ffmpeg播放rstp实时监控视频数据流的更多相关文章
- 用Red5搭建支持WEB播放的实时监控视频
用Red5搭建支持WEB播放的实时监控视频 1. 下载Red5:https://github.com/Red5/red5-server/releases 下载了Red5 1.0.6 release的Z ...
- ios webview 只能播放带域名的视频连接好奇怪!
- (void)loadWebView { UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(, , SCREEN_WI ...
- 前端Web浏览器基于Flash如何实时播放监控视频画面(前言)之流程介绍
[关键字:前端浏览器如何播放RTSP流画面.前端浏览器如何播放RTMP流画面] 本片文章只是起到抛砖引玉的作用,能从头到尾走通就行,并不做深入研究.为了让文章通俗易懂,尽量使用白话描述. 考虑到视频延 ...
- 前端Web浏览器基于Flash如何实时播放监控视频画面(四)之使用videoJs‘拉流’
本片文章只是起到抛砖引玉的作用,能从头到尾走通就行,并不做深入研究.为了让文章通俗易懂,尽量使用白话描述. 0x001: 下载videoJs 对于Video.js 5.x及更低版本,Flash技术(v ...
- iOS开发----音频播放、录音、视频播放、拍照、视频录制
随着移动互联网的发展,如今的手机早已不是打电话.发短信那么简单了,播放音乐.视频.录音.拍照等都是很常用的功能.在iOS中对于多媒体的支持是非常强大的,无论是音视频播放.录制,还是对麦克风.摄像头的操 ...
- 基于Red5与ffmpeg实现rtmp处理NVR或摄像头的监控视频处理方案
背景 各大监控视频平台厂商与外对接均是基于IE的OCX插件方式提供实时视频查看.历史视频回放与历史视频下载.在h5已大行其道的当下,基于IE的OCX插件方式已满足不了广大客户的实际需求,因此需要一个兼 ...
- Java实现Android,iOS设备实时监控
Java实现Android设备实时监控 设计思路: 第一,启动一个实时截图线程,负责实时截取Android设备屏幕,保存到本地路径. 第二,在JSP页面,定义一个img对象,实时更换img对象的src ...
- 小程序升级实时音视频录制及播放能力,开放 Wi-Fi、NFC(HCE) 等硬件连接功能
“ 小程序升级实时音视频录制及播放能力,开放 Wi-Fi.NFC(HCE) 等硬件连接功能.同时提供按需加载.自定义组件和更多访问层级等新特性,增强了第三方平台的能力,以满足日趋丰富的业务需求.” 0 ...
- iOS - 使用MPMoviePlayerController播放在线视频
一 MPMoviePlayerController 简介 在iOS中播放视频可以使用MediaPlayer.framework种的MPMoviePlayerController类来完成,它支持本地视频 ...
随机推荐
- 【HDU 4547 CD操作】LCA问题 Tarjan算法
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4547 题意:模拟DOS下的cd命令,给出n个节点的目录树以及m次查询,每个查询包含一个当前目录cur和 ...
- tomcat配置访问日志,访问首页主目录
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" ...
- Safari HTML5 Canvas Guide: Creating Charts and Graphs
Safari HTML5 Canvas Guide: Creating Charts and Graphs Bar graphs are similar to data plots, but each ...
- Xshell不能连接SSH的解决
异常处理汇总-服 务 器 http://www.cnblogs.com/dunitian/p/4522983.html 重新启动看看:/etc/init.d/ssh restart (/etc/ini ...
- [AC自动机][HDU3065]
//====================== // HDU 2222 // 求目标串中出现了几个模式串 //输入 //1 //5 //she //he //say //shr //her //ya ...
- visual studio 2010 C语言声明异常
如下这段程序,是C_Primer_plus_第五版内的一个复习题答案(感觉声明i的值有问题),在GCC上面可以运行,但是移植到VS2010就一堆错误, #include<stdio.h> ...
- php中的short_open_tag的作用
在php的配置文件(php.ini)中有一个short_open_tag的值,开启以后可以使用PHP的段标签:(<? ?>). 同时,只有开启这个才可以使用 <?= 以代替 < ...
- bootstrap使用中遇到的问题(二)
1.ie8不支持carousel组件, 解决方法:将jquery换为jquery1版本,具体原因不清楚~~~~~ 2.ie8不支持background-color:rgba(); 解决方法:这样写代码 ...
- 关于ASP.NET 中站点地图sitemap 的使用
在ASP.NET MVC 如此火热的时期,我竟然不适时宜的谈起ASP.NET ,恐怕会引来一阵嘲笑.最为无趣的是,讲解的竟然还是其中的一个控件.oh~~ my god!my out! ^_^ Si ...
- PHP学习笔记十三【二维数组】
<?php //二维数组 $arr=array(array(1,2,3),array(4,5,6)); $arr1[0]=array(12,34,65); $arr1[1]=array(34,6 ...