【问题标题】:Android 2.3, 4.0 rtsp video streaming error: no video, but audioAndroid 2.3、4.0 rtsp 视频流错误:没有视频,但有音频
【发布时间】:2012-02-27 08:59:46
【问题描述】:

我在播放流视频时遇到问题。

在 HTC Desire 2.2 上视频播放良好,没有问题 但在 Nexus One 2.3.4 和 Nexus S 4.0.3 上,我只有音频,但没有显示视频

这是在 N1 和 NS 上存在相同问题的块日志

02-27 11:42:30.914: W/MyHandler(116): Unsupported format. Ignoring track #2.
02-27 11:42:30.914: I/MyHandler(116): SETUP(2) completed with result -1010 (Unknown error: 1010)

完整日志:

02-27 11:42:20.634: I/MyHandler(116): connection request completed with result 0 (Unknown error: 0)
02-27 11:42:20.664: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:20.674: I/MyHandler(116): DESCRIBE completed with result 0 (Unknown error: 0)
02-27 11:42:20.674: I/ASessionDescription(116): v=0
02-27 11:42:20.674: I/ASessionDescription(116): o=- 952000 952000 IN IP4 178.124.133.2
02-27 11:42:20.674: I/ASessionDescription(116): s=WowzaMediaServer
02-27 11:42:20.674: I/ASessionDescription(116): i=<No author> <No copyright>
02-27 11:42:20.674: I/ASessionDescription(116): c=IN IP4 0.0.0.0
02-27 11:42:20.674: I/ASessionDescription(116): t=0 0
02-27 11:42:20.674: I/ASessionDescription(116): a=SdpplinVersion:1610641560
02-27 11:42:20.674: I/ASessionDescription(116): a=StreamCount:integer;2
02-27 11:42:20.674: I/ASessionDescription(116): a=control:*
02-27 11:42:20.674: I/ASessionDescription(116): a=LiveStream:integer;1
02-27 11:42:20.674: I/ASessionDescription(116): a=Title:buffer;"V293emFNZWRpYVNlcnZlcg=="
02-27 11:42:20.674: I/ASessionDescription(116): a=range:npt=0-
02-27 11:42:20.674: I/ASessionDescription(116): a=tool:libavformat 53.5.0
02-27 11:42:20.674: I/ASessionDescription(116): m=audio 7234 RTP/AVP 97
02-27 11:42:20.674: I/ASessionDescription(116): b=AS:72
02-27 11:42:20.674: I/ASessionDescription(116): b=TIAS:64000
02-27 11:42:20.674: I/ASessionDescription(116): b=RR:1280
02-27 11:42:20.674: I/ASessionDescription(116): b=RS:640
02-27 11:42:20.674: I/ASessionDescription(116): a=maxprate:16.000000
02-27 11:42:20.674: I/ASessionDescription(116): a=control:streamid=1
02-27 11:42:20.674: I/ASessionDescription(116): a=range:npt=0-
02-27 11:42:20.674: I/ASessionDescription(116): a=length:npt=0
02-27 11:42:20.674: I/ASessionDescription(116): a=rtpmap:97 MP4A-LATM/44100/2
02-27 11:42:20.684: I/ASessionDescription(116): a=fmtp:97 profile-level-id=41;cpresent=0;config=400024203fc0
02-27 11:42:20.684: I/ASessionDescription(116): a=mimetype:string;"audio/MP4A-LATM"
02-27 11:42:20.684: I/ASessionDescription(116): a=ASMRuleBook:string;"Marker=0,AverageBandwidth=64000,TimestampDelivery=TRUE,InterDepend=1;Marker=1,AverageBandwidth=0,TimestampDelivery=TRUE,InterDepend=0;"
02-27 11:42:20.684: I/ASessionDescription(116): a=3GPP-Adaptation-Support:1
02-27 11:42:20.684: I/ASessionDescription(116): a=Helix-Adaptation-Support:1
02-27 11:42:20.684: I/ASessionDescription(116): a=AvgBitRate:integer;64000
02-27 11:42:20.684: I/ASessionDescription(116): a=ForceRTP:integer;1
02-27 11:42:20.684: I/ASessionDescription(116): m=video 7232 RTP/AVP 96
02-27 11:42:20.684: I/ASessionDescription(116): b=AS:208
02-27 11:42:20.684: I/ASessionDescription(116): b=TIAS:200000
02-27 11:42:20.684: I/ASessionDescription(116): b=RR:4000
02-27 11:42:20.684: I/ASessionDescription(116): b=RS:2000
02-27 11:42:20.684: I/ASessionDescription(116): a=maxprate:16.000000
02-27 11:42:20.684: I/ASessionDescription(116): a=control:streamid=2
02-27 11:42:20.684: I/ASessionDescription(116): a=range:npt=0-
02-27 11:42:20.684: I/ASessionDescription(116): a=length:npt=0
02-27 11:42:20.684: I/ASessionDescription(116): a=rtpmap:96 H264/90000
02-27 11:42:20.684: I/ASessionDescription(116): a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LAFdoCMK/r/wDTAMcQAAADABAAAAMB4PFi6g==,aM48gA==
02-27 11:42:20.684: I/ASessionDescription(116): a=mimetype:string;"video/H264"
02-27 11:42:20.684: I/ASessionDescription(116): a=ASMRuleBook:string;"Marker=0,AverageBandwidth=200000,TimestampDelivery=TRUE,InterDepend=1;Marker=1,AverageBandwidth=0,TimestampDelivery=TRUE,InterDepend=0;"
02-27 11:42:20.684: I/ASessionDescription(116): a=3GPP-Adaptation-Support:1
02-27 11:42:20.684: I/ASessionDescription(116): a=Helix-Adaptation-Support:1
02-27 11:42:20.694: I/ASessionDescription(116): a=AvgBitRate:integer;200000
02-27 11:42:20.694: I/ASessionDescription(116): a=ForceRTP:integer;1
02-27 11:42:20.704: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:20.704: I/MyHandler(116): SETUP(1) completed with result 0 (Unknown error: 0)
02-27 11:42:20.704: W/MyHandler(116): Missing 'source' field in Transport response. Using RTSP endpoint address.
02-27 11:42:20.704: W/MyHandler(116): Unsupported format. Ignoring track #2.
02-27 11:42:20.714: I/MyHandler(116): SETUP(2) completed with result -1010 (Unknown error: 1010)
02-27 11:42:20.754: I/ActivityManager(163): Displayed by.tut.android/.tv.channelselector.VideoViewActivity: +338ms
02-27 11:42:20.804: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:20.814: I/MyHandler(116): PLAY completed with result 0 (Unknown error: 0)
02-27 11:42:30.824: W/MyHandler(116): Never received any data, switching transports.
02-27 11:42:30.824: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:30.834: I/MyHandler(116): TEARDOWN completed with result 0 (Unknown error: 0)
02-27 11:42:30.844: I/MyHandler(116): connection request completed with result 0 (Unknown error: 0)
02-27 11:42:30.864: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:30.874: I/MyHandler(116): DESCRIBE completed with result 0 (Unknown error: 0)
02-27 11:42:30.874: I/ASessionDescription(116): v=0
02-27 11:42:30.874: I/ASessionDescription(116): o=- 139000 139000 IN IP4 178.124.133.2
02-27 11:42:30.874: I/ASessionDescription(116): s=WowzaMediaServer
02-27 11:42:30.874: I/ASessionDescription(116): i=<No author> <No copyright>
02-27 11:42:30.874: I/ASessionDescription(116): c=IN IP4 0.0.0.0
02-27 11:42:30.874: I/ASessionDescription(116): t=0 0
02-27 11:42:30.884: I/ASessionDescription(116): a=SdpplinVersion:1610641560
02-27 11:42:30.884: I/ASessionDescription(116): a=StreamCount:integer;2
02-27 11:42:30.884: I/ASessionDescription(116): a=control:*
02-27 11:42:30.884: I/ASessionDescription(116): a=LiveStream:integer;1
02-27 11:42:30.884: I/ASessionDescription(116): a=Title:buffer;"V293emFNZWRpYVNlcnZlcg=="
02-27 11:42:30.884: I/ASessionDescription(116): a=range:npt=0-
02-27 11:42:30.884: I/ASessionDescription(116): a=tool:libavformat 53.5.0
02-27 11:42:30.884: I/ASessionDescription(116): m=audio 7234 RTP/AVP 97
02-27 11:42:30.884: I/ASessionDescription(116): b=AS:72
02-27 11:42:30.894: I/ASessionDescription(116): b=TIAS:64000
02-27 11:42:30.894: I/ASessionDescription(116): b=RR:1280
02-27 11:42:30.894: I/ASessionDescription(116): b=RS:640
02-27 11:42:30.894: I/ASessionDescription(116): a=maxprate:16.000000
02-27 11:42:30.894: I/ASessionDescription(116): a=control:streamid=1
02-27 11:42:30.894: I/ASessionDescription(116): a=range:npt=0-
02-27 11:42:30.894: I/ASessionDescription(116): a=length:npt=0
02-27 11:42:30.894: I/ASessionDescription(116): a=rtpmap:97 MP4A-LATM/44100/2
02-27 11:42:30.894: I/ASessionDescription(116): a=fmtp:97 profile-level-id=41;cpresent=0;config=400024203fc0
02-27 11:42:30.904: I/ASessionDescription(116): a=mimetype:string;"audio/MP4A-LATM"
02-27 11:42:30.904: I/ASessionDescription(116): a=ASMRuleBook:string;"Marker=0,AverageBandwidth=64000,TimestampDelivery=TRUE,InterDepend=1;Marker=1,AverageBandwidth=0,TimestampDelivery=TRUE,InterDepend=0;"
02-27 11:42:30.904: I/ASessionDescription(116): a=3GPP-Adaptation-Support:1
02-27 11:42:30.904: I/ASessionDescription(116): a=Helix-Adaptation-Support:1
02-27 11:42:30.904: I/ASessionDescription(116): a=AvgBitRate:integer;64000
02-27 11:42:30.904: I/ASessionDescription(116): a=ForceRTP:integer;1
02-27 11:42:30.904: I/ASessionDescription(116): m=video 7232 RTP/AVP 96
02-27 11:42:30.904: I/ASessionDescription(116): b=AS:208
02-27 11:42:30.904: I/ASessionDescription(116): b=TIAS:200000
02-27 11:42:30.904: I/ASessionDescription(116): b=RR:4000
02-27 11:42:30.904: I/ASessionDescription(116): b=RS:2000
02-27 11:42:30.904: I/ASessionDescription(116): a=maxprate:16.000000
02-27 11:42:30.904: I/ASessionDescription(116): a=control:streamid=2
02-27 11:42:30.904: I/ASessionDescription(116): a=range:npt=0-
02-27 11:42:30.904: I/ASessionDescription(116): a=length:npt=0
02-27 11:42:30.904: I/ASessionDescription(116): a=rtpmap:96 H264/90000
02-27 11:42:30.904: I/ASessionDescription(116): a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LAFdoCMK/r/wDTAMcQAAADABAAAAMB4PFi6g==,aM48gA==
02-27 11:42:30.904: I/ASessionDescription(116): a=mimetype:string;"video/H264"
02-27 11:42:30.904: I/ASessionDescription(116): a=ASMRuleBook:string;"Marker=0,AverageBandwidth=200000,TimestampDelivery=TRUE,InterDepend=1;Marker=1,AverageBandwidth=0,TimestampDelivery=TRUE,InterDepend=0;"
02-27 11:42:30.904: I/ASessionDescription(116): a=3GPP-Adaptation-Support:1
02-27 11:42:30.904: I/ASessionDescription(116): a=Helix-Adaptation-Support:1
02-27 11:42:30.904: I/ASessionDescription(116): a=AvgBitRate:integer;200000
02-27 11:42:30.904: I/ASessionDescription(116): a=ForceRTP:integer;1
02-27 11:42:30.914: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:30.914: I/MyHandler(116): SETUP(1) completed with result 0 (Unknown error: 0)
02-27 11:42:30.914: W/MyHandler(116): Unsupported format. Ignoring track #2.
02-27 11:42:30.914: I/MyHandler(116): SETUP(2) completed with result -1010 (Unknown error: 1010)
02-27 11:42:31.254: I/ARTSPConnection(116): status: RTSP/1.0 200 OK
02-27 11:42:31.254: I/MyHandler(116): PLAY completed with result 0 (Unknown error: 0)
02-27 11:42:32.866: I/AwesomePlayer(116): ARTSPController::connect returned 0

