2.0.4 quoting paths in pre-execution phase instead of config

This commit is contained in:
K4YT3X 2018-10-23 13:10:38 -04:00
parent 05e2e109c3
commit f10e17d257
2 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ Last Modified: October 22, 2018
Description: This class handles all FFMPEG related
operations.
Version 2.0.3
Version 2.0.4
"""
import subprocess
@ -36,7 +36,7 @@ class Ffmpeg:
videoin {string} -- input video path
outpath {string} -- video output folder
"""
execute = "{} -i \"{}\" {}\\extracted_%0d.png -y".format(self.ffmpeg_path, videoin, outpath)
execute = "\"{}\" -i \"{}\" {}\\extracted_%0d.png -y".format(self.ffmpeg_path, videoin, outpath)
print(execute)
subprocess.call(execute)
@ -50,7 +50,7 @@ class Ffmpeg:
videoin {string} -- input video path
outpath {string} -- video output folder
"""
execute = "{} -i \"{}\" -vn -acodec copy {}\\output-audio.aac -y".format(self.ffmpeg_path, videoin, outpath)
execute = "\"{}\" -i \"{}\" -vn -acodec copy {}\\output-audio.aac -y".format(self.ffmpeg_path, videoin, outpath)
print(execute)
subprocess.call(execute)
@ -65,7 +65,7 @@ class Ffmpeg:
resolution {string} -- target video resolution
upscaled {string} -- source images folder
"""
execute = "{} -r {} -f image2 -s {} -i {}\\extracted_%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p {}\\no_audio.mp4 -y".format(
execute = "\"{}\" -r {} -f image2 -s {} -i {}\\extracted_%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p {}\\no_audio.mp4 -y".format(
self.ffmpeg_path, framerate, resolution, upscaled, upscaled)
print(execute)
subprocess.call(execute)
@ -79,6 +79,6 @@ class Ffmpeg:
Arguments:
upscaled {string} -- upscaled image folder
"""
execute = "{} -i {}\\no_audio.mp4 -i {}\\output-audio.aac -shortest -codec copy {} -y".format(self.ffmpeg_path, upscaled, upscaled, self.outfile)
execute = "\"{}\" -i {}\\no_audio.mp4 -i {}\\output-audio.aac -shortest -codec copy {} -y".format(self.ffmpeg_path, upscaled, upscaled, self.outfile)
print(execute)
subprocess.call(execute)

View File

@ -9,7 +9,7 @@ Last Modified: October 22, 2018
Description: This class controls waifu2x
engine
Version 2.0.3
Version 2.0.4
"""
from avalon_framework import Avalon
import subprocess
@ -47,7 +47,7 @@ class Waifu2x:
self.print_lock.release()
# Create string for execution
execute = '{} -p {} -I png -i {} -e png -o {} -w {} -h {} -n 3 -m noise_scale -y {}'.format(
execute = '\"{}\" -p {} -I png -i \"{}\" -e png -o {} -w {} -h {} -n 3 -m noise_scale -y {}'.format(
self.waifu2x_path, self.method, folderin, folderout, width, height, self.model_type)
subprocess.call(execute)