接收rtsp流时出现FFMPEG错误 [英] FFMPEG error while receiving rtsp stream

查看:178
本文介绍了接收rtsp流时出现FFMPEG错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从IPCam Edimax IC-3030接收rtsp流时出现错误,我不知道该怎么办.谁能帮助我或向我展示解决方案?

I got error with receiving rtsp stream from IPCam Edimax IC-3030 and I don't know what to do. Can anyone help me or show me a way to solution ?

/home/prog12# ffplay "rtsp://192.168.1.7/ipcam_h264.sdp"
ffplay version 2.1.4 Copyright (c) 2003-2014 the FFmpeg developers
built on Mar 22 2014 18:16:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-      libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable- libxvid --enable-x11grab --enable-libvpx --enable-libmp3lame

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied

 [rtsp @ 0xb0c006c0] UDP timeout, retrying with TCPsq=    0B f=0/0   
 [rtsp @ 0xb0c006c0] method PAUSE failed: 501 Not Implemented
 [rtsp @ 0xb0c006c0] Could not find codec parameters for stream 0 (Video: h264): unspecified size
 Consider increasing the value for the 'analyzeduration' and 'probesize' options
 Input #0, rtsp, from 'rtsp://192.168.1.7/ipcam_h264.sdp':
 Metadata:
title           : IPCam
 Duration: N/A, bitrate: 64 kb/s
Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
SDL_OpenAudio (1 channels): 
No more channel combinations to try, audio open failed
[rtsp @ 0xb0c006c0] UDP timeout, retrying with TCPsq=    0B f=0/0   
[rtsp @ 0xb0c006c0] method PAUSE failed: 501 Not Implemented
[rtsp @ 0xb0c006c0] UDP timeout, retrying with TCPsq=    0B f=0/0   
[rtsp @ 0xb0c006c0] method PAUSE failed: 501 Not Implementedf=0/0   
[rtsp @ 0xb0c006c0] UDP timeout, retrying with TCPsq=    0B f=0/0   
[rtsp @ 0xb0c006c0] method PAUSE failed: 501 Not Implemented
nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   
nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   
nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   
nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   
nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   

那是输出.

编辑

ps ax| grep -i pulse 
8904 ?        S<l    0:01 /usr/bin/pulseaudio --start --log-target=syslog
10369 pts/1    S+     0:00 grep --color=auto -i pulse

对于新命令:

sudo ffplay -video_size 640x480 "rtsp://192.168.1.7/ipcam_h264.sdp"
ffplay version 2.1.4 Copyright (c) 2003-2014 the FFmpeg developers
built on Mar 22 2014 18:16:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-libmp3lame

Option video_size not found.aq=    0KB vq=    0KB sq=    0B f=0/0   

推荐答案

遇到此类错误时,您应尝试强制ffmpeg仅使用TCP连接-我认为从UDP切换到TCP时ffmpeg试图暂停流,可能会发生什么情况?IPCam不支持像Edimax IC 3030这样的IPCam.

When you meet such error You should try to force ffmpeg to use only TCP connection - I believe that when switching from UDP to TCP ffmpeg tried to pause stream what may not be supported by IPCam like Edimax IC 3030 .

这是代码的精髓:

AVDictionary *opts = 0;
av_dict_set(&opts, "rtsp_transport", "tcp", 0);
avformat_open_input( &FormatContext, path.c_str(), NULL, &opts )

这篇关于接收rtsp流时出现FFMPEG错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