kaltura / nginx-vod-module

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

How to make subtitles work in mapped mode? #1180

Open amirreza1751 opened 4 years ago

amirreza1751 commented 4 years ago

I use the JSON response below to add subtitles to my videos. But it does not work. The video plays without any problem in VLC player, but it does not show list of subtitles.

This is my JSON response:

{ "sequences": [ { "language": "fas", "clips": [ { "type": "source",

                "path": "/home/amirak/web/farsi.srt"
            }
        ]
    },
    {
        "language": "eng",
        "clips": [
            {
                "type": "source",

                "path": "/home/amirak/web/eng.srt"
            }
        ]
    },
    {
        "clips": [
            {
                "type": "source",

                "path": "/home/amirak/web/ddd_1080k.mp4"
            }
        ]
    }
]

}

erankor commented 4 years ago

The JSON looks ok to me, can you send a link to the manifest?

amirreza1751 commented 4 years ago

I forgot to mention that I use hls. I think you mean the master or index playlist. here are master.m3u8 and then index.m3u8 playlists.

amirreza1751 commented 4 years ago

master playlist:

EXTM3U

EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs0",NAME="فارسی",LANGUAGE="fa",AUTOSELECT=YES,DEFAULT=YES,URI="http://vod.test/hls/test.json/index-f1.m3u8"

EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs0",NAME="English",LANGUAGE="en",AUTOSELECT=NO,DEFAULT=NO,URI="http://vod.test/hls/test.json/index-f2.m3u8"

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2157685,RESOLUTION=1920x1072,FRAME-RATE=23.974,CODECS="avc1.640028,mp4a.40.2",SUBTITLES="subs0"

http://vod.test/hls/test.json/index-f3-v1-a1.m3u8

EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=226697,RESOLUTION=1920x1072,CODECS="avc1.640028",URI="http://vod.test/hls/test.json/iframes-f3-v1-a1.m3u8"

amirreza1751 commented 4 years ago

A part of my index.m3u8:

EXTM3U

EXT-X-TARGETDURATION:10

EXT-X-ALLOW-CACHE:YES

EXT-X-PLAYLIST-TYPE:VOD

EXT-X-VERSION:3

EXT-X-MEDIA-SEQUENCE:1

EXTINF:10.000,

http://vod.test/hls/test.json/seg-1-f3-v1-a1.ts

EXTINF:10.000,

http://vod.test/hls/test.json/seg-2-f3-v1-a1.ts

EXTINF:10.000,

http://vod.test/hls/test.json/seg-3-f3-v1-a1.ts

EXTINF:10.000,

http://vod.test/hls/test.json/seg-4-f3-v1-a1.ts

EXTINF:10.000,

http://vod.test/hls/test.json/seg-5-f3-v1-a1.ts

erankor commented 4 years ago

The master looks good, the subtitles are there... try another player maybe, e.g. Safari on iPhone

amirreza1751 commented 4 years ago

I will test it on iPhone and mention the results. However, I did not expect any problems on VLC player.

amirreza1751 commented 4 years ago

Recently, I have tested VOD streaming on several players, such as safari (on iPhone), jwplayer (web) and vlc player (Windows and Linux). It is worth mentioning that only vlc player has problem with external subtitles, and I think it might be related to the HLS protocol. In addition, I have not used the dash protocol yet.