求助 VLC不能播放RTSP流地址,为何PLAY后又重新请求RTSP

yuuzg 2010-08-16 04:20:26
我要播放一个点播的rtsp流,用vlc命令方式,如下:
vlc -vv --extraintf=logger "rtsp://58.223.255.198:554/vod/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contname=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nodelevel=3"

播放出错,vlc-log.txt记录的日志如下:
-- logger module started --
live555 warning: no data received in 10s. Switching to TCP
live555 error: SETUP of'video/MP2T' failed SETUP: cannot handle response: RTSP/1.0 461 Unsupported transport
live555 error: Nothing to play for rtsp://58.223.255.198:554/vod/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contname=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nodelevel=3
live555 error: TCP rollover failed, aborting

先把错误情况描述一下,有需要的可以看下面的详细调试信息。
用上面的命令启动VLC播放器,并通过调试信息及抓包可以看到VLC完成了整个RTSP的交互过程,从OPTIONS到PLAY,但是PLAY后一会又重新请求RTSP交互了,但这次是从OPTIONS到SETUP,SETUP反馈“RTSP/1.0 461 Unsupported transport”,然后就停止了。
这里要问的是为何第一次RTSP交互完成,PLAY都通过了还会发送TEARDOWN命令来中断,然后又一次请求RTSP。在这个过程中VLC没有画面出现,从之前的调试来看,此RTSP地址的流媒体服务器是通过UDP方式传输数据的,VLC对UDP方式支持如何?以前还碰到过“live555 error: no data received in 10s, aborting”的错误。
我的联系方式是QQ:10594383,很急啊,搞了很久了,没弄出来,特借宝地来寻求帮助!

