接收rtsp流时出现FFMPEG错误

时间:2014-04-07 08:16:16

标签: linux ffmpeg rtsp

从IPCam Edimax IC-3030接收rtsp流时出错,我不知道该怎么做。任何人都可以帮助我或给我一个解决方案吗?

/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   

1 个答案:

答案 0 :(得分:0)

当你遇到这样的错误你应该尝试强制ffmpeg只使用TCP连接 - 我相信当从UDP切换到TCP时ffmpeg试图暂停流,这可能是IPCam可能不支持的,如Edimax IC 3030。

这是代码的一部分:

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