fixing issue #134

This commit is contained in:
k4yt3x 2019-08-11 23:57:10 -04:00
parent e12db41213
commit 969cfe5c0d
2 changed files with 16 additions and 11 deletions

View File

@ -119,6 +119,8 @@ class Ffmpeg:
self.ffmpeg_binary self.ffmpeg_binary
] ]
execute.extend(self._read_configuration(phase='video_to_frames'))
execute.extend([ execute.extend([
'-i', '-i',
input_video input_video
@ -130,8 +132,6 @@ class Ffmpeg:
extracted_frames / f'extracted_%0d.{self.image_format}' extracted_frames / f'extracted_%0d.{self.image_format}'
]) ])
execute.extend(self._read_configuration(phase='video_to_frames'))
self._execute(execute) self._execute(execute)
def convert_video(self, framerate, resolution, upscaled_frames): def convert_video(self, framerate, resolution, upscaled_frames):
@ -152,6 +152,9 @@ class Ffmpeg:
resolution resolution
] ]
# read other options
execute.extend(self._read_configuration(phase='frames_to_video'))
# read FFmpeg input options # read FFmpeg input options
execute.extend(self._read_configuration(phase='frames_to_video', section='input_options')) execute.extend(self._read_configuration(phase='frames_to_video', section='input_options'))
@ -173,9 +176,6 @@ class Ffmpeg:
# read FFmpeg output options # read FFmpeg output options
execute.extend(self._read_configuration(phase='frames_to_video', section='output_options')) execute.extend(self._read_configuration(phase='frames_to_video', section='output_options'))
# read other options
execute.extend(self._read_configuration(phase='frames_to_video'))
# specify output file location # specify output file location
execute.extend([ execute.extend([
upscaled_frames / 'no_audio.mp4' upscaled_frames / 'no_audio.mp4'
@ -192,12 +192,17 @@ class Ffmpeg:
upscaled_frames {string} -- directory containing upscaled frames upscaled_frames {string} -- directory containing upscaled frames
""" """
execute = [ execute = [
self.ffmpeg_binary, self.ffmpeg_binary
]
execute.extend(self._read_configuration(phase='migrating_tracks'))
execute.extend([
'-i', '-i',
upscaled_frames / 'no_audio.mp4', upscaled_frames / 'no_audio.mp4',
'-i', '-i',
input_video input_video
] ])
execute.extend(self._read_configuration(phase='migrating_tracks', section='output_options')) execute.extend(self._read_configuration(phase='migrating_tracks', section='output_options'))
@ -205,8 +210,6 @@ class Ffmpeg:
output_video output_video
]) ])
execute.extend(self._read_configuration(phase='migrating_tracks'))
self._execute(execute) self._execute(execute)
def _read_configuration(self, phase, section=None): def _read_configuration(self, phase, section=None):
@ -277,9 +280,9 @@ class Ffmpeg:
Returns: Returns:
int -- execution return code int -- execution return code
""" """
Avalon.debug_info(f'Executing: {execute}')
# turn all list elements into string to avoid errors # turn all list elements into string to avoid errors
execute = [str(e) for e in execute] execute = [str(e) for e in execute]
Avalon.debug_info(f'Executing: {execute}')
return subprocess.run(execute, shell=True, check=True).returncode return subprocess.run(execute, shell=True, check=True).returncode

View File

@ -73,6 +73,7 @@
"-b:v": null, "-b:v": null,
"-pix_fmt": null "-pix_fmt": null
}, },
"-hwaccel": "auto",
"-y": true "-y": true
}, },
"migrating_tracks": { "migrating_tracks": {
@ -85,6 +86,7 @@
"-c": "copy", "-c": "copy",
"-pix_fmt": null "-pix_fmt": null
}, },
"-hwaccel": "auto",
"-y": true "-y": true
} }
}, },