-
I want to perform an action whenever a cue is detected from a UDP stream. I wrote the following code.... import sys if name == "main": python3 NodeSCTE35.py udp://:1234 When I run the code..... {It then exits when an actual cue happens} When I run the code without the func=print("cue") I would like to perform an action every time I get a SCTE message within the UDP stream. Any help would be appreciated. -Paul |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry I figured it out here is code that does what I was asking for.... If anyone cares :) import json def add_cue(cue): if name == "main": python3 NodeSCTE35.py udp://:1234 |
Beta Was this translation helpful? Give feedback.
Sorry I figured it out here is code that does what I was asking for.... If anyone cares :)
import json
import sys
import threefive
def add_cue(cue):
print(cue.get())
if name == "main":
if len(sys.argv) > 1:
for arg in sys.argv[1:]:
strm = threefive.Stream(arg)
strm.decode(func=add_cue)
else:
threefive.decode(sys.stdin.buffer)
python3 NodeSCTE35.py udp://:1234