Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support EXT-X-SCTE when encoding playlists #41

Merged
merged 1 commit into from
Mar 22, 2016
Merged

Support EXT-X-SCTE when encoding playlists #41

merged 1 commit into from
Mar 22, 2016

Conversation

bradleyfalzon
Copy link
Collaborator

Expands upon #40 to support encoding the SCTE segments into a playlist.

Such that the following:

package main

import (
        "fmt"

        "github.com/grafov/m3u8"
)

func main() {
        p, _ := m3u8.NewMediaPlaylist(1, 1)
        _ = p.Append("test01.ts", 5.0, "")
        _ = p.SetSCTE("CueData", "ID", 3.141)
        fmt.Print(p.String())
}

Outputs:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:5
#EXT-X-SCTE:CUE="CueData",ID="ID",TIME=3.141
#EXTINF:5.000,
test01.ts

@bradleyfalzon
Copy link
Collaborator Author

@vishal24tuniki if you have a moment, can you look over this and ensure it's behaving as expected, if you're OK with it, I'll merge.

@vishal24tuniki
Copy link
Contributor

@bradleyfalzon Yes sure, will go over it in couple of hours :)

@@ -449,6 +449,22 @@ func (p *MediaPlaylist) Encode() *bytes.Buffer {
if p.winsize > 0 { // skip for VOD playlists, where winsize = 0
i++
}
if seg.SCTE != nil {
p.buf.WriteString("#EXT-X-SCTE:")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the tag to #EXT-SCTE35 from #EXT-X-SCTE

@vishal24tuniki
Copy link
Contributor

@bradleyfalzon Everything looks fine. Just the SCTE tag is wrong as mentioned in the inline code comments

@bradleyfalzon
Copy link
Collaborator Author

Brilliant, thanks @vishal24tuniki

bradleyfalzon added a commit that referenced this pull request Mar 22, 2016
Support EXT-X-SCTE when encoding playlists
@bradleyfalzon bradleyfalzon merged commit 47e27b4 into grafov:master Mar 22, 2016
@bradleyfalzon bradleyfalzon deleted the scte-writer branch March 22, 2016 09:31
@vishal24tuniki
Copy link
Contributor

#EXT-SCTE: is still wrong, its #EXT-SCTE35:

grafov pushed a commit that referenced this pull request Nov 22, 2016
Support EXT-X-SCTE when encoding playlists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants