Linux 如何将 IIS 平滑流 (ISM) 下载为 MKV 或 AVI?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9658310/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:05:48  来源:igfitidea点击:

How to download IIS smooth streaming (ISM) as MKV or AVI?

linuxstreamdownloadsmooth-streaming

提问by pts

There is an audio+video stream in IIS smooth streaming (ISM) format available via HTTP. The .ism/manifestfile looks like:

有一个通过 HTTP 可用的 IIS 平滑流 (ISM) 格式的音频 + 视频流。该.ism/manifest文件如下所示:

<?xml version="1.0" encoding="utf-16"?>
<SmoothStreamingMedia MajorVersion="2" MinorVersion="1" Duration="26571612076">
  <StreamIndex Type="video" Name="video" Chunks="1329" QualityLevels="3"
               MaxWidth="848" MaxHeight="480" DisplayWidth="853" DisplayHeight="480"
               Url="QualityLevels({bitrate})/Fragments(video={start time})">
    <QualityLevel Index="0" Bitrate="900000" FourCC="H264"
                  MaxWidth="848" MaxHeight="480" CodecPrivateData="..." />
    <QualityLevel Index="1" Bitrate="735000" FourCC="H264"
                  MaxWidth="736" MaxHeight="416" CodecPrivateData="..." />
    <QualityLevel Index="2" Bitrate="600000" FourCC="H264"
                  MaxWidth="624" MaxHeight="352" CodecPrivateData="..." />
    <c d="20400971" /> <c d="20000000" /> ...
  </StreamIndex> 
  <StreamIndex Type="audio" Index="0" Name="audio" Chunks="1329" QualityLevels="1"
               Url="QualityLevels({bitrate})/Fragments(audio={start time})">
    <QualityLevel FourCC="AACL" Bitrate="256000" SamplingRate="44100" Channels="2"
                  BitsPerSample="16" PacketSize="4" AudioTag="255"
                  CodecPrivateData="1210" />
    <c d="20201360" /> <c d="19969161" /> ...
  </StreamIndex>
  <StreamIndex Type="text" Subtype="CHAP">
    <Content>
      <Marker Time="0" Value="Thumbnail" />
      <Marker Time="664290000" Value="Thumbnail" /> ...
    </Content>
  </StreamIndex>
</SmoothStreamingMedia>

I need a command-line tool (or a library) on Linux which can download the individual audio and video chunks of this stream, and multiplex it to an AVI or MKV file.

我需要 Linux 上的命令行工具(或库),它可以下载此流的各个音频和视频块,并将其多路复用为 AVI 或 MKV 文件。

Actually, downloading is easy: Using the Url=values in the manifest file I can construct the URLs of the chunk, and I can use e.g. wgetor curlto download the chunks. So if there is a tool which can mux the chunks to an AVI or MKV file, that's good enough for me.

实际上,下载很容易:使用Url=清单文件中的值我可以构造块的 URL,并且我可以使用例如wgetcurl来下载块。因此,如果有一种工具可以将块多路复用为 AVI 或 MKV 文件,那对我来说就足够了。

I know about ISM Downloaderand RTL Downloader by the same author. They are .NET applications and not open source. Ideally I'm looking for a small, self-contained open source tool which doesn't require .NET or Java. I'd prefer C, C++, Perl, Python, Ruby program.

我知道同一作者的ISM 下载器和 RTL 下载器。它们是 .NET 应用程序而不是开源的。理想情况下,我正在寻找一个不需要 .NET 或 Java 的小型、自包含的开源工具。我更喜欢 C、C++、Perl、Python、Ruby 程序。

采纳答案by athoik

You can also try smoothget: https://github.com/pinglossy/smoothget, it's written in C#

您也可以尝试 smoothget:https: //github.com/pinglossy/smoothget,它是用 C# 编写的

回答by ao2

You can try with smooth-dl: http://git.ao2.it/smooth-dl.git/but it has limited features, it just prepares the streams for muxing and you can then do that with ffmpeg (or VirtualDub on windows?). Patches to make it more usable are welcome.

您可以尝试使用 smooth-dl:http: //git.ao2.it/smooth-dl.git/但它的功能有限,它只是准备用于多路复用的流,然后您可以使用 ffmpeg(或 Windows 上的 VirtualDub) ?)。欢迎使用补丁使其更可用。

There is also libsmth: https://github.com/satufk/libsmth

还有libsmth:https: //github.com/satufk/libsmth

回答by Matteo

You can try smthplayer: http://sourceforge.net/projects/smthplayer/, but you have to do some fixes to the source code because:

您可以尝试 smthplayer:http: //sourceforge.net/projects/smthplayer/,但您必须对源代码进行一些修复,因为:

  1. It's only a player, so it generates a .264 or .vc1 video file and a .aac or a .wav file that you have to mux later;

  2. Since version 0.4, the author added a function that compromises the video file to avoid recording.

  1. 它只是一个播放器,所以它会生成一个 .264 或 .vc1 视频文件和一个 .aac 或 .wav 文件,您必须稍后进行多路复用;

  2. 从0.4版本开始,作者增加了对视频文件进行妥协以避免录制的功能。

Modify it only for your personal use (so don't publish modified versions), because limitations are for legal reasons...

修改它仅供您个人使用(所以不要发布修改版本),因为限制是出于法律原因......

回答by athoik

VLC Media Player supports IIS Smooth Streaming. Go to Media, Convert / Save, Network tab, paste the link to the manifest file, click on Convert / Save, choose a format and press Start.

VLC 媒体播放器支持 IIS 平滑流。转到“媒体”、“转换/保存”、“网络”选项卡,将链接粘贴到清单文件,单击“转换/保存”,选择一种格式并按“开始”。