【问题标题】:FFMPEG error while receiving rtsp stream接收 rtsp 流时出现 FFMPEG 错误
【发布时间】:2014-05-19 08:59:30
【问题描述】:

我从 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   

【问题讨论】:

  • 我在输出中看到了几个错误。首先,它似乎无法连接到您的 PulseAudio 服务器 - 检查它是否正在运行 ps ax|grep -i pulse ffmpeg 似乎也不知道您的视频大小 - 使用 -s WxH 指定。
  • 它看起来像pulseaudio工作......也已弃用-s并且找不到-video_size;(
  • 脉冲音频问题可能是因为您是 root。以拥有 X-Server 会话的普通用户身份尝试视频/音频。
  • 是的,我使用了 sudo 及其 disappera,但 -s 仍然存在问题。主要问题是[rtsp @ 0xb4b004a0] UDP timeout, retrying with TCPsq= 0B f=0/0 [rtsp @ 0xb4b004a0] method PAUSE failed: 501 Not Implemented

标签: linux ffmpeg rtsp


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2012-05-29
    • 2018-02-05
    • 1970-01-01
    • 1970-01-01
    • 2015-10-05
    • 2016-09-11
    • 2015-08-24
    • 2014-10-11
    • 1970-01-01
    相关资源
    最近更新 更多