IIS 服务器上的 VLC Web 插件通过身份验证吗?

发布于 2024-12-21 01:59:11 字数 5593 浏览 1 评论 0原文

过去一周我搜索了 VLC 论坛,基本上在 google 上都搜索过,试图找到一些与此相关的信息,因为我在从 IIS 服务器制作视频流时遇到问题。 遗憾的是,我无法找到解决方案,这就是我在这里寻求帮助的原因。

我有一个在 Windows 7 64 位服务器/计算机上运行的 IIS 7.5 服务器。我使用 Mozilla Firefox 的 VLC Web 插件在浏览器中播放视频文件,但没有成功。 还应该注意的是,我已将 MIME 类型 .mkv 添加到 IIS MIME-Types 作为 video/x-matroska,所以这应该不是问题。另外,我已经授予每个用户对整个 www 文件夹和文件的完全访问权限,所以这也不应该是问题。 我将其缩减为一个非常基本的 HTML 文件“index.html”,并将视频文件保存在 HTML 页面旁边。这是我的 HTML 代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/   xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 
</head>

<body style="width:100%; height:100%;">

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
    width="720"
    height="405"
    autoplay="no"
    id="vlc"
    target="video.mkv">
</embed>

<script type="text/javascript">

   var vlc = document.getElementById("vlc");
   function mute(){
      vlc.audio.toggleMute();
   }
   function play(){
      vlc.playlist.play();
   }
   function stop(){
      vlc.playlist.stop();

   }
   function pause(){   
      vlc.playlist.togglePause();
   }
</script>

<br />
   <input type="button" onclick='play();' value="Play" /><br>
   <input type="button" onclick='pause();' value="Pause" /><br>
   <input type="button" onclick='stop();' value="Stop" /><br>   
   <input type="button" onclick='mute();' value="Mute" /><br>

</body>
</html>

该代码在本地完美运行,直接在 Firefox 中打开 HTML 文件,无需使用 Web 服务器。但当我把它放到 IIS Web 服务器上时,播放按钮就什么也不做。它无法进行身份验证或其他什么。 以下是当我将来自 Web 服务器的视频 URL 直接输入 VLC 媒体播放器时来自 VLC 的日志:

