CodeFormer
CodeFormer copied to clipboard
How to redo the Video Saving part
So I've done processing a clip and got all png file in result, next step I believe is to convert them to MP4, I met some problem below so I reinstall them. My qestion, can I just do the Video Saving part without redo everything all over again? Given all frames has been processed.
[5209/5209] Processing: XXXX_XXXX detect 0 faces Video Saving... [mp4 @ 0x7fa87d80d800] Could not find tag for codec pcm_s16le in stream #1, codec not currently supported in container Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 --
this websited can you under best forfaston are can are good are you not a king but
_
don't understand what you mean. Basically I'd like to know if there is a "resume" feature on video processing cause usually my process broke at last stage, where it tried to combined all PNG back to mp4
I also faced the same problem, I have solved it by: In”CodeFormer/basicsr/utils/video_util.py“, there is a piece of code:
``` self.stream_writer = (
ffmpeg.input('pipe:', format='rawvideo', pix_fmt='bgr24', s=f'{width}x{height}',
framerate=fps).output(
audio,
video_save_path,
pix_fmt='yuv420p',
vcodec='libx264',
loglevel='error',
acodec='copy').overwrite_output().run_async(
pipe_stdin=True, pipe_stdout=True, cmd='ffmpeg'))
I modified it like this:
```self.stream_writer = (
ffmpeg.input('pipe:', format='rawvideo', pix_fmt='bgr24', s=f'{width}x{height}',
framerate=fps).output(
audio,
video_save_path,
pix_fmt='yuv420p',
vcodec='libx264',
loglevel='error',
acodec='aac').overwrite_output().run_async(
pipe_stdin=True, pipe_stdout=True, cmd='ffmpeg'))
Then the above error did not appear again. I am a person who does not understand programming languages, and I also hope that someone who understands code can explain the reason.
self.stream_writer = ( ffmpeg.input('pipe:', format='rawvideo', pix_fmt='bgr24', s=f'{width}x{height}', framerate=fps).output( audio, video_save_path, pix_fmt='yuv420p', vcodec='libx264', loglevel='error', acodec='aac').overwrite_output().run_async( pipe_stdin=True, pipe_stdout=True, cmd='ffmpeg'))
Traceback (most recent call last):
File "Z:\Program Files\PyCharm 2023.2.2\kyPROJECT\CodeFormer-master\inference_codeformer.py", line 116, in