nginx-vod-module
nginx-vod-module copied to clipboard
Add advertisement in VOD
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?
You probably need to add #EXT-X-KEY:METHOD=NONE
before the ad.
Anyway, the question is not really related to this module...
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?
The module already outputs EXT-X-DISCONTINUITY if there are multiple clips
@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.