kaltura / nginx-vod-module

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

feat: Add tracks (WebVTT) roles attribute #1305

Open francoism90 opened 3 years ago

francoism90 commented 3 years ago

This is my manifest:

{
    "id": "video_8bc832af1d1e400cb6ac663719a55a44",
    "sequences": [
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/mp4"
                }
            ]
        },
        {
            "id": "CC1",
            "label": "2f327d3b-6783-4efa-b780-d409cb4cb1e5",
            "language": "eng",
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/eng.vtt"
                }
            ]
        },
        {
            "id": "SERVICE1",
            "label": "sprite",
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/sprite.vtt"
                }
            ]
        }
    ]
}

I'm testing with dash.js and it seems to parse them both as captions (kind). Is this normal? I would expect the type metadata.

Thanks. :)

francoism90 commented 3 years ago

It seems dashjs uses an unofficial extra field called roles/role to define track types: https://github.com/Dash-Industry-Forum/dash.js/issues/1236 https://github.com/Dash-Industry-Forum/dash.js/pull/1801

Maybe the roles attribute could be added?

I was also wondering if this is the correct way of defining closed captions in the manifest. The closedCaptions array seems to exists, but I don't know if you should use it to define the tracks?

erankor commented 3 years ago

The closedCaptions property can be used to define CEA-608/708 captions, but it's currently implemented only for HLS.

francoism90 commented 3 years ago

@erankor Does this controls the 'roles' like I would like to do? It would be great if this could be added to DASH as well. :)

Thanks.

erankor commented 3 years ago

Roles are not supported, but I didn't quite understand what output you were expecting...

francoism90 commented 3 years ago

@erankor I would like to control the track types, currently they all are considered the same type: captions . Only one of them can be (pre)selected and the metadata one will be selected as a caption.

I would like to add metadata (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track#attr-kind) tracks to use for different scenarios, like showing thumbnails or showing any other meta data.

Chapters also exist as track kind, but I don't know if they are also not part of the DASH spec.?

siyaliser commented 1 year ago

Hi , I want to extract all CC for mapped mode , but , i dont see any detailed documents for mapped mode. What is wrong in my json. master.m3u8 return cc options, but players says no subtitle.

{ "cache": "false", "discontinuity": "true", "sequences": [ { "clips": [ { "tracks": "v1", "type": "source", "path": "/media/240p.mp4" } ] }, { "clips": [ { "tracks": "v1", "type": "source", "path": "/media/144p.mp4" } ] }, { "language": "und", "clips": [ { "tracks": "a1", "type": "source", "path": "/media/144p.mp4" } ] }, { "language": "eng", "clips": [ { "tracks": "a2", "type": "source", "path": "/media/144p.mp4" } ] } ], "closedCaptions": [ { "id": "CC3", "language": "eng", "label": "eng", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC4", "language": "hun", "label": "hun", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC5", "language": "deu", "label": "deu", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC6", "language": "fra", "label": "fra", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC7", "language": "spa", "label": "spa", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC8", "language": "ita", "label": "ita", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC9", "language": "jpn", "label": "jpn", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] }, { "id": "CC10", "language": "und", "label": "und", "clips": [ { "type": "source", "path": "/media/144p.mp4" } ] } ] }

erankor commented 1 year ago
  1. There is no clips attribute under closedCaptions, it is ignored - the closedCaptions must apply to ALL video renditions.
  2. In the id field, CC indicates 608 captions while SERVICE indicates 708 captions. You used CC1-CC10, but only 4 channels exist in 608 (CC1-CC4), so it doesn't make sense... Maybe you have 708 captions, but these are not supported by most players.
  3. I suggest you pull the master playlist, and verify that the EXT-X-MEDIA tags for CLOSED-CAPTIONS are included there, to make sure the module indeed "saw" the closed captions you defined in the JSON.
siyaliser commented 1 year ago

Thank you for the quick response. its resolved.