【问题讨论】:

    标签: android video streaming rtsp android-4.0-ice-cream-sandwich


    【解决方案1】:

    这是来自哪个服务器?编辑 - 我刚看到 WowzaMediaServer

    真的,可能信息不够,服务器日志也会很有帮助。

    首先,android 在这些版本中更改了媒体服务器,从 OpenCore 迁移到 StageFright。

    错误是“02-27 11:42:20.704: W/MyHandler(116): Unsupported format. Ignoring track #2”

    android rtp 客户端返回了“设置”视频轨道的错误。 最明显的第一个: 您的 SDP 文件指定端口 7232“m=video 7232 RTP/AVP 96”。此端口是否已在使用中?

    根据媒体播放器 libstagefright 中的 APacketSource.cpp, 安装失败并出现此错误的原因是:
    1) 使用 base64 工具(以及支持二进制数据,而不仅仅是 ascii 文本)的 SDP 或编码的 sprops(尝试手动解码)中没有有效的图片尺寸),
    2) 如果使用 AMR 并且采样率 != 8000 并且有超过 1 个通道(你不是)
    3)如果使用 AMR WB 并且采样率 != 16000 并且有超过 1 个通道(你不是)
    4) 您的字符串描述不满足以下 else-if 之一: "H264/","H263-2000/","H263-1998/","MP4A-LATM/","AMR/","AMR-WB/", "MP4V-ES/", "mpeg4-generic/ "

    您同时拥有“H264/90000”和“视频/H264”

    我会丢失 SDP 文件中的 "a=mimetype:string;"video/H264"" 字符串,看看它是如何工作的?虽然这是一个远射(但这并不能解释为什么音频有效,因为它是相同的)

    虽然“不应该”对此有任何问题,但根据我迄今为止对 android 和 RTP/RTSP/SDP 的经验,stagefright 在处理扩展类型方面并不是很好,只有最低限度。

    如果您想查看我上面解释的内容,可以查看 android 源代码,文件位于“/media/libstagefrigt/rtsp/”中。相关文件为 MyHandler.h 和 APacketSource.cpp

    更新:你有另一个/更糟糕的问题

    我刚刚在您的日志中看到了这一点: “02-27 11:42:30.824:W/MyHandler(116):从未收到任何数据,正在切换传输。” 我注意到这两次尝试是背靠背的,而不是我认为的你复制和粘贴两次尝试。

    这里有两个问题,一是视频设置失败,二是整个第一个会话设置失败。

    “从未收到任何数据,正在切换传输”错误发生在 Android 发出 PLAY 命令和它在 10 秒内未接收数据之间的 10 秒超时后。然后它会断开会话并尝试通过 TCP 建立会话。

    很可能有一些 UDP 端口在您的计算机/防火墙等上被阻止或未打开。这会导致第一个会话失败。它甚至可以解释视频设置失败的原因。检查服务器尝试使用哪些端口进行视频设置。确保它们高于 1024。

    另外,我不喜欢你的 SDP 如何首先列出音频,然后是视频,但音频使用的端口比后续视频低(这可能很好,只是“看起来”很奇怪)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-11
      • 2019-01-11
      • 1970-01-01
      相关资源
      最近更新 更多