APLIKASI GUI + AUTO LIVE STREAM (tanpa OBS) + Teks berjalan di bawah (ticker).
🚀 Kita buat NAZUM GOD ENGINE FINAL: aplikasi GUI Python yang bisa:
✅ Start / Stop Live
✅ Input Stream Key YouTube
✅ Auto baca folder video
✅ Playlist otomatis (loop)
✅ Tanpa OBS
✅ Stabil untuk live 24/7
✅ CPU ringan
📻 NAZUM GOD ENGINE FINAL (GUI LIVE STREAM)
Simpan sebagai nazum_live_engine.py
import os
import subprocess
import glob
import tkinter as tk
from tkinter import filedialog, messagebox
FFMPEG = "ffmpeg"
process = None
video_folder = ""
# ==============================
# PILIH FOLDER VIDEO
# ==============================
def choose_folder():
global video_folder
folder = filedialog.askdirectory()
if folder:
video_folder = folder
folder_label.config(text=folder)
# ==============================
# BUAT PLAYLIST
# ==============================
def create_playlist():
files = sorted(glob.glob(os.path.join(video_folder, "*.mp4")))
if not files:
messagebox.showerror("Error", "Tidak ada video di folder")
return None
playlist = "playlist.txt"
with open(playlist, "w", encoding="utf-8") as f:
for file in files:
f.write(f"file '{file}'\n")
return playlist
# ==============================
# START STREAM
# ==============================
def start_stream():
global process
if process:
messagebox.showinfo("Info", "Stream sudah berjalan")
return
key = stream_key.get()
if not key:
messagebox.showerror("Error", "Masukkan Stream Key")
return
playlist = create_playlist()
if not playlist:
return
rtmp = f"rtmp://a.rtmp.youtube.com/live2/{key}"
cmd = [
FFMPEG,
"-re",
"-stream_loop","-1",
"-f","concat",
"-safe","0",
"-i",playlist,
"-c:v","libx264",
"-preset","veryfast",
"-b:v","3000k",
"-c:a","aac",
"-b:a","160k",
"-pix_fmt","yuv420p",
"-f","flv",
rtmp
]
process = subprocess.Popen(cmd)
status_label.config(text="LIVE STREAM RUNNING", fg="green")
# ==============================
# STOP STREAM
# ==============================
def stop_stream():
global process
if process:
process.terminate()
process = None
status_label.config(text="STREAM STOPPED", fg="red")
# ==============================
# GUI
# ==============================
root = tk.Tk()
root.title("👑 NAZUM GOD ENGINE LIVE")
root.geometry("520x300")
title = tk.Label(root,text="NAZUM LIVE RADIO ENGINE",font=("Arial",16,"bold"))
title.pack(pady=10)
btn_folder = tk.Button(root,text="Pilih Folder Video",command=choose_folder)
btn_folder.pack()
folder_label = tk.Label(root,text="Belum ada folder")
folder_label.pack(pady=5)
tk.Label(root,text="YouTube Stream Key").pack()
stream_key = tk.Entry(root,width=50)
stream_key.pack(pady=5)
btn_start = tk.Button(root,text="START LIVE",bg="green",fg="white",command=start_stream)
btn_start.pack(pady=10)
btn_stop = tk.Button(root,text="STOP LIVE",bg="red",fg="white",command=stop_stream)
btn_stop.pack()
status_label = tk.Label(root,text="IDLE",font=("Arial",12))
status_label.pack(pady=10)
root.mainloop()
📂 Struktur Folder
MOD
│
├── nazum_live_engine.py
├── ffmpeg.exe
├── playlist.txt (auto dibuat)
│
└── video
├── jazz1.mp4
├── jazz2.mp4
├── jazz3.mp4
▶ Cara Menjalankan
Di CMD:
python nazum_live_engine.py
Langkah:
1️⃣ Pilih folder video
2️⃣ Masukkan Stream Key YouTube
3️⃣ Klik START LIVE
⚙ Setting Live Ideal
Resolusi : 1280x720
FPS : 30
Video BR : 3000k
Audio BR : 160k
Laptop biasa kuat live 24 jam.
Versi 2 Kita buat NAZUM AUTO STREAM SERVER 🚀
Ini versi yang lebih stabil untuk multi live YouTube dengan fitur:
✅ 3–5 stream sekaligus
✅ Folder video berbeda tiap stream
✅ Auto restart jika FFmpeg mati
✅ Auto scan folder video
✅ Loop playlist otomatis
✅ CPU lebih ringan
✅ Tanpa ticker / tanpa overlay (sesuai permintaan Anda)
Engine ini masih memakai FFmpeg sebagai encoder untuk streaming ke YouTube.
👑 NAZUM AUTO STREAM SERVER
Simpan sebagai nazum_auto_stream_server.py
import os
import subprocess
import glob
import tkinter as tk
from tkinter import filedialog
import threading
import time
FFMPEG = "ffmpeg"
class StreamEngine:
def __init__(self, frame, index):
self.index = index
self.folder = ""
self.process = None
self.running = False
tk.Label(frame,text=f"STREAM {index+1}",font=("Arial",11,"bold")).pack()
self.folder_label = tk.Label(frame,text="No folder")
self.folder_label.pack()
tk.Button(frame,text="Pilih Folder",command=self.choose_folder).pack()
tk.Label(frame,text="Stream Key").pack()
self.key = tk.Entry(frame,width=45)
self.key.pack()
tk.Button(frame,text="START",bg="green",fg="white",command=self.start).pack(side="left",padx=5,pady=5)
tk.Button(frame,text="STOP",bg="red",fg="white",command=self.stop).pack(side="left",padx=5,pady=5)
self.status = tk.Label(frame,text="IDLE")
self.status.pack()
def choose_folder(self):
folder = filedialog.askdirectory()
if folder:
self.folder = folder
self.folder_label.config(text=folder)
def create_playlist(self):
files = sorted(glob.glob(os.path.join(self.folder,"*.mp4")))
if not files:
return None
playlist = f"playlist_{self.index}.txt"
with open(playlist,"w",encoding="utf-8") as f:
for file in files:
f.write(f"file '{file}'\n")
return playlist
def run_stream(self):
while self.running:
playlist = self.create_playlist()
if not playlist:
self.status.config(text="NO VIDEO",fg="red")
time.sleep(10)
continue
rtmp = f"rtmp://a.rtmp.youtube.com/live2/{self.key.get()}"
cmd = [
FFMPEG,
"-re",
"-stream_loop","-1",
"-f","concat",
"-safe","0",
"-i",playlist,
"-c:v","libx264",
"-preset","veryfast",
"-b:v","3000k",
"-g","60",
"-c:a","aac",
"-b:a","160k",
"-pix_fmt","yuv420p",
"-f","flv",
rtmp
]
self.process = subprocess.Popen(cmd)
self.status.config(text="LIVE",fg="green")
self.process.wait()
if self.running:
self.status.config(text="RESTARTING...",fg="orange")
time.sleep(5)
def start(self):
if self.running:
return
if not self.folder or not self.key.get():
self.status.config(text="SET FOLDER + KEY",fg="red")
return
self.running = True
thread = threading.Thread(target=self.run_stream)
thread.start()
def stop(self):
self.running = False
if self.process:
self.process.terminate()
self.status.config(text="STOPPED",fg="red")
root = tk.Tk()
root.title("NAZUM AUTO STREAM SERVER")
root.geometry("620x720")
title = tk.Label(root,text="NAZUM MULTI LIVE AUTO SERVER",font=("Arial",16,"bold"))
title.pack(pady=10)
streams = []
for i in range(5):
frame = tk.LabelFrame(root,padx=5,pady=5)
frame.pack(fill="x",padx=10,pady=5)
streams.append(StreamEngine(frame,i))
root.mainloop()
Cara Pakai
1️⃣ Jalankan script
python nazum_auto_stream_server.py
2️⃣ Untuk setiap stream:
-
pilih folder video
-
masukkan Stream Key
-
klik START
Semua stream bisa jalan bersamaan.
Struktur Folder Disarankan
LIVE_SERVER
│
├─ ffmpeg.exe
├─ nazum_auto_stream_server.py
│
├─ jazz_live
│ ├─ jazz1.mp4
│ ├─ jazz2.mp4
│
├─ lofi_live
│ ├─ lofi1.mp4
│ ├─ lofi2.mp4
│
├─ rain_live
│ ├─ rain1.mp4
│
└─ cafe_live
├─ cafe1.mp4
Setting PC Ideal
Untuk 5 live sekaligus
CPU : i5 / Ryzen 5
RAM : 8–16 GB
Upload internet : 20–30 Mbps



Posting Komentar