整个DEBUG调试过程如下:
[00bb3bb0] main playlist debug: rebuild done - 0 items, index -1
[02c53c40] main interface debug: looking for interface module: 1 candidate
[02c53c40] main interface debug: using interface module "globalhotkeys"
[02c53c40] main interface debug: TIMER module_need() : 3.000 ms - Total 3.000 ms
/ 1 intvls (Avg 3.000 ms)
[02c52308] main interface debug: looking for interface module: 1 candidate
[02c95378] main generic debug: looking for extension module: 1 candidate
[02c95378] lua generic debug: Opening EXPERIMENTAL Lua Extension module
[02c95378] lua generic debug: Trying Lua scripts in C:\Documents and Settings\Ad
ministrator\Application Data\vlc\lua\extensions
[02c95378] lua generic debug: Trying Lua scripts in D:\vlc\lua\extensions
[02c95378] lua generic debug: Trying Lua playlist script D:\vlc\lua\extensions\a
llocine-fr.lua
[02c95378] lua generic debug: Scanning Lua script D:\vlc\lua\extensions\allocine
-fr.lua
[02c95378] lua generic debug: Script D:\vlc\lua\extensions\allocine-fr.lua has t
he following capability flags: 0xc
[02c95378] main generic debug: using extension module "lua"
[02c95378] main generic debug: TIMER module_need() : 3.000 ms - Total 3.000 ms /
1 intvls (Avg 3.000 ms)
[02c52308] main interface debug: using interface module "qt4"
[02c52308] main interface debug: TIMER module_need() : 189.000 ms - Total 189.00
0 ms / 1 intvls (Avg 189.000 ms)
[00bb3bb0] main playlist debug: rebuilding array of current - root 播放列表
[00bb3bb0] main playlist debug: rebuild done - 1 items, index -1
[00bb3bb0] main playlist debug: processing request item null node 播放列表 skip
0
[00bb3bb0] main playlist debug: starting new item
[00bb3bb0] main playlist debug: creating new input thread
[02cd2f40] main input debug: Creating an input for 'rtsp://58.223.255.198:554/vo
d/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype
=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+08&life=172800&
usersessionid=3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupage
nt=58.223.255.198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=000000
00020000338025&contname=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow
=0&ifpricereqsnd=1&nodelevel=3'
[02cd2f40] main input debug: thread (input) created at priority 1 (../.././src/i
nput/input.c:214)
[02cd2f40] main input debug: thread started
[02cd2f40] main input debug: using timeshift granularity of 50 MiB
[02cd2f40] main input debug: using timeshift path 'C:\DOCUME~1\ADMINI~1\LOCALS~1
\Temp'
[02cd2f40] main input debug: `rtsp://58.223.255.198:554/vod/00000000020000338025
.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=00000000030
20000401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcd
nid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&
ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contnam
e=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nod
elevel=3' gives access `rtsp' demux `' path `58.223.255.198:554/vod/000000000200
00338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=000
0000003020000401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=
3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.
198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025
&contname=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqs
nd=1&nodelevel=3'
[02cd2f40] main input debug: creating demux: access='rtsp' demux='' path='58.223
.255.198:554/vod/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39
.215&clienttype=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+
08&life=172800&usersessionid=3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=3
6050A&backupagent=58.223.255.198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&p
rogramid=00000000020000338025&contname=&fathercont=&bp=0&authid=255698593&tscnt=
0&tstm=0&tsflow=0&ifpricereqsnd=1&nodelevel=3'
[02cd9cf8] main demux debug: looking for access_demux module: 1 candidate
[02c52308] qt4 interface debug: IM: Setting an input
Sending request: OPTIONS rtsp://58.223.255.198:554/vod/00000000020000338025.mpg?
userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=0000000003020000
401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcdnid=v
cdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&ctype
=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contname=&fa
thercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nodeleve
l=3 RTSP/1.0
CSeq: 1
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received OPTIONS response: RTSP/1.0 403 Forbidden
Server: ZXUSS100 1.0
CSeq: 1


Sending request: DESCRIBE rtsp://58.223.255.198:554/vod/00000000020000338025.mpg
?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=000000000302000
0401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcdnid=
vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&ctyp
e=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contname=&f
athercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nodelev
el=3 RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received DESCRIBE response: RTSP/1.0 200 OK
Server: ZXUSS100 1.0
Cache-Control: must-revalidate
Content-Base: rtsp://58.223.255.198:554/vod/00000000020000338025.mpg/
Content-Length: 235
Content-Type: application/sdp
CSeq: 2
Date: Tue, 10 Aug 2010 08:12:18 GMT
Expires: Tue, 10 Aug 2010 08:12:18 GMT


Need to read 235 extra bytes
Read 235 extra bytes: v=0
o=- 387657244 0 IN IP4 0.0.0.0
s=ZMSS RTSP Server
c=IN IP4 0.0.0.0
b=AS:1600
t=0 0
a=control:*
a=range:npt=0.00000-5212.84277
m=video 0 RTP/AVP 33
a=control:trackID=1
a=rtpmap:33 MP2T/90000
a=3GPP-Adaptation-Support:5

[02cd9cf8] live555 demux debug: RTP subsession 'video/MP2T'
Sending request: SETUP rtsp://58.223.255.198:554/vod/00000000020000338025.mpg/tr
ackID=1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=3646-3647
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received SETUP response: RTSP/1.0 200 OK
Server: ZXUSS100 1.0
CSeq: 3
Date: Tue, 10 Aug 2010 08:12:18 GMT
Expires: Tue, 10 Aug 2010 08:12:18 GMT
Session: 131087272
Transport: RTP/AVP;unicast;destination=61.155.39.215;client_port=3646-3647;serve
r_port=10180-10181;source=58.223.255.153


[02c9b698] main stream debug: thread started
[02c9b698] main stream debug: thread (stream out) created at priority 1 (../../.
/src/input/stream_demux.c:100)
[02c9b698] main stream debug: creating demux: access='' demux='ts' path=''
[02cd9cf8] live555 demux debug: setup start: 0.000000 stop:5212.842770
Sending request: PLAY rtsp://58.223.255.198:554/vod/00000000020000338025.mpg/ RT
SP/1.0
CSeq: 4
Session: 131087272
Range: npt=0.000-
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received PLAY response: RTSP/1.0 200 OK
Server: ZXUSS100 1.0
CSeq: 4
Range: npt=0.00000-
Scale: 1.0
Session: 131087272
RTP-Info: url=rtsp://58.223.255.153:10180/vod/00000000020000338025.mpg/trackID=1
;seq=3;rtptime=0

...全文
4421 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
萧湘易水寒 2011-09-06
  • 打赏
  • 举报
回复
楼主问题解决了没有?解决了也分享一下啦 我也遇到了
chen43030 2011-09-06
  • 打赏
  • 举报
回复
[02cd9cf8] live555 demux debug: RTP subsession 'video/MP2T'
Sending request: SETUP rtsp://58.223.255.198:554/vod/00000000020000338025.mpg/tr
ackID=1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=3646-3647
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)

这一段中“Transport: RTP/AVP”貌似还缺少个参数吧?
这是我用Android平板播放Live555流媒体的SETUP阶段的消息,供参考:


**********Come from the client!

SETUP rtsp://192.168.1.3/1.264/track1 RTSP/1.0

CSeq: 2

User-Agent: Samsung GT-P1000 PVPlayer CORE/6.506.4.1 OpenCORE/2.02 (Linux;Android 2.3.3)

Transport: RTP/AVP/UDP;unicast;client_port=13956-13957

Blocksize: 1400





##########Send to the client!

RTSP/1.0 200 OK

CSeq: 2

Date: Mon, Sep 05 2011 08:22:01 GMT

Transport: RTP/AVP;unicast;destination=192.168.1.4;source=192.168.1.3;client_port=13956-13957;server_port=6970-6971

Session: 0000744B
evoloyeu 2010-11-02
  • 打赏
  • 举报
回复
同求高人解答
yuanzhenhai 2010-10-07
  • 打赏
  • 举报
回复
我遇到同样的问题,请问如何查看vlc的运行日志呢?
lanxue84 2010-08-19
  • 打赏
  • 举报
回复
VLC支持UDP发送数据流,测试过
yuuzg 2010-08-16
  • 打赏
  • 举报
回复
另外再问下,VLC加什么参数才能不发送OPTIONS命令啊,在OpenRTSP.exe中可以加-O来取消发送OPTIONS命令的,因为服务器对OPTIONS不支持。
yuuzg 2010-08-16
  • 打赏
  • 举报
回复
忘了说了,VLC用的是1.1.2的版本,在调试信息里也可以看到是LibVLC/1.1.2
yuuzg 2010-08-16
  • 打赏
  • 举报
回复
继续

[02cd9cf8] live555 demux debug: play start: 0.000000 stop:5212.842773
[02cd9cf8] main demux debug: using access_demux module "live555"
[02cd9cf8] main demux debug: TIMER module_need() : 284.000 ms - Total 284.000 ms
/ 1 intvls (Avg 284.000 ms)
[02cb5170] main demux meta debug: looking for meta reader module: 2 candidates
[02cb5170] lua demux meta debug: Trying Lua scripts in C:\Documents and Settings
\Administrator\Application Data\vlc\lua\meta\reader
[02cb5170] lua demux meta debug: Trying Lua scripts in D:\vlc\lua\meta\reader
[02cb5170] lua demux meta debug: Trying Lua playlist script D:\vlc\lua\meta\read
er\filename.lua
[02cb5170] main demux meta debug: no meta reader module matching "any" could be
loaded
[02cb5170] main demux meta debug: TIMER module_need() : 8.000 ms - Total 8.000 m
s / 1 intvls (Avg 8.000 ms)
[02cd2f40] main input debug: `rtsp://58.223.255.198:554/vod/00000000020000338025
.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=00000000030
20000401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcd
nid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&
ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contnam
e=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nod
elevel=3' successfully opened
[02cd9cf8] live555 demux warning: no data received in 10s. Switching to TCP
[02d21208] main demux debug: looking for demux module: 1 candidate
[02d21208] main demux debug: no demux module matching "ts" could be loaded
[02d21208] main demux debug: TIMER module_need() : 26.000 ms - Total 26.000 ms /
1 intvls (Avg 26.000 ms)
[02c9b698] main stream debug: thread ended
[02c9b698] main stream debug: thread times: real 0m10.640625s, kernel 0m0.000000
s, user 0m0.000000s
Sending request: TEARDOWN rtsp://58.223.255.198:554/vod/00000000020000338025.mpg
/ RTSP/1.0
CSeq: 5
Session: 131087272
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received TEARDOWN response: RTSP/1.0 200 OK
Server: ZXUSS100 1.0
CSeq: 5
Session: 131087272


