diff options
| author | tassaron | 2022-04-13 16:05:55 -0400 |
|---|---|---|
| committer | tassaron | 2022-04-13 16:05:55 -0400 |
| commit | eb656192c49ba97eaebe932195d589cfc9535d84 (patch) | |
| tree | a25998a7cd4b270718fd519cb0963efe97015fc3 | |
| parent | 765a35119f258f352718a556fbea4af708236900 (diff) | |
fix missing audio in output video due to change in ffmpeg command syntax (tested with v4.4.1)
| -rw-r--r-- | src/toolkit/ffmpeg.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/toolkit/ffmpeg.py b/src/toolkit/ffmpeg.py index d78d803..0a536bc 100644 --- a/src/toolkit/ffmpeg.py +++ b/src/toolkit/ffmpeg.py @@ -227,8 +227,8 @@ def createFfmpegCommand(inputFile, outputFile, components, duration=-1): '-pix_fmt', 'rgba', '-r', Core.settings.value('outputFrameRate'), '-t', duration, - '-i', '-', # the video input comes from a pipe '-an', # the video input has no sound + '-i', '-', # the video input comes from a pipe # INPUT SOUND '-t', duration, @@ -241,12 +241,11 @@ def createFfmpegCommand(inputFile, outputFile, components, duration=-1): ] segment = createAudioFilterCommand(extraAudio, safeDuration) ffmpegCommand.extend(segment) - if segment: - # Only map audio from the filters, and video from the pipe - ffmpegCommand.extend([ - '-map', '0:v', - '-map', '[a]', - ]) + # Map audio from the filters or the single audio input, and map video from the pipe + ffmpegCommand.extend([ + '-map', '0:v', + '-map', '[a]' if segment else '1:a', + ]) ffmpegCommand.extend([ # OUTPUT |
