kaltura / nginx-vod-module

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

hls mapped mode with multiple subtitles, cannot make it work #1528

Closed YannDeephouse closed 1 week ago

YannDeephouse commented 1 week ago

Hi everyone, I do not manage to create a proper json which allows to expose multiple mp4 renditions and multiple language of subtitles. This is the json I have:

{
    "sequences": [
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_1080p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_720p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_480p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_360p.mp4"
                }
            ]
        },
        {
            "language": "eng",
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/mysubs.srt"
                }
            ]
        },
        {
            "language": "swe",
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/minsprak.srt"
                }
            ]
        }
    ]
}

It does not work. But if I keep 1 or 2 video renditions with the 2 subs => it works fine OR if I keep all 4 renditions with 1 sub => it works fine

Could you help me see where I do not format my json properly?

Thank you

YannDeephouse commented 1 week ago

I tried to implement what was proposed in #242 :

{
    "sequences": [
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/video.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/path/to/subtitle.srt"
                }
            ],
            "language": "eng",
            "label": "English"
        }
    ]
}

It works with 1 subtitle file AND if i do not have "label": "English" in the json. If i have the labal in the json i get a 503.

so, I tried this but it is not successful:

{
    "sequences": [
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_1080p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_720p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_480p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/playl2_360p.mp4"
                }
            ]
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/mysubs.srt"
                }
            ],
            "language": "eng"
        },
        {
            "clips": [
                {
                    "type": "source",
                    "path": "/etc/nginx/vod/minsprak.srt"
                }
            ],
            "language": "swe"
        }
    ]
}
erankor commented 1 week ago

This JSON looks ok to me, check the nginx error log, you should see an informative error explaining why you got 503.

YannDeephouse commented 1 week ago

Hi Erankor, This is the error i get in the logs : [error] 1263#1263: 1 ngx_http_vod_map_run_step: mapping size 1241 greater than limit 1024 while getting mapping, client: 192.168.1.153, server: , request: "GET /video/playl2_all.json/master.m3u8 HTTP/1.0", host: "192.168.1.156" [error] 1263#1263: 2 ngx_http_vod_map_run_step: mapping size 1241 greater than limit 1024 while getting mapping, client: 192.168.1.153, server: , request: "GET /video/playl2_all.json/master.m3u8 HTTP/1.0", host: "192.168.1.156"

erankor commented 1 week ago

make sense... so just increase the limit to a value that suffices for your use case, e.g. vod_max_mapping_response_size 10k;

YannDeephouse commented 1 week ago

Thank you Erankor. I had no such configuration in my nginx.cong. Working now. This is such an amazing module, thank you.

YannDeephouse commented 1 week ago

All working, closing the issue