Sending request: OPTIONS rtsp://58.223.255.198:554/vod/00000000020000338025.mpg?
userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=0000000003020000
401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcdnid=v
cdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&ctype
=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contname=&fa
thercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nodeleve
l=3 RTSP/1.0
CSeq: 6
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received OPTIONS response: RTSP/1.0 403 Forbidden
Server: ZXUSS100 1.0
CSeq: 6


Sending request: DESCRIBE rtsp://58.223.255.198:554/vod/00000000020000338025.mpg
?userid=softtysz0000001&stbip=61.155.39.215&clienttype=1&mediaid=000000000302000
0401949&ifcharge=1&time=20100716084852+08&life=172800&usersessionid=3476&vcdnid=
vcdn001&boid=001&srcboid=001&columnid=36050A&backupagent=58.223.255.198:554&ctyp
e=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=00000000020000338025&contname=&f
athercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow=0&ifpricereqsnd=1&nodelev
el=3 RTSP/1.0
CSeq: 7
Accept: application/sdp
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received DESCRIBE response: RTSP/1.0 200 OK
Server: ZXUSS100 1.0
Cache-Control: must-revalidate
Content-Base: rtsp://58.223.255.198:554/vod/00000000020000338025.mpg/
Content-Length: 235
Content-Type: application/sdp
CSeq: 7
Date: Tue, 10 Aug 2010 08:12:29 GMT
Expires: Tue, 10 Aug 2010 08:12:29 GMT


