我对mp3广播流的设置有一些疑问 [英] I have a few questions about the setup of an mp3 radio stream

查看:117
本文介绍了我对mp3广播流的设置有一些疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有这些之间有什么区别?他们的意思是什么?

What's the difference between all of these? And what are their meanings?

  1. /;stream.mp3 [; 分号在/斜杠后确切表示什么?]

  1. /;stream.mp3 [What exactly does the ; semicolon signify after the / slash?]

此外,如果我取下stream.mp3,只在斜线/;之后留下分号,或者如果我附加`stream.mp3,还有什么区别?

Also, what's the difference if I take off the stream.mp3, and just leave the semicolon after the slash /; or if I leave `stream.mp3 attached?

/stream [为什么这个只有stream,仅此而已. [在/斜杠后没有;分号,也没有stream.mp3?

/stream [How come this one has only stream, and that's it. [There's no ; semicolon after the / slash and there's no stream.mp3?

为什么没有分号的情况下一个流就可以工作,为什么一个流需要一个分号?

Why would one stream be able to work without a semicolon, and why would one stream need to have one?

http://91.223.18.205:8000/c11_4? [icecast]为什么这个在结尾处带有?问号[这表示什么?]

http://91.223.18.205:8000/c11_4? [icecast] Why does this one have a ? question mark at the end [and what does that signify?]

推荐答案

SHOUTcast通过与流完全相同的端口和路径来提供其管理接口.例如,假设我有一个在198.51.100.100的端口8000上运行的SHOUTcast服务器.如果我在浏览器中转到以下内容...

SHOUTcast serves its administrative interface from the exact same port and path as the stream. For example, suppose I have a SHOUTcast server running on port 8000 on 198.51.100.100. If I go to the following in my browser...

http:///198.51.100.100:8000/

...我将看到SHOUTcast管理页面,在这里我可以登录和删除连接,而不能.但是,如果我使用媒体播放器(例如VLC或Winamp)使用相同的URL,我会听到一个流.

... I will see the SHOUTcast admin page, where I can login and drop connections and what not. However if I go to that same URL with a media player (such as VLC or Winamp), I will hear a stream.

SHOUTcast根据User-Agent请求标头知道给我哪个.此标头指示什么客户端正在尝试连接到服务器.当我连接浏览器时,可能看起来像这样:

SHOUTcast knows which to give me based on the User-Agent request header. This header indicates what client is trying to connect to the server. When I connect with my browser, it might look something like this:

Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36

如果我连接VLC,则User-Agent请求标头可能看起来像这样:

If I connect with VLC, the User-Agent request header might look like this:

NSPlayer/7.10.0.3059

SHOUTcast没有所有浏览器的列表.相反,它只查找一个关键字... Mozilla.由于历史原因,在大多数浏览器的用户代理字符串中都可以找到它.如果User-Agent请求标头中包含Mozilla,则SHOUTcast发送管理页面.对于所有其他对象,它将发送一个流.

SHOUTcast doesn't have a list of all browsers. Instead, it looks for only one keyword... Mozilla. This is found in most browsers'user agent strings, for historical reasons. If Mozilla is in the User-Agent request header, then SHOUTcast sends the admin page. For all others, it sends a stream.

这会带来很多问题.最值得注意的是,这意味着您无法在浏览器中收听流.如果您将该流加载到网页上,则User-Agent字符串将包含Mozilla,并且SHOUTcast服务器将发送管理页面,从而导致播放器错误.

This creates lots of problems. Most notably, it means you cannot listen to the stream in a browser. If you load that stream on a web page, the User-Agent string will contain Mozilla, and the SHOUTcast server will send the admin page, causing an error with the player.

有一种解决方法.如果在请求路径中添加分号;,则SHOUTcast会忽略实际的User-Agent并将其替换为MPEG OVERRIDE. (您可以在SHOUTcast服务器日志中看到它.)这使服务器发送实际的广播流.

There is a way around this. If in the request path you add a semicolon ;, SHOUTcast ignores the actual User-Agent and replaces it with MPEG OVERRIDE. (You can see this in your SHOUTcast server logs.) This causes the server to send the actual radio stream.

因此,在SHOUTcast流的路径中经常看到分号;.但是,;stream.mp3呢?某人做了一天,其他所有人都复制并粘贴了它.就那么简单. SHOUTcast服务器会忽略该分号之后的所有内容,因此您可以在其中放置任何内容.

Because of this, it's common to see a semicolon ; in the path for SHOUTcast streams. But, what about ;stream.mp3? Someone did it one day and everyone else copied and pasted it. Simple as that. The SHOUTcast server ignores everything after that semicolon, so you can put whatever you want there.

有时,.mp3可能是有原因的.通过HTTP加载时,应该能够通过Content-Type响应标头确定某种类型. 文件名"是完全没有意义的.您可以将Web服务器配置为使用任何文件扩展名来命名任意名称,只要您发送了正确的Content-Type响应头,一切就可以了.在过去的约15年中,有一次,我遇到了软件,该软件假定文件扩展名是有效且必需的.这是做事的非常错误的方式.幸运的是,他们修复了问题,一切都很好.这是一个非常罕见的问题,您不必担心.

Occasionally, there may be a reason for the .mp3 though. When loading over HTTP, you're supposed to be able to determine what type something is by the Content-Type response header. The "file name" is completely meaningless. You could configure a web server to name something whatever you want with any file name extension, and as long as you sent the correct Content-Type response header, all is well. One time, in the last ~15 years, I came across software that assumed file name extensions were valid and required. This was a very buggy way to do things. Fortunately, they fixed it, and all was well. This is a really rare problem, and not one you should worry about.

现在,您可以在其他问题上解释SHOUTcast的骇客了.

Now that SHOUTcast hacks are explained... onto your other questions.

/stream [为什么只有一个流,仅此而已. [没有; /斜杠后的分号,没有stream.mp3?

/stream [How come this one has only stream, and that's it. [There's no ; semicolon after the / slash and there's no stream.mp3?

运行服务器的服务器可以执行所需的任何操作.这只是普通的HTTP.路径可以是任何东西.在这种情况下,有人决定调用此处运行的任何内容/stream.他们可能还没有使用SHOUTcast. (同样,SHOUTcast是非标准且不正常的.)

Those running the servers can do whatever they want. It's just normal HTTP. Paths can be anything. In this case, someone decided to call whatever is running there /stream. They're probably also not using SHOUTcast. (Again, SHOUTcast is non-standard and not normal.)

为什么一个流无需分号就可以工作,为什么一个流需要一个分号?

Why would one stream be able to work without a semicolon, and why would one stream need to have one?

只有SHOUTcast要求分号;可以正常工作.其他服务器不需要此hack.

Only SHOUTcast requires the semicolon ; to work as expected. Other servers don't require this hack.

http://91.223.18.205:8000/c11_4 ? [icecast]为什么这个有一个?末尾问号[这代表什么?]

http://91.223.18.205:8000/c11_4? [icecast] Why does this one have a ? question mark at the end [and what does that signify?]

URL中的问号?将路径与查询字符串分开.查询字符串可用于提供参数列表,通常用于路径中的脚本.在这种情况下,问号无关紧要,因为它后面没有参数.

Question marks ? in URLs separate the path from the query string. A query string can be used to provide a list of parameters, usually for a script at the path. In this case, the question mark doesn't matter because there are no parameters after it.

旧的IE(我认为是4)曾经过度缓存内容,但是如果涉及到查询字符串,通常不会.有时人们会添加带有随机数的查询字符串,以确保他们从服务器收到了新的副本.这是很长时间以来都不需要的黑客了. IE 4出现在将近20年前.这些天,我们使用适当的缓存控制标头. SHOUTcast,Icecast和其他工具都可以正确执行此操作.

Old IE (4, I think) used to overly cache things, but often wouldn't if there were a query string involved. Sometimes people would add query strings with a random number to ensure they received a fresh copy from the server. This is a hack that hasn't been needed in a very long time. IE 4 came out nearly 20 years ago. These days, we use the proper cache control headers. SHOUTcast, Icecast, and others, all do this correctly.

这篇关于我对mp3广播流的设置有一些疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