连接 m4s vimeo 文件

问题描述 投票:0回答:1

下载 vimeo 视频时,我的下载总是停在 99%。我留下了两个 m4s 文件集合;一种用于视频,一种用于音频流。

我尝试了所有可能的解决方案,但没有一个对我有用。将扩展名重命名为 mp4 不起作用,与 ffmpeg 的连接也不起作用。我意识到视频流是由一个 init.mp4 文件创建的,后面跟着其他片段一一创建。视频播放器在单独的文件中获取有关流质量的信息,通常以文本格式。然后,它使用带有视频标头的 init.m4s 文件作为启动,并将片段按照正确的顺序一一粘贴到该文件上。相同的过程也适用于音频流。

我使用浏览器、hexeditor 和 ffmpeg 的开发工具找到了这个解决方案:

  • 打开带有视频的页面并打开开发者工具(Firefox 中为 CTRL-SHIFT-C)
  • 在视频播放器中按播放并在开发者工具中监控网络流量。
  • a 找到一个包含信息的 json 文件并将其保存到磁盘

该文件包含有关流的所有信息。有五个视频流和三个音频流的描述。 1280x720 视频流看起来像这样:

    {
      "id": "b522db58",
      "base_url": "video/",
      "format": "dash",
      "mime_type": "video/mp4",
      "codecs": "avc1.640020",
      "bitrate": 2895000,
      "avg_bitrate": 1068000,
      "duration": 6787.88,
      "framerate": 25,
      "width": 1280,
      "height": 720,
      "max_segment_duration": 7,
      "init_segment": "AAAAIGZ0eXBkYXNoAAAAAGRhc2htcDQybXA0MWlzbzYAAAMfbW9vdgAAAGxtdmhkAAAAAN+RBZPfkQWTAAAAGQAAAAAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACFpb2RzAAAAABCAgIAQAE////9//w6AgIAEAAAAAQAAAk50cmFrAAAAXHRraGQAAAAH35EFk9+RBZMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAABQAAAALQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAAAAAAAAwABAAAAAAHGbWRpYQAAACBtZGhkAAAAAN+RBZPfkQWTAAAAGQAAAABVxAAAAAAANmhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABMLVNNQVNIIFZpZGVvIEhhbmRsZXIAAAABaG1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAShzdGJsAAAAsHN0c2QAAAAAAAAAAQAAAKBhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAABQAC0ABIAAAASAAAAAAAAAABCkFWQyBDb2RpbmcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAN2F2Y0MBZAAg/+EAG2dkACCs2YBQBbpqAgICgAAAAwCAAAAZB4wYzQEABWjpeyyL/fj4AAAAABNjb2xybmNseAABAAEAAQAAAAAQc3R0cwAAAAAAAAAAAAAAEHN0c2MAAAAAAAAAAAAAABRzdHN6AAAAAAAAAAAAAAAAAAAAEHN0Y28AAAAAAAAAAAAAABhzZ3BkAQAAAHJvbGwAAAACAAAAAAAAABRzYmdwAAAAAHJvbGwAAAAAAAAAPG12ZXgAAAAUbWVoZAEAAAAAAAAAAAKW4QAAACB0cmV4AAAAAAAAAAEAAAABAAAAAQAAAAAAAQAA",
      "index_segment": "b522db58.mp4?r=dXMtd2VzdDE%3D&range=831-14434",
      "segments": [
        {
          "start": 0,
          "end": 6.08,
          "url": "b522db58.mp4?r=dXMtd2VzdDE%3D&range=14435-328375",
          "size": 313940
        },
        {

您可以通过查看尺寸来识别正确的段

  • 对音频流重复相同的过程:
"audio": [
    {
      "id": "d27f1f72",
      "base_url": "audio/",
      "format": "dash",
      "mime_type": "audio/mp4",
      "codecs": "mp4a.40.2",
      "bitrate": 191000,
      "avg_bitrate": 191000,
      "duration": 6787.84,
      "channels": 2,
      "sample_rate": 48000,
      "max_segment_duration": 8,
      "init_segment": "AAAAIGZ0eXBkYXNoAAAAAGRhc2htcDQybXA0MWlzbzYAAAKmbW9vdgAAAGxtdmhkAAAAAN+RBlHfkQZRAAC7gAAAAAAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACFpb2RzAAAAABCAgIAQAE///yn//w6AgIAEAAAAAQAAAdV0cmFrAAAAXHRraGQAAAAH35EGUd+RBlEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAETa5AAAAAAAAABAAAAAAFNbWRpYQAAACBtZGhkAAAAAN+RBlHfkQZRAAC7gAAAAABVxAAAAAAANmhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABMLVNNQVNIIEF1ZGlvIEhhbmRsZXIAAAAA721pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAAs3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAAAEgICAFEAVAAAAAAAAAAAAAAAFgICAAhGQBoCAgAECAAAAEHN0dHMAAAAAAAAAAAAAABBzdHNjAAAAAAAAAAAAAAAUc3RzegAAAAAAAAAAAAAAAAAAABBzdGNvAAAAAAAAAAAAAAA8bXZleAAAABRtZWhkAQAAAAAAAAATa5AAAAAAIHRyZXgAAAAAAAAAAQAAAAEAAAABAAAAAAABAAA=",
      "index_segment": "d27f1f72.mp4?r=dXM%3D&range=710-14325",
      "segments": [
        {
          "start": 0,
          "end": 5.994666666666666,
          "url": "d27f1f72.mp4?r=dXM%3D&range=14326-157787",
          "size": 143461
        },
  • 创建一个值为 init_segmet 的文件 audio_start.mp4 并使用 https://www.base64decode.org/ 对它进行解码 .

  • 按正确的顺序将audio_start.mp4 与所有其他.m4s 文件连接起来。 (工具 -> 文件工具 -> 连接)。另存为音频.mp4

  • 使用 ffmpeg 并加入两个流

ffmpeg -i video.mp4 -i audio.mp4 -c copy output.mp4
  • 完成
video ffmpeg vod
1个回答
0
投票

我知道这已经很旧了,但我刚刚完成了这样的项目。请注意,至少有两种类型的 Vimeo 播放列表初始化段文件类型(扩展名): .m4s 和 .mp4 。在上面的情况下,您还需要下载 index_segment 并将其连接起来。如果您没有 {pathsig}.mp4&r={hex}&range={#-#} 您可能会有egment.m4s?pathsig={hex}&r={hex}&sid={#}&st={video|audio} 。如果两种文件类型的连接过程相同。

© www.soinside.com 2019 - 2024. All rights reserved.