try this
This commit is contained in:
parent
d8d7343f86
commit
9e4369a3b3
|
@ -16,7 +16,7 @@ class Streamer:
|
||||||
|
|
||||||
# ffmpeg command
|
# ffmpeg command
|
||||||
|
|
||||||
# ffmpeg --stream_loop -1 -re -i ~/INPUT_FILE -vcodec libx264 -profile:v main -preset:v medium -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -b:v 2500k -maxrate 2500k -bufsize 2500k -sws_flags lanczos+accurate_rnd -acodec aac -b:a 96k -ar 48000 -ac 2 -f flv rtmp://rtmp.robotstreamer.com/live/123?key=123
|
# ffmpeg --stream_loop -1 -re -i ~/INPUT_FILE -vcodec libx264 -profile:v main -preset:v medium -r 20 -g 60 -keyint_min 60 -sc_threshold 0 -b:v 2500k -maxrate 2500k -bufsize 2500k -sws_flags lanczos+accurate_rnd -acodec aac -b:a 96k -ar 48000 -ac 2 -f flv rtmp://rtmp.robotstreamer.com/live/123?key=123"
|
||||||
cmd_out = [
|
cmd_out = [
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
"-f",
|
"-f",
|
||||||
|
@ -28,10 +28,40 @@ class Streamer:
|
||||||
"-i",
|
"-i",
|
||||||
"-", # Indicated input comes from pipe
|
"-", # Indicated input comes from pipe
|
||||||
"-vcodec",
|
"-vcodec",
|
||||||
"png",
|
"libx264",
|
||||||
"-qscale",
|
"-profile:v",
|
||||||
|
"main",
|
||||||
|
"-pix_fmt",
|
||||||
|
"yuv420p",
|
||||||
|
"-preset:v",
|
||||||
|
"medium",
|
||||||
|
"-r",
|
||||||
|
"30",
|
||||||
|
"-g",
|
||||||
|
"60",
|
||||||
|
"-keyint_min",
|
||||||
|
"60",
|
||||||
|
"-sc_threshold",
|
||||||
"0",
|
"0",
|
||||||
"/tmp/robotstreamer.mp4",
|
"-b:v",
|
||||||
|
"2500k",
|
||||||
|
"-maxrate",
|
||||||
|
"2500k",
|
||||||
|
"-bufsize",
|
||||||
|
"2500k",
|
||||||
|
"-sws_flags",
|
||||||
|
"lanczos+accurate_rnd",
|
||||||
|
"-acodec",
|
||||||
|
"aac",
|
||||||
|
"-b:a",
|
||||||
|
"96k",
|
||||||
|
"-ar",
|
||||||
|
"48000",
|
||||||
|
"-ac",
|
||||||
|
"2",
|
||||||
|
"-f",
|
||||||
|
"flv",
|
||||||
|
"rtmp://rtmp.robotstreamer.com/live/topcec",
|
||||||
]
|
]
|
||||||
|
|
||||||
# This is the ffmpeg pipe streamer!
|
# This is the ffmpeg pipe streamer!
|
||||||
|
@ -45,6 +75,8 @@ class Streamer:
|
||||||
raw = self.root.get_image(0, 0, self.x1, self.y1, X.ZPixmap, 0xFFFFFFFF)
|
raw = self.root.get_image(0, 0, self.x1, self.y1, X.ZPixmap, 0xFFFFFFFF)
|
||||||
image = Image.frombytes("RGB", (self.x1, self.y1), raw.data, "raw", "BGRX")
|
image = Image.frombytes("RGB", (self.x1, self.y1), raw.data, "raw", "BGRX")
|
||||||
|
|
||||||
|
image = image.crop((0, 200, self.x1, self.y1))
|
||||||
|
|
||||||
return image
|
return image
|
||||||
|
|
||||||
def stream(self):
|
def stream(self):
|
||||||
|
@ -65,4 +97,5 @@ class Streamer:
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
myStreamer = Streamer()
|
myStreamer = Streamer()
|
||||||
|
|
||||||
|
# myStreamer.getFrame().show()
|
||||||
myStreamer.stream()
|
myStreamer.stream()
|
||||||
|
|
Loading…
Reference in New Issue