简体   繁体   English

Android 2.3、4.0 rtsp视频流错误:无视频,但有音频

[英]Android 2.3, 4.0 rtsp video streaming error: no video, but audio

i have a problem with playback of stream video. 我在播放流视频时遇到问题。

On HTC Desire 2.2 video playing well, no problems but on Nexus One 2.3.4 and Nexus S 4.0.3 i have only audio, but no video displayed 在HTC Desire 2.2上,视频播放良好,但在Nexus One 2.3.4和Nexus S 4.0.3上没有问题,我只有音频,但没有视频显示

Here is block log that have equal problem on N1 and NS 这是在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)

full log: 完整日志:

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

What server is this from? 这是什么服务器? Edit - I just saw WowzaMediaServer 编辑-我刚刚看到WowzaMediaServer

Really, there probably isn't enough information, server logs would also be very helpful. 确实,可能没有足够的信息,服务器日志也将非常有帮助。

First off, android changed media servers during these versions, moving from OpenCore to StageFright. 首先,android在这些版本中更改了媒体服务器,从OpenCore迁移到StageFright。

The error is "02-27 11:42:20.704: W/MyHandler(116): Unsupported format. Ignoring track #2" 错误为“ 02-27 11:42:20.704:W / MyHandler(116):不支持的格式。忽略轨道#2”

The android rtp client has returned an error "setting up" the video track. android rtp客户端返回了“设置”视频轨道的错误。 The obvious first: Your SDP file specifies port 7232 "m=video 7232 RTP/AVP 96". 明显的第一:您的SDP文件指定端口7232“ m = video 7232 RTP / AVP 96”。 Is this port already in use? 这个端口已经被使用了吗?

According the APacketSource.cpp from the libstagefright the media player, The reasons setup can fail with this error are because: 根据媒体播放器libstagefright的APacketSource.cpp,安装程序可能因此错误而失败的原因是:
1) No valid picture dimenions in the SDP or the encoded sprops (try manually decoding them) with a base64 tool (and one that supports binary data, not just ascii text)), 1)使用base64工具(以及支持二进制数据,而不仅仅是ascii文本的工具)在SDP或编码的sprop中没有有效的图片尺寸(尝试手动解码),
2) if using AMR and the sample rate != 8000 and there are more than 1 channel (you are not) 2)如果使用AMR且采样率!= 8000并且有多个通道(您不是)
3) if using AMR WB and the sample rate != 16000 and there are more than 1 channel (you are not) 3)如果使用AMR WB且采样率!= 16000且有1个以上的通道(您不是)
4) You have a string description which does NOT satisfy one of these else- ifs: "H264/","H263-2000/","H263-1998/","MP4A-LATM/","AMR/","AMR-WB/", "MP4V-ES/", "mpeg4-generic/" 4)您的字符串描述不满足以下任一条件:“ H264 /”,“ H263-2000 /”,“ H263-1998 /”,“ MP4A-LATM /”,“ AMR /”,“ AMR-WB /“,” MP4V-ES /“,” mpeg4-generic /“

You have both "H264/90000" AND "video/H264" 您同时拥有“ H264 / 90000”和“视频/ H264”

I'd lose the "a=mimetype:string;"video/H264"" string in the SDP file and see how it works?? 我会在SDP文件中丢失“ a = mimetype:string;” video / H264“”字符串,然后看它是如何工作的? It's a longshot though (But that doesn't explain why the audio works, as it is the same) 虽然这是一个长镜头(但是这并不能解释为什么音频有效,因为它是相同的)

While there *shoudn't" be any problem with this, in my experiece with android and RTP/RTSP/SDP so far, stagefright is NOT very good with dealing with extended types, only the bare minumum. 尽管“应该”没有任何问题,但到目前为止,在我对android和RTP / RTSP / SDP的实验中,stagefright并不是很好地处理扩展类型,而仅仅是最小的。

If you want to look the at what I explained above, you can check out the android source code, the files are in "/media/libstagefrigt/rtsp/". 如果您想看一下我上面解释的内容,可以查看android源代码,这些文件位于“ / media / libstagefrigt / rtsp /”中。 The relevant files are MyHandler.h and APacketSource.cpp 相关文件是MyHandler.h和APacketSource.cpp

UPDATE: You have another/worse problem 更新:您还有另一个/更糟糕的问题

I just saw this in your log: "02-27 11:42:30.824: W/MyHandler(116): Never received any data, switching transports." 我刚刚在您的日志中看到了这一点:“ 02-27 11:42:30.824:W / MyHandler(116):从未收到任何数据,正在切换传输。” and I noticed the two attempts are back to back, rather than what I thought was you copy and pasting two attempts. 我注意到这两次尝试是背对背的,而不是我认为您复制并粘贴了两次尝试。

There are two problems here, one is the video setup failing, and secondly is the entire first session setup fails. 这里有两个问题,一个是视频设置失败,其次是整个第一个会话设置失败。

The "Never received any data, switching transports" error occurs after a 10second timeout between Android issuing the PLAY command, and it not receiving data for 10 seconds. 在Android发出PLAY命令之间的10秒超时后,以及在10秒内未接收到数据之后,出现了“从未接收到任何数据,切换传输”错误。 It then tears down the session and attempts to set up the session over TCP. 然后,它断开会话并尝试通过TCP建立会话。

There is most likely some UDP ports being blocked or not opened on your computer/firewall etc. This causes the first session to fail. 您的计算机/防火墙等上很可能有某些UDP端口被阻止或未打开。这会导致第一个会话失败。 It may even explain the reason for the failing video setup. 它甚至可以解释视频设置失败的原因。 Check what ports the server is trying to use for the video setup. 检查服务器尝试将哪些端口用于视频设置。 Make sure they are above 1024. 确保它们高于1024。

Also, I don't like how your SDP list the audio first, then the video, but the audio uses lower ports than the subsequent video (It's probably fine, just "looks" strange) 另外,我不喜欢您的SDP如何先列出音频,然后再列出视频,但是音频使用的端口比后续视频的端口少(可能很好,只是“看起来”很奇怪)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM