Comments (2)
You would think it would be straight forward, but like many things in computing,
making SCTE-35 Cues is ten times harder than it needs to be, and makes very little sense.
Complex cue messages
https://github.com/futzu/scte35-threefive/blob/master/Encoding.md
Simple Splice Insert
threefive.encode has some new encoding functions that I haven't announced yet,
but I use them a lot in my work.
a@debian:~/build/clean/scte35-threefive$ pypy3
Python 3.8.13 (7.3.9+dfsg-5, Oct 30 2022, 09:55:31)
[PyPy 7.3.9 with GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> from threefive import encode
>>>> help(encode)
Help on module threefive.encode in threefive:
NAME
threefive.encode - encode.py
DESCRIPTION
threefive.encode has helper functions for Cue encoding.
FUNCTIONS
mk_splice_insert(event_id, pts, duration=None)
mk_cue returns a Cue
with a Splice Insert.
splice_event_id = event_id
If duration is NOT set,
out_of_network_indicator False
time_specified_flag False
duration_flag False
splice_immediate_flag True
if duration IS set:
out_of_network_indicator True
time_specified_flag True
duration_flag True
splice_immediate_flag False
break_auto_return True
break_duration duration
pts_time pts
mk_splice_null()
mk_splice_null returns a Cue
with a Splice Null
mk_time_signal(pts=None)
mk_time_signal returns a Cue
with a Time Signal
if pts is NOT set:
time_specified_flag False
if pts IS set:
time_specified_flag True
pts_time pts
FILE
/home/a/build/clean/scte35-threefive/threefive/encode.py
Let's try one real quick.
a@debian:~/cuei$ pypy3
Python 3.8.13 (7.3.9+dfsg-5, Oct 30 2022, 09:55:31)
[PyPy 7.3.9 with GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> from threefive.encode import mk_splice_insert
>>>> evnt_id= 9
>>>> pts = 29053.123456
>>>> duration = 300
>>>> cue =mk_splice_insert(evnt_id,pts,duration)
mk_splice_insert returns an instance of threefive.Cue
which has the following methods
|
| encode(self)
| Cue.encode() converts SCTE35 data
| to a base64 encoded string.
|
| encode_as_hex(self)
| encode_as_hex returns self.bites as
| a hex string
|
| encode_as_int(self)
| encode_as_int returns self.bites as an int.
|
Use threefive.Cue's encoding methods to generate the cue messages
>>>> cue.encode()
'/DAlAAAAAAAAAP/wFAUAAAAJf+/+m9pkt/4Bm/zAAAkAAAAA5ftzmA=='
>>>> cue.encode_as_hex()
'0xfc302500000000000000fff01405000000097feffe9bda64b7fe019bfcc0000900000000e5fb7398'
>>>> cue.encode_as_int()
2104181392760166021170929920497819646350710275162000838308971042240028739408705486837725464851352
from x9k3.
Hi @futzu ,
Thanks for sharing this. It helped me a lot.
from x9k3.
Related Issues (20)
- Do You Like The Current Output of X9K3? Do You Have A Better Idea? HOT 18
- Problematically its not working HOT 10
- How to merge multiple ts input into one output? HOT 3
- Jerks in HLS when coverted from UDP. HOT 40
- error while coverting udp to hls HOT 4
- insert every 10 minutes HOT 4
- When can we expect abr ? HOT 2
- negative EXTINF values and no X_CUE tags from scte35 mpegts stream HOT 8
- SCTE-OUT/IN pairs inside EXT-X-DATERANGE do not have the same ID, as the standard says HOT 4
- Replay mode , not looping the video HOT 6
- New: Option to not to use EXT-X-DISCONTINUITY in SCTE35 marks HOT 12
- New: --replay should not include -c by default HOT 3
- Play on native player breaks in replay mode after restarting the loop HOT 11
- stdin input is not working
- Not inserting cue markers. HOT 23
- paypal account HOT 5
- Can't make sidecar pts and cue to working as expected HOT 10
- How to use in hls? HOT 4
- Transmission dropping HOT 22
- Input with multiple resolutions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x9k3.