Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,go,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,go,windows

### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
coverage.*

# Test binary, built with `go test -c`
*.test
Expand All @@ -13,4 +19,54 @@ coverage.*
*.out

# Dependency directories (remove the comment below to include it)
vendor/
# vendor/

# Go workspace file
go.work

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,go,windows
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
11 changes: 11 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"ExpandedNodes": [
"",
"\\cmd",
"\\pkg",
"\\pkg\\cmaf",
"\\pkg\\scte35"
],
"SelectedNode": "\\pkg\\cmaf\\extensions.go",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Binary file added .vs/livesim2.slnx/v18/.wsuo
Binary file not shown.
74 changes: 74 additions & 0 deletions .vs/livesim2.slnx/v18/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\idris\\source\\Forks\\livesim2\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\idris\\source\\Forks\\livesim2\\pkg\\scte35\\scte35.go||{3B902123-F8A7-4915-9F01-361F908088D0}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:pkg\\scte35\\scte35.go||{3B902123-F8A7-4915-9F01-361F908088D0}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\idris\\source\\Forks\\livesim2\\pkg\\cmaf\\extensions.go||{3B902123-F8A7-4915-9F01-361F908088D0}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:pkg\\cmaf\\extensions.go||{3B902123-F8A7-4915-9F01-361F908088D0}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 6,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:128:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "extensions.go",
"DocumentMoniker": "C:\\Users\\idris\\source\\Forks\\livesim2\\pkg\\cmaf\\extensions.go",
"RelativeDocumentMoniker": "pkg\\cmaf\\extensions.go",
"ToolTip": "C:\\Users\\idris\\source\\Forks\\livesim2\\pkg\\cmaf\\extensions.go",
"RelativeToolTip": "pkg\\cmaf\\extensions.go",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABwAAAA8AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2026-06-12T08:35:23.1Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "scte35.go",
"DocumentMoniker": "C:\\Users\\idris\\source\\Forks\\livesim2\\pkg\\scte35\\scte35.go",
"RelativeDocumentMoniker": "pkg\\scte35\\scte35.go",
"ToolTip": "C:\\Users\\idris\\source\\Forks\\livesim2\\pkg\\scte35\\scte35.go",
"RelativeToolTip": "pkg\\scte35\\scte35.go",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2026-06-12T08:35:05.282Z",
"EditorCaption": ""
}
]
}
]
}
]
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,8 @@
"xlink",
"xsdate",
"zerolog"
],
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
10 changes: 9 additions & 1 deletion cmd/livesim2/app/livempd.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,18 @@ func LiveMPD(a *asset, mpdName string, cfg *ResponseConfig, drmCfg *drm.DrmConfi

if as.ContentType == "video" && cfg.SCTE35PerMinute != nil {
// Add SCTE35 signaling
var cmdType string

switch *cfg.SCTE35PerMinute {
case 1, 2, 3:
cmdType = ""
case 11, 12, 13, 21, 22, 23:
cmdType = "timesignal"
}
as.InbandEventStreams = append(as.InbandEventStreams,
&m.EventStreamType{
SchemeIdUri: scte35.SchemeIDURI,
Value: "",
Value: cmdType,
})
}

Expand Down
21 changes: 17 additions & 4 deletions cmd/livesim2/app/livesegment.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,28 @@ func genLiveSegment(log *slog.Logger, vodFS fs.FS, a *asset, cfg *ResponseConfig
startTime := uint64(meta.newTime)
endTime := startTime + uint64(meta.newDur)
timescale := uint64(meta.timescale)
emsg, err := scte35.CreateEmsgAhead(startTime, endTime, timescale, *cfg.SCTE35PerMinute)
log.Debug("Calling CreateEsmgAhead", "startTime ", startTime, "endTime", endTime, "timescale ", timescale, "Config ", *cfg)

emsgs, err := scte35.CreateEmsgAhead(startTime, endTime, timescale, *cfg.SCTE35PerMinute)
if err != nil {
return so, fmt.Errorf("insertSCTE35: %w", err)
}
if emsg != nil {
seg.Fragments[0].AddEmsg(emsg)
log.Debug("added SCTE-35 emsg message", "asset", a.AssetPath, "segment", segmentPart)

log.Debug("Num of EMSG", "EMSG", len(emsgs))

for i, emsg := range emsgs {
log.Debug("EMSG:", "INDEX:", i, "emsgs", fmt.Sprintf("%+v", *emsg))
}

for i, emsg := range emsgs {
if emsg != nil {
seg.Fragments[i].AddEmsg(emsg)
log.Debug("added SCTE-35 emsg message", "asset", a.AssetPath, "segment", segmentPart)
}
log.Debug("End of for....loop", "Index", i)
}
}

outSeg.seg = seg
outSeg.data = nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

var (
commitVersion string = "v1.9.0" // Should be updated during build
commitVersion string = "v2.0.0" // Should be updated during build
commitDate string = "1770277089" // commitDate in Epoch seconds (can be filled/updated in during build)
)

Expand Down
Binary file added livesim2.tgz
Binary file not shown.
Binary file added out/cmaf-ingest-receiver
Binary file not shown.
Binary file added out/dashfetcher
Binary file not shown.
Binary file added out/livesim2
Binary file not shown.
Loading