用VLC播放SDP文件?

时间:2016-01-25 00:34:03

标签: vlc sdp rtsp-client

目标

确认VLC可以从本地给定的SDP文件播放流。

这似乎可以基于证词:

实验

所以我找了一个公开案例并找到Mobile Streaming, RTSP/RTP, Wowza Streaming Engine | Wowza Media Systems

这样可以播放带声音的彩色视频:

vlc rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov

我设法使用networking - How can I capture network traffic of a single process? - Ask Ubuntu

中的技巧提取SDP文件
strace -f -e trace=network -s 10000 mplayer rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov 2>&1 | grep a=

...然后重新格式化文件并保存到bbb.sdp

文件看起来像(实际行不是以空格开头,而是以Windows样式的行结束):

o=- 785981631 785981631 IN IP4 184.72.239.149
s=BigBuckBunny_115k.mov
c=IN IP4 184.72.239.149
t=0 0
a=sdplang:en
a=range:npt=0- 596.48
a=control:*
m=audio 0 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/12000/2
a=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1490
a=control:trackID=1
m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=42C01E;sprop-parameter-sets=Z0LAHtkDxWhAAAADAEAAAAwDxYuS,aMuMsg==
a=cliprect:0,0,160,240
a=framesize:97 240-160
a=framerate:24.0
a=control:trackID=2

然后:

vlc bbb.sdp 

显示播放列表中的条目,持续时间正确(09:56,信息在SDP中),但不显示视频。

跟踪网络呼叫

VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
Process 15739 attached
[0xf19118] [http] lua interface: Lua HTTP interface
Process 15740 attached
[pid 15739] bind(7, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
[pid 15739] bind(7, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
[0xf19118] [http] main interface error: socket bind error (Permission denied)
[pid 15739] bind(7, {sa_family=AF_INET6, sin6_port=htons(8080), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use)
[0xf19118] [http] main interface error: socket bind error (Permission denied)
[0xf19118] [http] main interface error: cannot create socket(s) for HTTP host
[0xf19118] [http] lua interface error: Error loading script /usr/lib/vlc/lua/intf/http.luac: lua/intf/http.lua:328: Failed to create HTTP host
[pid 15739] +++ exited with 0 +++
Process 15741 attached
Process 15742 attached
Process 15743 attached
Process 15744 attached
[0xf3f9a8] dummy interface: using the dummy interface module...
Process 15745 attached
[pid 15745] bind(16, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(17, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
[pid 15745] bind(14, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(16, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(18, {sa_family=AF_INET, sin_port=htons(49463), sin_addr=inet_addr("0.0.0.0")}, 16Unable to determine our source address: ) = 0
This computer has an invalid IP address: 0.0.0.0
[pid 15745] bind(17, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16 <unfinished ...>
[pid 15743] bind(15, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16 <unfinished ...>
[pid 15745] <... bind resumed> )        = 0
[pid 15743] <... bind resumed> )        = 0
[pid 15743] bind(19, {sa_family=AF_INET, sin_port=htons(55667), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(20, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(17, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(20, {sa_family=AF_INET, sin_port=htons(45441), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(14, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(22, {sa_family=AF_INET, sin_port=htons(55005), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
Process 15746 attached
[pid 15743] +++ exited with 0 +++
Process 15747 attached
Process 15748 attached
Process 15749 attached
Process 15750 attached
Process 15751 attached
[0x7f2f80c01838] live555 demux error: no data received in 10s, aborting
[pid 15746] --- SIGRTMIN {si_signo=SIGRTMIN, si_code=SI_TKILL, si_pid=15738, si_uid=1000} ---
[pid 15746] +++ exited with 0 +++
[pid 15751] --- SIGRTMIN {si_signo=SIGRTMIN, si_code=SI_TKILL, si_pid=15738, si_uid=1000} ---
[pid 15751] +++ exited with 0 +++
[pid 15747] +++ exited with 0 +++
[pid 15748] +++ exited with 0 +++
[pid 15749] +++ exited with 0 +++
[pid 15750] +++ exited with 0 +++
[pid 15745] +++ exited with 0 +++

VLC似乎甚至没有尝试连接到IP 184.72.239.149。

我很无能为力。这是一个错误吗?

问题

  • 为什么直接从RTSP URL播放,而不是播放本地保存的SDP文件?
  • 怎么办?

1 个答案:

答案 0 :(得分:4)

当您在RTSP请求期间从服务器收到SDP时,服务器会对其进行自定义,以告知您将在何处发送它正在启动的流。如果没有RTSP控制通道告诉服务器你想要一个RTP流,它就不会流出来。

直接SDP播放基本上只有在您拥有广播/多播RTP流或连续“推送”RTP流时才有用,而不是如果您有一个否则将由RTSP发布的VOD流。