mirror of
https://github.com/ApfelTeeSaft/restream_playout.git
synced 2026-08-26 19:33:32 +00:00
32 lines
644 B
Python
32 lines
644 B
Python
from __future__ import annotations
|
|
|
|
import logging
|
|
import threading
|
|
import time
|
|
|
|
from restream_playout import PlayoutEngine
|
|
|
|
|
|
def insert_later(engine: PlayoutEngine) -> None:
|
|
time.sleep(30)
|
|
engine.enqueue("new_clip.mp4")
|
|
|
|
|
|
def main() -> None:
|
|
logging.basicConfig(level=logging.INFO)
|
|
engine = PlayoutEngine("rtmp://live.restream.io/live/STREAM_KEY")
|
|
engine.start()
|
|
|
|
insertion = threading.Thread(target=insert_later, args=(engine,))
|
|
insertion.start()
|
|
try:
|
|
insertion.join()
|
|
input("New clip queued. Press Enter to stop.\n")
|
|
finally:
|
|
engine.stop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|