kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
1.99k stars 439 forks source link

Building URL with separate video audio files #1343

Closed rguedes closed 2 years ago

rguedes commented 2 years ago

Hey,

I'm using [nginx-vod-module] as local mode.

Domain.tld

Files:

video: TITLE.720p.6f934a9.mp4 video: TITLE.1080p.6f934a9.mp4

audio: TITLE.AAC2.0.en.5ab34b.mp4 audio: TITLE.AC3.5.1.en.5ab34b.mp4

audio: TITLE.AAC2.0.de.6bb34b.mp4

subs: TITLE.en.d9cba4.srt subs: TITLE.pt-PT.3c49f2.srt subs: TITLE.fi.a679e2.srt

How can I build the url to DASH and HLS?

With a single video+audio file, I'm building like that: https://Domain.tld/dash/,TITLE.720p.AAC2.0.en.mp4,lang/eng/TITLE.en.d9cba4.srt,lang/por/TITLE.pt-PT.3c49f2.srt,.urlset/manifest.mpd or https://Domain.tld/dash/,TITLE.1080p.AAC2.0.en.mp4,TITLE.720p.AAC2.0.en.mp4,lang/eng/TITLE.en.d9cba4.srt,lang/por/TITLE.pt-PT.3c49f2.srt,.urlset/manifest.mpd

But now, I want to build with separate video and audio files, because I want to reuse the audios with different resolutions and subs, depending on device type and user language.

rguedes commented 2 years ago

similar: https://github.com/kaltura/nginx-vod-module/issues/908

erankor commented 2 years ago

Sorry, I don't understand the question... In general, you can take all the URLs you want (video, audio, captions) and combine them in multi-url syntax. The sample files you listed seem problematic though, because you have English AC3/5.1, without a matching German file, so don't see how that would work...

rguedes commented 2 years ago

I have:

I want to build different urls like that:

ngx_http_vod_validate_streams: no matching streams were found while reading media header,

rguedes commented 2 years ago

I try with mapped too:


{
  "sequences": [
    {
      "clips": [
        {
          "type": "source",
          "path": "/media/a2b1e3/video1.1080p.mp4"
        }
      ]
    },
    {
      "clips": [
        {
          "type": "source",
          "path": "/media/a2b1e3/video1.720p.mp4"
        }
      ]
    },    
    {
      "clips": [
        {
          "type": "source",
          "path": "/media/a2b1e3/audio_ac3_en.mp4"
        }
      ]
    },    
    {
      "clips": [
        {
          "type": "source",
          "path": "/media/a2b1e3/audio_aac_en.mp4"
        }
      ]
    },
    {
      "language": "por",
      "clips": [
        {
          "type": "source",
          "path": "/media/a2b1e3/subs.pt-PT.3c49f2.srt"
        }
      ]
    },
    {
      "language": "eng",
      "clips": [
        {
          "type": "source",
          "path": "/media/a2b1e3/subs.en.d9cba4.srt"
        }
      ]
    }
  ]
}

error: ngx_http_vod_validate_streams: no matching streams were found while getting mapping

erankor commented 2 years ago

This error normally means either non-supported codec, or that the MP4 is a fragmented MP4 (which is not supported). When you pass multiple files, it takes whatever it can, so you're probably getting only a subset of what you provided, and don't notice it. In general, building partial URLs should work fine (it's a subset of the functionality of providing all...), but another alternative you may choose to use is to pass the list of sequences on the file name. For example .../manifest-f1-f2.mpd will return only the first two sequences. On one hand, this still leaves you with long URLs, but the upside is that the segments will have the same URLs as the "full" version, and they can be reused in CDN cache.

rguedes commented 2 years ago

This error normally means either non-supported codec, or that the MP4 is a fragmented MP4 (which is not supported).

I do some tests, and Make sense and you're right. Is there any debugger?

erankor commented 2 years ago

If you compile nginx with --with-debug and set the error_log level to debug, you'll get additional log messages. If that is not enough, you can use gdb.

rguedes commented 2 years ago

Fixed.

I used MP4Box to "remux" the mp4 again and that fixed my problem ;)

Thx for support and feedback.