k4yt3x / video2x

A lossless video/GIF/image upscaler achieved with waifu2x, Anime4K, SRMD and RealSR. Started in Hack the Valley II, 2018.
https://video2x.org
GNU Affero General Public License v3.0
9.89k stars 960 forks source link

No such file or directory #35

Closed deonix37 closed 5 years ago

deonix37 commented 5 years ago

Windows 10, Python 3.7.0 Catching several exceptions during upscaling (webm):

[image2 @ 000002b53ac8ad00] Could find no file with path 'C:\Users\deonix\AppData\Local\Temp\tmpou7zsjpm\extracted_%d.png' and index in the range 0-4
C:\Users\deonix\AppData\Local\Temp\tmpou7zsjpm\extracted_%d.png: No such file or directory
Output #0, adts, to 'C:\Users\deonix\AppData\Local\Temp\tmpq9r1jr4z\output-audio.aac':
Output file #0 does not contain any stream
C:\Users\deonix\AppData\Local\Temp\tmpq9r1jr4z\no_audio.mp4: No such file or directory
k4yt3x commented 5 years ago

@deonix37 I can't seem to locate the problem just by looking at the few lines of errors that you have provided. Could you please submit the full output?

deonix37 commented 5 years ago
C:\video2x-master\bin>python video2x.py -i it.webm -o it2.webm -m gpu -f 2
__      __  _       _                  ___   __   __
\ \    / / (_)     | |                |__ \  \ \ / /
 \ \  / /   _    __| |   ___    ___      ) |  \ V /
  \ \/ /   | |  / _` |  / _ \  / _ \    / /    > <
   \  /    | | | (_| | |  __/ | (_) |  / /_   / . \
    \/     |_|  \__,_|  \___|  \___/  |____| /_/ \_\

               Video2X Video Enlarger

                   Version 2.2.0

[!] WARNING: Each waifu2x-caffe thread will require up to 2.5 GB during initialization
[!] WARNING: You demanded 5 threads to be created, but you only have 2.6334 GB memory available
[!] WARNING: 12.5 GB of memory is recommended for 5 threads
[!] WARNING: With your current amount of memory available, 1 threads is recommended
[?] USER: Change to the recommended value? [Y/n]: y
[+] INFO: Upscaling single video file: it.webm
"C:\Users\deonix\AppData\Local\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -i "C:\video2x-master\bin\it.webm" C:\Users\deonix\AppData\Local\Temp\tmpz14cl427\extracted_%0d.png -y
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, matroska,webm, from 'C:\video2x-master\bin\it.webm':
  Metadata:
    encoder         : libebml v1.3.4 + libmatroska v1.4.5
    creation_time   : 2018-08-28T16:52:36.000000Z
  Duration: 00:00:05.10, start: 0.000000, bitrate: 6443 kb/s
    Stream #0:0: Video: vp8, yuv420p(progressive), 900x500, SAR 1:1 DAR 9:5, 29.41 fps, 29.41 tbr, 1k tbn, 1k tbc (default)
Stream mapping:
  Stream #0:0 -> #0:0 (vp8 (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'C:\Users\deonix\AppData\Local\Temp\tmpz14cl427\extracted_%0d.png':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: png, rgb24, 900x500 [SAR 1:1 DAR 9:5], q=2-31, 200 kb/s, 29.41 fps, 29.41 tbn, 29.41 tbc (default)
    Metadata:
      encoder         : Lavc58.35.100 png
frame=  151 fps= 30 q=-0.0 Lsize=N/A time=00:00:05.13 bitrate=N/A speed=1.01x
video:60990kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[+] INFO: Reading video information
[+] INFO: Framerate: 29.41176470588235
[+] INFO: Starting to upscale extracted images
2019-01-26 18:29:50.226367 [+] INFO: [upscaler] Thread 0 started
変換に失敗したファイルがあります
2019-01-26 18:29:50.494612 [+] INFO: [upscaler] Thread 0 exiting
[+] INFO: Upscaling completed
[+] INFO: Converting extracted frames into video
"C:\Users\deonix\AppData\Local\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -r 29.41176470588235 -f image2 -s 1800x1000 -i C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\extracted_%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\no_audio.mp4 -y
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[image2 @ 000001e7a78fad00] Could find no file with path 'C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\extracted_%d.png' and index in the range 0-4
C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\extracted_%d.png: No such file or directory
[+] INFO: Conversion completed
[+] INFO: Stripping audio track from original video
"C:\Users\deonix\AppData\Local\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -i "C:\video2x-master\bin\it.webm" -vn -acodec copy C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\output-audio.aac -y
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, matroska,webm, from 'C:\video2x-master\bin\it.webm':
  Metadata:
    encoder         : libebml v1.3.4 + libmatroska v1.4.5
    creation_time   : 2018-08-28T16:52:36.000000Z
  Duration: 00:00:05.10, start: 0.000000, bitrate: 6443 kb/s
    Stream #0:0: Video: vp8, yuv420p(progressive), 900x500, SAR 1:1 DAR 9:5, 29.41 fps, 29.41 tbr, 1k tbn, 1k tbc (default)
Output #0, adts, to 'C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\output-audio.aac':
Output file #0 does not contain any stream
[+] INFO: Inserting audio track into new video
"C:\Users\deonix\AppData\Local\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -i C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\no_audio.mp4 -i C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\output-audio.aac -shortest -codec copy C:\video2x-master\bin\it2.webm -y
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
C:\Users\deonix\AppData\Local\Temp\tmpgc_su644\no_audio.mp4: No such file or directory
[+] INFO: Program completed, taking 5.8841 seconds
k4yt3x commented 5 years ago

This is very strange.

In one of the lines, it says "変換に失敗したファイルがあります", which indicates that some files failed to upscale. Tracing back upwards, the previous action will be to extract frames from the video.

I see that the video is in webm format. Would that be causing the problem?

  1. Is there any chance I can have the video to make a test?
  2. Does the program work ok on your system with mp4 videos?
lachlan-smith commented 5 years ago

I had this same issue, however when changing the -m switch from "gpu" to "cudnn", it was able to complete successfully. This was with a NVIDIA GTX 980ti and version 9 of the CUDA development kit installed.

deonix37 commented 5 years ago

Getting the same output for mp4s. Tried the cpu, gpu, and cudnn methods. My graphics card is AMD Radeon RX 560. It gives some error log btw. error_log_20190128-111625.5472.log edit: the error log is for cpu.

lachlan-smith commented 5 years ago

Getting the same output for mp4s. Tried the cpu, gpu, and cudnn methods. My graphics card is AMD Radeon RX 560. It gives some error log btw. error_log_20190128-111625.5472.log

I don't believe you are able to use cudnn with AMD graphics cards, as it's a NVIDIA library and they only support a subset of their own cards.

As for the gpu switch, it appears that currently this project doesn't support OpenCL which AMD cards rely on (See this issue https://github.com/K4YT3X/video2x/issues/30)

This doesn't explain why cpu doesn't work though, I'd suggest posting a log file when using the cpu option.

lachlan-smith commented 5 years ago

Getting the same output for mp4s. Tried the cpu, gpu, and cudnn methods. My graphics card is AMD Radeon RX 560. It gives some error log btw. error_log_20190128-111625.5472.log edit: the error log is for cpu.

That seems like Caffe can't allocate enough memory. Try increasing your system swap space as mentioned in this issue https://github.com/BVLC/caffe/issues/2474

k4yt3x commented 5 years ago

Getting the same output for mp4s. Tried the cpu, gpu, and cudnn methods. My graphics card is AMD Radeon RX 560. It gives some error log btw. error_log_20190128-111625.5472.log edit: the error log is for cpu.

@lachlan-smith is right. waifu2x-caffe currently doesn't have support for AMD GPUs. However, if you look at #30 , AMD support is on its way.