qt4 warning: Input option: http-caching=1200
main debug: adding item `http://10.0.0.30/video.mkv' ( http://10.0.0.30/video.mkv )
qt4 debug: Adding a new MRL to recent ones: http://10.0.0.30/video.mkv
main debug: rebuilding array of current - root Spilleliste
main debug: rebuild done - 1 items, index -1
main debug: processing request item http://10.0.0.30/video.mkv node null skip 0
main debug: resyncing on http://10.0.0.30/video.mkv
main debug: http://10.0.0.30/video.mkv is at 0
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for 'http://10.0.0.30/video.mkv'
main debug: thread (input) created at priority 1 (../.././src/input/input.c:220)
main debug: thread started
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path 'C:\Users\myuser\AppData\Local\Temp'
main debug: `http://10.0.0.30/video.mkv' gives access `http' demux `' path `10.0.0.30/video.mkv'
main debug: creating demux: access='http' demux='' path='10.0.0.30/video.mkv'
main debug: looking for access_demux module: 0 candidates
main debug: no access_demux module matched "http"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: creating access 'http' path='10.0.0.30/video.mkv'
main debug: looking for access module: 2 candidates
access_http debug: http: server='10.0.0.30' port=80 file='/video.mkv'
main debug: net: connecting to 10.0.0.30 port 80
qt4 debug: IM: Setting an input
main debug: connection succeeded (socket = 1440)
access_http debug: protocol 'HTTP' answer code 401
access_http debug: Content-Type: text/html
access_http debug: Server: Microsoft-IIS/7.5
access_http debug: Authentication header: Negotiate
main warning: Unknown authentication scheme: 'Negotiate'
access_http debug: Authentication header: NTLM
main warning: Unknown authentication scheme: 'NTLM'
access_http debug: this frame size=1326
access_http debug: authentication failed for realm (null)
access_http debug: retrying with user=ServerAdmin
main debug: net: connecting to 10.0.0.30 port 80
main debug: connection succeeded (socket = 1440)
access_http debug: protocol 'HTTP' answer code 401
access_http debug: Content-Type: text/html
access_http debug: Server: Microsoft-IIS/7.5
access_http debug: Authentication header: Negotiate
main warning: Unknown authentication scheme: 'Negotiate'
access_http debug: Authentication header: NTLM
main warning: Unknown authentication scheme: 'NTLM'
access_http debug: this frame size=1326
access_http debug: authentication failed for realm (null)
main debug: net: connecting to 10.0.0.30 port 80
main debug: connection succeeded (socket = 1484)
access_mms error: error: HTTP/1.1 401 Unauthorized
main debug: no access module matching "http" could be loaded
main debug: TIMER module_need() : 11949.001 ms - Total 11949.001 ms / 1 intvls (Avg 11949.000 ms)
main debug: waitpipe: object killed
main error: open of `http://10.0.0.30/video.mkv' failed: (null)
main debug: finished input
main debug: thread ended
main debug: dead input
main debug: thread times: real 0m11.948683s, kernel 0m0.000000s, user 0m0.000000s
main debug: changing item without a request (current 0/1)
main debug: nothing to play
qt4 debug: IM: Deleting the input
main debug: TIMER input launching for 'http://10.0.0.30/video.mkv' : 11974.001 ms - Total 11974.001 ms / 1 intvls (Avg 11974.000 ms)

因此,从该日志中可以看出,VLC 在通过 Windows NTLM 登录身份验证与 IIS 服务器进行身份验证时遇到问题。我还尝试设置一个没有登录系统的 apache 服务器,它成功地按照我想要的方式播放了文件,但我需要一个登录系统。

所以我的问题是,有没有办法通过 NTLM 登录方法来实现这一点? 如果没有,我该如何管理它,例如使用表单身份验证的 ASP.net 或使用会话的 PHP,哪一个并不重要,我只需要 VoD 流位于登录系统后面,我会想我自己如何将登录信息连接到 NTLM 方法。

任何帮助将不胜感激,因为我真的被困在这个问题上。

I have searched the VLC forums and basically all over google for the past week trying to find some information regarding this, since I'm having problems making videos stream from my IIS server.
Sadly, i was not able to find a solution to this, which is why I ask for help here.

I have an IIS 7.5 server running on a Windows 7 64-bit server/computer. I use the VLC Web Plugin for Mozilla Firefox to play the video file in a browser, but without success.
It should also be noted that I have added the MIME type .mkv to the IIS MIME-Types as video/x-matroska, so this should not be the problem. Also, I have given every user full access rights to the entire www folder and the file, so this should not be the problem either.
I cut it down to a very basic HTML file "index.html" and saved the video file right next to the HTML page. Here is my HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/   xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 
</head>

<body style="width:100%; height:100%;">

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
    width="720"
    height="405"
    autoplay="no"
    id="vlc"
    target="video.mkv">
</embed>

<script type="text/javascript">

   var vlc = document.getElementById("vlc");
   function mute(){
      vlc.audio.toggleMute();
   }
   function play(){
      vlc.playlist.play();
   }
   function stop(){
      vlc.playlist.stop();

   }
   function pause(){   
      vlc.playlist.togglePause();
   }
</script>

<br />
   <input type="button" onclick='play();' value="Play" /><br>
   <input type="button" onclick='pause();' value="Pause" /><br>
   <input type="button" onclick='stop();' value="Stop" /><br>   
   <input type="button" onclick='mute();' value="Mute" /><br>

</body>
</html>

This code works perfectly locally, by opening the HTML file directly in Firefox without the use of the web server. But as soon as I put it on the IIS web server the play button simply does nothing. It can't authenticate or something.
Here is the log from VLC when I input the video URL from the web server directly into the VLC Media Player:

qt4 warning: Input option: http-caching=1200
main debug: adding item `http://10.0.0.30/video.mkv' ( http://10.0.0.30/video.mkv )
qt4 debug: Adding a new MRL to recent ones: http://10.0.0.30/video.mkv
main debug: rebuilding array of current - root Spilleliste
main debug: rebuild done - 1 items, index -1
main debug: processing request item http://10.0.0.30/video.mkv node null skip 0
main debug: resyncing on http://10.0.0.30/video.mkv
main debug: http://10.0.0.30/video.mkv is at 0
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for 'http://10.0.0.30/video.mkv'
main debug: thread (input) created at priority 1 (../.././src/input/input.c:220)
main debug: thread started
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path 'C:\Users\myuser\AppData\Local\Temp'
main debug: `http://10.0.0.30/video.mkv' gives access `http' demux `' path `10.0.0.30/video.mkv'
main debug: creating demux: access='http' demux='' path='10.0.0.30/video.mkv'
main debug: looking for access_demux module: 0 candidates
main debug: no access_demux module matched "http"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: creating access 'http' path='10.0.0.30/video.mkv'
main debug: looking for access module: 2 candidates
access_http debug: http: server='10.0.0.30' port=80 file='/video.mkv'
main debug: net: connecting to 10.0.0.30 port 80
qt4 debug: IM: Setting an input
main debug: connection succeeded (socket = 1440)
access_http debug: protocol 'HTTP' answer code 401
access_http debug: Content-Type: text/html
access_http debug: Server: Microsoft-IIS/7.5
access_http debug: Authentication header: Negotiate
main warning: Unknown authentication scheme: 'Negotiate'
access_http debug: Authentication header: NTLM
main warning: Unknown authentication scheme: 'NTLM'
access_http debug: this frame size=1326
access_http debug: authentication failed for realm (null)
access_http debug: retrying with user=ServerAdmin
main debug: net: connecting to 10.0.0.30 port 80
main debug: connection succeeded (socket = 1440)
access_http debug: protocol 'HTTP' answer code 401
access_http debug: Content-Type: text/html
access_http debug: Server: Microsoft-IIS/7.5
access_http debug: Authentication header: Negotiate
main warning: Unknown authentication scheme: 'Negotiate'
access_http debug: Authentication header: NTLM
main warning: Unknown authentication scheme: 'NTLM'
access_http debug: this frame size=1326
access_http debug: authentication failed for realm (null)
main debug: net: connecting to 10.0.0.30 port 80
main debug: connection succeeded (socket = 1484)
access_mms error: error: HTTP/1.1 401 Unauthorized
main debug: no access module matching "http" could be loaded
main debug: TIMER module_need() : 11949.001 ms - Total 11949.001 ms / 1 intvls (Avg 11949.000 ms)
main debug: waitpipe: object killed
main error: open of `http://10.0.0.30/video.mkv' failed: (null)
main debug: finished input
main debug: thread ended
main debug: dead input
main debug: thread times: real 0m11.948683s, kernel 0m0.000000s, user 0m0.000000s
main debug: changing item without a request (current 0/1)
main debug: nothing to play
qt4 debug: IM: Deleting the input
main debug: TIMER input launching for 'http://10.0.0.30/video.mkv' : 11974.001 ms - Total 11974.001 ms / 1 intvls (Avg 11974.000 ms)

So, from what I can see from this log, VLC is having problems authenticating with the IIS server through the windows NTLM login authentication. I also tried setting up an apache server with no login system, which successfully played the file as I wanted, but I need a login system for this.

So my question is, is there a way to make this work through the NTLM login method?
And if not, how do I manage it in for example ASP.net using forms authentication, or PHP using sessions, it doesn't really matter which one, I just need the VoD streaming to be behind a login system, I'll figure out how to connect the login information to the NTLM method myself.

Any help would be greatly appreciated, since I'm really stuck here on this one.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一页 2024-12-28 01:59:11

VLC 不并且不会支持 NTLM 身份验证。

VLC does not and will not support NTLM authentication.

东风软 2024-12-28 01:59:11

也许已经晚了,但是,您可以使用 cntlm(http://cntlm.sourceforge.net/)

maybe is late but, you could use cntlm(http://cntlm.sourceforge.net/)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文