Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inference_realesrgan_video.py error #491

Open
Ashore-lz opened this issue Oct 31, 2022 · 6 comments
Open

inference_realesrgan_video.py error #491

Ashore-lz opened this issue Oct 31, 2022 · 6 comments

Comments

@Ashore-lz
Copy link

I get an error when I reason about the video
command:python inference_realesrgan_video.py -n realesr-animevideov3 -i inputs/video/onepiece_demo.mp4 -s 2 --suffix outx2
error:[concat @ 0x12eeb00] Impossible to open 'results/onepiece_demo_out_tmp_videos/000.mp4'
results/onepiece_demo_vidlist.txt: No such file or directory

@bfloat16
Copy link

bfloat16 commented Dec 29, 2022

1.Try to download FFmpeg from https://www.gyan.dev/ffmpeg/builds/ ,and configure environment variables
2.run pip install ffmpeg-python
Hope it helps you :)

@PrateekPal641
Copy link

I get an error when I reason about the video command:python inference_realesrgan_video.py -n realesr-animevideov3 -i inputs/video/onepiece_demo.mp4 -s 2 --suffix outx2 error:[concat @ 0x12eeb00] Impossible to open 'results/onepiece_demo_out_tmp_videos/000.mp4' results/onepiece_demo_vidlist.txt: No such file or directory

hi could you solve this?

@Enelar
Copy link

Enelar commented Jan 26, 2023

python inference_realesrgan_video.py -i inputs/ -n RealESRGAN_x4plus

ffmpeg -f concat -safe 0 -i results/inputs_vidlist.txt -c copy results/inputs_out.mp4
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
  configuration: --prefix=/opt/conda/conda-bld/ffmpeg_1597178665428/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh --cc=/opt/conda/conda-bld/ffmpeg_1597178665428/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lame
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
[concat @ 0x556baa161c00] Impossible to open 'results/inputs_out_tmp_videos/000.mp4'
results/inputs_vidlist.txt: No such file or directory

@tejaswivg
Copy link

tejaswivg commented Jan 29, 2023

Check whether you have torch with gpu support.
torch.cuda.is_available()
should return True.
I have a PR which fixes these issues, but using cpu only pytorch is very slow.

@therealscienta
Copy link

therealscienta commented Feb 1, 2023

I'm having the same issue on Debian 11 with a nVidia 1660:

[concat @ 0x55fb14d692c0] Impossible to open 'results/onepiece_demo_out_tmp_videos/000.mp4' results/onepiece_demo_vidlist.txt: No such file or directory

ffmpeg version 4.3.5-0+deb11u1
Python 3.9.2
Modules:
ffmpeg==1.4
ffmpeg-python==0.2.0

torch.cuda.is_available() returns True

UPDATE:

Ok, so I changed my command from
python inference_realesrgan_video.py -i inputs/video/onepiece_demo.mp4 -n weights/realesr-animevideov3 -s 2 --suffix outx2 --num_process_per_gpu 2
to just
python inference_realesrgan_video.py -i inputs/video/onepiece_demo.mp4 -n realesr-animevideov3 -s 2 --suffix outx2 --num_process_per_gpu 2
and it seems to run ??

UPDATE 2:
Ok, it runs, but get stuck after this message:
av_interleaved_write_frame(): Broken pipe Error writing trailer of pipe:: Broken pipe would it be related?

UPDATE 3:

The Broken Pipe error seems to have happened because the VM ran out of memory. Increasing the memory or decreasing --num_process_per_gpu solved this problem.

UPDATE 4:

More testing suggest that slow storage and higher --num_process_per_gpu may cause the problem of No such file or directory. Also, a trailing / in file path will result in incorrect path sent to ffmpeg. Possible solution might be:

if args.output.endswith('/'): args.output = args.output[:-1]

@kirilledition
Copy link

kirilledition commented Apr 4, 2023

Hello,

I recently encountered a similar issue, and I was able to resolve it by converting the mkv file to an mp4 file. Though it doesn't seem like this would directly fix your problem with the example video, it does suggest that the issue might be related to the libraries that ffmpeg was compiled with.

Here's the ffmpeg command I used to convert the mkv file to mp4:
ffmpeg -i input.mkv output.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants