Updated Bootstrap, added NTFY, updated player, misc.
@ -62,31 +62,50 @@ builtins.json_message = MessageHandler()
|
||||
|
||||
# NOTE: Need threads defined before instantiating
|
||||
|
||||
def _start_rtsp_server():
|
||||
PATH = f"{ROOT_FILE_PTH}/utils/rtsp-server"
|
||||
RAMFS = "/dev/shm/webfm"
|
||||
SYMLINK = f"{PATH}/m3u8_stream_files"
|
||||
def _start_rtsp_and_ntfy_server():
|
||||
PATH = f"{ROOT_FILE_PTH}/utils"
|
||||
RTSP_PATH = f"{PATH}/rtsp-server"
|
||||
NTFY_PATH = f"{PATH}/ntfy"
|
||||
|
||||
if not os.path.exists(PATH) or not os.path.exists(f"{PATH}/rtsp-simple-server"):
|
||||
RAMFS = "/dev/shm/webfm"
|
||||
SYMLINK = app.config['REMUX_FOLDER']
|
||||
|
||||
if not os.path.exists(RTSP_PATH) or not os.path.exists(f"{RTSP_PATH}/rtsp-simple-server"):
|
||||
msg = f"\n\nAlert: Reference --> https://github.com/aler9/rtsp-simple-server/releases" + \
|
||||
f"\nPlease insure {PATH} exists and rtsp-simple-server binary is there.\n\n"
|
||||
f"\nPlease insure {RTSP_PATH} exists and rtsp-simple-server binary is there.\n\n"
|
||||
raise BuiltinsException(msg)
|
||||
|
||||
if not os.path.exists(NTFY_PATH) or not os.path.exists(f"{NTFY_PATH}/ntfy"):
|
||||
msg = f"\n\nAlert: Reference --> https://ntfy.sh/" + \
|
||||
f"\nPlease insure {NTFY_PATH} exists and ntfy binary is there.\n\n"
|
||||
raise BuiltinsException(msg)
|
||||
|
||||
if not os.path.exists(RAMFS):
|
||||
os.mkdir(RAMFS)
|
||||
if not os.path.exists(f"{PATH}/m3u8_stream_files"):
|
||||
|
||||
if not os.path.exists(SYMLINK):
|
||||
os.symlink(RAMFS, SYMLINK)
|
||||
|
||||
@daemon_threaded
|
||||
def _start_rtsp_server_threaded():
|
||||
os.chdir(PATH)
|
||||
os.chdir(RTSP_PATH)
|
||||
command = ["./rtsp-simple-server", "./rtsp-simple-server.yml"]
|
||||
process = subprocess.Popen(command)
|
||||
process.wait()
|
||||
|
||||
@daemon_threaded
|
||||
def _start_ntfy_server_threaded():
|
||||
os.chdir(NTFY_PATH)
|
||||
command = ["./ntfy", "serve", "--behind-proxy", "--listen-http", ":7777"]
|
||||
process = subprocess.Popen(command)
|
||||
process.wait()
|
||||
|
||||
|
||||
_start_ntfy_server_threaded()
|
||||
_start_rtsp_server_threaded()
|
||||
|
||||
_start_rtsp_server()
|
||||
|
||||
_start_rtsp_and_ntfy_server()
|
||||
|
||||
|
||||
|
||||
@ -140,9 +159,10 @@ def _get_stream(video_path=None, stream_target=None):
|
||||
# Yes, the process probably should give us info we can process when failure occures.
|
||||
command = [
|
||||
"ffmpeg", "-nostdin", "-fflags", "+genpts", "-hwaccel", "cuda",
|
||||
# --preset ultrafast --threads 1
|
||||
"-stream_loop", "1", "-i", video_path, "-strict", "experimental",
|
||||
"-vcodec", "copy", "-acodec", "copy", "-f", "rtsp",
|
||||
"-rtsp_transport", "udp", stream_target
|
||||
"-rtsp_transport", "tcp", stream_target
|
||||
]
|
||||
|
||||
# command = [
|
||||
|
@ -43,7 +43,7 @@ class Config(object):
|
||||
|
||||
# We are overiding some of the the shellmen view settings with these to make it all work with flask.
|
||||
# These are passed along to the shellmen view from the Routes file upon the window controller creation.
|
||||
ABS_THUMBS_PTH = f"{STATIC_FPTH}/imgs/thumbnails" # Used for thumbnail generation
|
||||
ABS_THUMBS_PTH = f"{STATIC_FPTH}/imgs/thumbnails" # Used for thumbnail generation
|
||||
REMUX_FOLDER = f"{STATIC_FPTH}/remuxs" # Remuxed files folder
|
||||
FFMPG_THUMBNLR = f"{STATIC_FPTH}/ffmpegthumbnailer" # Thumbnail generator binary
|
||||
|
||||
|
@ -111,7 +111,10 @@ def file_manager_action(_type, _hash = None):
|
||||
_video_path = fpath
|
||||
_stub = f"{_hash}{_sub_uuid}"
|
||||
_rtsp_path = f"rtsp://www.{app_name.lower()}.com:8554/{_stub}"
|
||||
_rtmp_path = f"rtmp://www.{app_name.lower()}.com:1935/{_stub}"
|
||||
_hls_path = f"http://www.{app_name.lower()}.com:8888/{_stub}/"
|
||||
_webrtc_path = f"http://www.{app_name.lower()}.com:8889/{_stub}/"
|
||||
|
||||
_stream_target = _rtsp_path
|
||||
|
||||
stream = get_stream(_video_path, _stream_target)
|
||||
@ -119,7 +122,7 @@ def file_manager_action(_type, _hash = None):
|
||||
msg = "Streaming: Setting up stream failed! Please try again..."
|
||||
return json_message.create("danger", msg)
|
||||
|
||||
_stream_target = _webrtc_path
|
||||
_stream_target = _rtmp_path
|
||||
return {"stream": _stream_target}
|
||||
|
||||
# NOTE: Positionally protecting actions further down that are privlidged
|
||||
|
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 870 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 711 B After Width: | Height: | Size: 711 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 321 B |
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 370 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 379 B |
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 444 B |
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 370 B |
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 446 B |
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 769 B After Width: | Height: | Size: 769 B |
Before Width: | Height: | Size: 977 B After Width: | Height: | Size: 977 B |
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 323 B After Width: | Height: | Size: 323 B |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 446 B |
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 391 B After Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 484 B After Width: | Height: | Size: 484 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 428 B |
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 649 B |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 794 B |
Before Width: | Height: | Size: 860 B After Width: | Height: | Size: 860 B |
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 515 B |