Converter: fix output names of merged files, now its 100% same as input,

ConvertAvatar: fix input image after fix landmarks face align,
VideoEd: video_from_sequence now uses pipe input to input any filenames instead of %.5d. formatted
This commit is contained in:
Colombo 2019-08-27 22:05:22 +04:00
parent 23854ac8bc
commit 9f58d160a0
4 changed files with 21 additions and 15 deletions

View file

@ -167,8 +167,10 @@ def video_from_sequence( input_dir, output_file, reference_file=None, ext=None,
if not lossless and bitrate is None:
bitrate = max (1, io.input_int ("Bitrate of output file in MB/s ? (default:16) : ", 16) )
i_in = ffmpeg.input(str (input_path / ('%5d.'+ext)), r=fps)
input_image_paths = Path_utils.get_image_paths(input_path)
i_in = ffmpeg.input('pipe:', format='image2pipe', r=fps)
output_args = [i_in]
if ref_in_a is not None:
@ -193,7 +195,16 @@ def video_from_sequence( input_dir, output_file, reference_file=None, ext=None,
})
job = ( ffmpeg.output(*output_args, **output_kwargs).overwrite_output() )
try:
job = job.run()
try:
job_run = job.run_async(pipe_stdin=True)
for image_path in input_image_paths:
with open (image_path, "rb") as f:
image_bytes = f.read()
job_run.stdin.write (image_bytes)
job_run.stdin.close()
job_run.wait()
except:
io.log_err ("ffmpeg fail, job commandline:" + str(job.compile()) )