diff options
| author | tassaron | 2017-07-20 22:37:15 -0400 |
|---|---|---|
| committer | tassaron | 2017-07-20 22:37:15 -0400 |
| commit | 450b944b87487aa60a935bbeee3908e2a62cd45b (patch) | |
| tree | 0da01dffcd55ecee29692a3ebb42ceb270294221 /src/toolkit/ffmpeg.py | |
| parent | f454814867443ceeeca2a3a2c2a676947184503c (diff) | |
add component in context menu, del/ins hotkeys
+ preset manager uses mainwindow component list
Diffstat (limited to 'src/toolkit/ffmpeg.py')
| -rw-r--r-- | src/toolkit/ffmpeg.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/toolkit/ffmpeg.py b/src/toolkit/ffmpeg.py index 89d4e9d..cc59a6c 100644 --- a/src/toolkit/ffmpeg.py +++ b/src/toolkit/ffmpeg.py @@ -113,7 +113,7 @@ def createFfmpegCommand(inputFile, outputFile, components, duration=-1): '-t', safeDuration, # Tell ffmpeg about shorter clips (seemingly not needed) # streamDuration = getAudioDuration(extraInputFile) - # if streamDuration > float(safeDuration) + # if streamDuration and streamDuration > float(safeDuration) # else "{0:.3f}".format(streamDuration), '-i', extraInputFile ]) @@ -228,11 +228,18 @@ def getAudioDuration(filename): d = d.split(' ')[3] d = d.split(':') duration = float(d[0])*3600 + float(d[1])*60 + float(d[2]) + break + else: + # String not found in output + return False return duration def readAudioFile(filename, parent): duration = getAudioDuration(filename) + if not duration: + print('Audio file doesn\'t exist or unreadable.') + return command = [ Core.FFMPEG_BIN, |
