nginx-vod-module icon indicating copy to clipboard operation
nginx-vod-module copied to clipboard

Add advertisement in VOD

Open seedoubleu opened this issue 2 years ago • 4 comments

hi, I try to put some advertisement in VOD video, and is the EXT-X-DISCONTINUITY tag supported? I modified the m3u8 file to play the video, add the advertisement TS file url as first ts, remove #EXT-X-MEDIA-SEQUENCE:1, the video is work. But when i add it not at the head of the TS list, it failed.

at head of m3u8:

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-VERSION:3
#EXTINF:3.000,
http://……/advertisement.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=AES-128,URI="http://192.168.192.182/decodeKey.php"
#EXTINF:10.000,
http://……/seg-1-v1-a1.ts
#EXTINF:10.000,
http://……/seg-2-v1-a1.ts
#EXTINF:10.000,
http:/……/seg-3-v1-a1.ts
#EXTINF:10.000,
http://……/seg-4-v1-a1.ts
#EXTINF:10.000,
http://……/seg-5-v1-a1.ts
……
……
……
#EXT-X-ENDLIST

not at head of the m3u8:

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-VERSION:3
#EXT-X-KEY:METHOD=AES-128,URI="http://192.168.192.182/decodeKey.php"
#EXTINF:10.000,
http://……/seg-1-v1-a1.ts
#EXTINF:10.000,
http://……/seg-2-v1-a1.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=NONE
#EXTINF:3.000,
http://……/advertisement.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=AES-128,URI="http://192.168.192.182/decodeKey.php"
#EXTINF:10.000,
http:/……/seg-3-v1-a1.ts
#EXTINF:10.000,
http://……/seg-4-v1-a1.ts
#EXTINF:10.000,
http://……/seg-5-v1-a1.ts
……
……
……
#EXT-X-ENDLIST

I remove the encryption, and it works. Is the EXT-X-KEY and EXT-X-DISCONTINUITY conflicted?

seedoubleu avatar Mar 08 '22 04:03 seedoubleu

You probably need to add #EXT-X-KEY:METHOD=NONE before the ad. Anyway, the question is not really related to this module...

erankor avatar Mar 08 '22 12:03 erankor

I added the #EXT-X-KEY:METHOD=NONE at the twelfth line in the above example:

#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=NONE
#EXTINF:3.000,
http://……/advertisement.ts
#EXT-X-DISCONTINUITY

I know is not really related to this module, but will the module support EXT-X-DISCONTINUITY in the near future?

seedoubleu avatar Mar 09 '22 01:03 seedoubleu

The module already outputs EXT-X-DISCONTINUITY if there are multiple clips

erankor avatar Mar 09 '22 08:03 erankor

@seedoubleu You need to set the discontinuity to the sequence # that your stream starts with. Effectively, keep synchronizing the sequence id every time the discontinuity is introduced.

mlevkov-ias avatar Sep 10 '22 07:09 mlevkov-ias