diff --git a/screenstreamer/gui.py b/screenstreamer/gui.py index 3b33c26..13064e8 100644 --- a/screenstreamer/gui.py +++ b/screenstreamer/gui.py @@ -83,6 +83,7 @@ class ScreenStreamerGUI(QtWidgets.QMainWindow): self.streamer = Streamer( self.format_display(displaydata), self.format_screensize(displaydata), + self.ui.videoCodec.currentText(), self.ui.audioSource.currentData(), self.ui.protocolSelect.currentText().lower(), "{}:{}".format(self.ui.sendto.text(), self.ui.streamPort.value()) diff --git a/screenstreamer/streamer.py b/screenstreamer/streamer.py index 3bfca23..133b000 100644 --- a/screenstreamer/streamer.py +++ b/screenstreamer/streamer.py @@ -3,9 +3,10 @@ from procmanager import ProcManager class Streamer: - def __init__(self, screendef: str, screensize: str, audioindex: int, protocol: str, target: str) -> None: + def __init__(self, screendef: str, screensize: str, videocodec: str, audioindex: int, protocol: str, target: str) -> None: self.screendef = screendef self.screensize = screensize + self.videocodec = videocodec self.audioindex = audioindex self.protocol = protocol # should be 'tcp' or 'udp' self.target = target @@ -23,7 +24,7 @@ class Streamer: self.audio = ffmpeg.input(str(self.audioindex), f='pulse') streams.append(self.audio) - self.output = ffmpeg.output(*streams, self.protocol + '://' + self.target, f='mpegts', vcodec='nvenc_hevc', tune='zerolatency') + self.output = ffmpeg.output(*streams, self.protocol + '://' + self.target, f='mpegts', vcodec=self.videocodec, tune='zerolatency') proc = ffmpeg.run_async(self.output, pipe_stderr=True) self.process_manager.start(proc) diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index d0c06ca..5cf8f77 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -20,7 +20,7 @@ 0 0 571 - 247 + 280 @@ -64,45 +64,45 @@ - + Reciever - + 127.0.0.1 - + Stream - + Audio Source - + - + Port - + QAbstractSpinBox::PlusMinus @@ -118,6 +118,65 @@ + + + + Video Codec + + + + + + + hevc_nvenc + + + + h264_nvenc + + + + + libx264 + + + + + h264_vaapi + + + + + hevc_nvenc + + + + + libx265 + + + + + hevc_vaapi + + + + + vp8_vaapi + + + + + vp9_vaapi + + + + + libvpx-vp9 + + + +