Need to read 235 extra bytes
Read 235 extra bytes: v=0
o=- 387657244 0 IN IP4 0.0.0.0
s=ZMSS RTSP Server
c=IN IP4 0.0.0.0
b=AS:1600
t=0 0
a=control:*
a=range:npt=0.00000-5212.84277
m=video 0 RTP/AVP 33
a=control:trackID=1
a=rtpmap:33 MP2T/90000
a=3GPP-Adaptation-Support:5

[02cd9cf8] live555 demux debug: RTP subsession 'video/MP2T'
Sending request: SETUP rtsp://58.223.255.198:554/vod/00000000020000338025.mpg/tr
ackID=1 RTSP/1.0
CSeq: 8
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
User-Agent: LibVLC/1.1.2 (LIVE555 Streaming Media v2010.03.16)


Received SETUP response: RTSP/1.0 461 Unsupported transport
Server: ZXUSS100 1.0
CSeq: 8


[02cd9cf8] live555 demux error: SETUP of'video/MP2T' failed SETUP: cannot handle
response: RTSP/1.0 461 Unsupported transport
[02cd9cf8] live555 demux debug: setup start: 0.000000 stop:5212.842770
[02cd9cf8] live555 demux error: Nothing to play for rtsp://58.223.255.198:554/vo
d/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&clienttype
=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+08&life=172800&
usersessionid=3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=36050A&backupage
nt=58.223.255.198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=000000
00020000338025&contname=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsflow
=0&ifpricereqsnd=1&nodelevel=3
[02cd9cf8] live555 demux error: TCP rollover failed, aborting
[02cd2f40] main input debug: EOF reached
[00bb3bb0] main playlist debug: finished input
[02cd9cf8] main demux debug: removing module "live555"
[02cd2f40] main input debug: thread ended
[00bb3bb0] main playlist debug: dead input
[02cd2f40] main input debug: thread times: real 0m10.890625s, kernel 0m0.015625s
, user 0m0.000000s
[00bb3bb0] main playlist debug: changing item without a request (current 0/1)
[02c52308] qt4 interface debug: IM: Deleting the input
[00bb3bb0] main playlist debug: nothing to play
[02cd2f40] main input debug: Destroying the input for 'rtsp://58.223.255.198:554
/vod/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&clientt
ype=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+08&life=1728
00&usersessionid=3476&vcdnid=vcdn001&boid=001&srcboid=001&columnid=36050A&backup
agent=58.223.255.198:554&ctype=1&playtype=0&Drm=0&EpgId=epg_nj_001&programid=000
00000020000338025&contname=&fathercont=&bp=0&authid=255698593&tscnt=0&tstm=0&tsf
low=0&ifpricereqsnd=1&nodelevel=3'
[02cd2f40] main input debug: TIMER input launching for 'rtsp://58.223.255.198:55
4/vod/00000000020000338025.mpg?userid=softtysz0000001&stbip=61.155.39.215&client
type=1&mediaid=0000000003020000401949&ifcharge=1&time=20100716084852+08&life=172
800&usersessionid=3476&vcdnid=vcdn001&boid=001&sr : 299.000 ms - Total 299.000 m
s / 1 intvls (Avg 299.000 ms)
//创建初始化播放器资源 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] extern public static IntPtr libvlc_new(int argc, IntPtr argv); //创建播放器实例 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_player_new(IntPtr libvlc_instance); // 释放libvlc实例 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_release(IntPtr libvlc_instance); //获取库版本信息 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern String libvlc_get_version(); // 从视频来源(例如Url)构建一个libvlc_meida RTSP [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_new_location(IntPtr libvlc_instance, IntPtr path); // 从本地文件路径构建一个libvlc_media rtsp不适合调用此接口 // [MarshalAs(UnmanagedType.LPStr)] string path [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_new_path(IntPtr libvlc_instance, IntPtr path); /// /// 影片长度 /// /// /// [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_player_get_length(IntPtr libvlc_media_player); //释放对象 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_release(IntPtr libvlc_media_inst); // 将视频(libvlc_media)绑定到播放器上 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_set_media(IntPtr libvlc_media_player, IntPtr libvlc_media); //创建(libvlc_media)播放窗口 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_new_from_media(IntPtr libvlc_media_player); // 设置图像输出的窗口 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_set_hwnd(IntPtr libvlc_mediaplayer, Int32 drawable); //播放 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_play(IntPtr libvlc_mediaplayer); //暂停 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_pause(IntPtr libvlc_mediaplayer); //停止 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_stop(IntPtr libvlc_mediaplayer); // 解析视频资源的媒体信息(如时长等) [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_parse(IntPtr libvlc_media); // 返回视频的时长(必须先调用libvlc_media_parse之后,该函数才会生效) [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern Int64 libvlc_media_get_duration(IntPtr libvlc_media); // 当前播放的时间 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern Int64 libvlc_media_player_get_time(IntPtr libvlc_mediaplayer); // 设置播放位置(拖动) [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_set_time(IntPtr libvlc_mediaplayer, Int64 time); /// /// 抓图 /// /// /// 经典0 /// 完整路径,文件名英文或下划线开头 /// /// /// [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_video_take_snapshot(IntPtr libvlc_mediaplayer, uint num, IntPtr filePath, uint i_width, uint i_height); //media player release [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_release(IntPtr libvlc_mediaplayer); // 获取音量 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_audio_get_volume(IntPtr libvlc_media_player); //设置音量 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_audio_set_volume(IntPtr libvlc_media_player, int volume); // 设置全屏 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_set_fullscreen(IntPtr libvlc_media_player, int isFullScreen); /// ///判断是否可以录像 /// /// /// //Can the media player record the current media? [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern bool libvlc_media_player_is_recordable(IntPtr libvlc_media_player); /// ///判断是否在录像 /// /// /// [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern bool libvlc_media_player_is_recording(IntPtr libvlc_media_player); /// /// 录像开始 /// /// /// 保存路径+文件名(d:\\record (将在D盘根目录保存为record.mp4)) /// [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_media_player_record_start(IntPtr libvlc_media_player, IntPtr psz_PathFilename); /// /// 录像停止 /// /// /// [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_media_player_record_stop(IntPtr libvlc_media_player);

2,541

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