Skip to content

Commit 0864429

Browse files
author
SuslikV
authored
Attempt to set option only for existing stream
This resolves the bug when single audio stream cannot be exported to the file due to fact that the output has no video stream.
1 parent cf9721a commit 0864429

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/windows/export.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -835,12 +835,15 @@ def accept(self):
835835
# These extra options should be set in an extra method
836836
# No feedback is given to the user
837837
# TODO: Tell user if option is not available
838-
# Set the quality in case crf was selected
839-
if "crf" in self.txtVideoBitRate.text():
840-
w.SetOption(openshot.VIDEO_STREAM, "crf", str(int(video_settings.get("video_bitrate"))) )
841-
842-
# Muxing options for mp4/mov
843-
w.SetOption(openshot.VIDEO_STREAM, "muxing_preset", "mp4_faststart")
838+
if export_type in [_("Audio Only")]:
839+
# Muxing options for mp4/mov
840+
w.SetOption(openshot.AUDIO_STREAM, "muxing_preset", "mp4_faststart")
841+
else:
842+
# Muxing options for mp4/mov
843+
w.SetOption(openshot.VIDEO_STREAM, "muxing_preset", "mp4_faststart")
844+
# Set the quality in case crf was selected
845+
if "crf" in self.txtVideoBitRate.text():
846+
w.SetOption(openshot.VIDEO_STREAM, "crf", str(int(video_settings.get("video_bitrate"))) )
844847

845848
# Open the writer
846849
w.Open()

0 commit comments

Comments
 (0)