video codec selector
This commit is contained in:
parent
2399277971
commit
18f9e1554a
|
@ -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())
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>571</width>
|
||||
<height>247</height>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
|
@ -64,45 +64,45 @@
|
|||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="displaySelect"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="RecieverLabel">
|
||||
<property name="text">
|
||||
<string>Reciever</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="sendto">
|
||||
<property name="placeholderText">
|
||||
<string>127.0.0.1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="streamBtn">
|
||||
<property name="text">
|
||||
<string>Stream</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="audioSourceLabel">
|
||||
<property name="text">
|
||||
<string>Audio Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="audioSource"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="streamPortLabel">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="streamPort">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
||||
|
@ -118,6 +118,65 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Video Codec</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="videoCodec">
|
||||
<property name="currentText">
|
||||
<string>hevc_nvenc</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>h264_nvenc</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>libx264</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>h264_vaapi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>hevc_nvenc</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>libx265</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>hevc_vaapi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>vp8_vaapi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>vp9_vaapi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>libvpx-vp9</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in New Issue