Real-ESRGAN icon indicating copy to clipboard operation
Real-ESRGAN copied to clipboard

inference_realesrgan_video.py error

Open Ashore-lz opened this issue 1 year ago • 6 comments

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

Ashore-lz avatar Oct 31 '22 09:10 Ashore-lz

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 :)

bfloat16 avatar Dec 29 '22 18:12 bfloat16

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?

PrateekPal641 avatar Jan 14 '23 13:01 PrateekPal641

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

Enelar avatar Jan 26 '23 18:01 Enelar

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.

tejaswivg avatar Jan 29 '23 11:01 tejaswivg

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]

therealscienta avatar Feb 01 '23 21:02 therealscienta

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

kirilledition avatar Apr 04 '23 15:04 kirilledition