linux - 接收 rtsp 流时 FFMPEG 错误

标签 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   

最佳答案

当您遇到此类错误时,您应该尝试强制 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 )

关于linux - 接收 rtsp 流时 FFMPEG 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22906973/

相关文章:

h.264 - RTSP 上音频和视频的相同媒体格式

OpenCV - RTSP 流未打开

c++ - 在 macos 中热用 gdb

linux - ffmpeg 从 Linux 管道读取图像路径时显示 "No JPEG data found in image"

ffmpeg - libavfilter 缩略图似乎只处理第一组 N 帧

ffmpeg - 如果相同,为什么 ffmpeg m4a → mp4 文件大小会减少 60%?

java - RTSP服务器java实现问题:(

node.js - 加载共享库 libnode.so.72 时出现 Node 错误

linux脚本简单算术代码

linux - htaccess 将子文件夹重定向到子域