k4yt3x / video2x

A machine learning-based lossless video super resolution framework. Est. Hack the Valley II, 2018.
https://video2x.org
GNU Affero General Public License v3.0
10.71k stars 1k forks source link

Images Unprocessed When Using CUDNN #21

Closed wuast94 closed 5 years ago

wuast94 commented 6 years ago

So im back and now having this error:

"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -i "D:\S01E01o.avi" C:\Users\Marcd\Desktop\videoenlarger\video2x-master\frames\extracted_%0d.png -y
ffmpeg version N-92202-gf72b9904fe 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. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, avi, from 'D:\S01E01o.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
  Duration: 00:20:50.46, start: 0.000000, bitrate: 1172 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1035 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> png (native))
Press [q] to stop, [?] for help
[mpeg4 @ 0000000004724800] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
Output #0, image2, to 'C:\Users\Marcd\Desktop\videoenlarger\video2x-master\frames\extracted_%0d.png':
  Metadata:
    encoder         : Lavf58.19.100
    Stream #0:0: Video: png, rgb24, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc
    Metadata:
      encoder         : Lavc58.33.101 png
frame=29982 fps=217 q=-0.0 Lsize=N/A time=00:20:50.50 bitrate=N/A dup=1 drop=0 speed=9.07x
video:10005055kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[+] INFO: Reading video information
[+] INFO: Framerate: 23.976
[+] INFO: Starting to upscale extracted images
2018-11-01 21:43:49.597001 [+] INFO: [upscaler] Thread 0 started
2018-11-01 21:43:49.598004 [+] INFO: [upscaler] Thread 1 started
2018-11-01 21:43:49.598004 [+] INFO: [upscaler] Thread 2 started
2018-11-01 21:43:49.599007 [+] INFO: [upscaler] Thread 3 started
2018-11-01 21:43:49.599007 [+] INFO: [upscaler] Thread 4 started
2018-11-01 21:43:49.600010 [+] INFO: [upscaler] Thread 5 started
2018-11-01 21:43:49.600010 [+] INFO: [upscaler] Thread 6 started
2018-11-01 21:43:49.601012 [+] INFO: [upscaler] Thread 7 started
2018-11-01 21:43:49.601012 [+] INFO: [upscaler] Thread 8 started
2018-11-01 21:43:49.601012 [+] INFO: [upscaler] Thread 9 started
2018-11-01 21:43:49.604020 [+] INFO: [upscaler] Thread 10 started
2018-11-01 21:43:49.605023 [+] INFO: [upscaler] Thread 11 started
2018-11-01 21:43:50.194590 [+] INFO: [upscaler] Thread 4 exiting
2018-11-01 21:43:50.364041 [+] INFO: [upscaler] Thread 0 exiting
2018-11-01 21:43:50.381086 [+] INFO: [upscaler] Thread 9 exiting
2018-11-01 21:43:50.383091 [+] INFO: [upscaler] Thread 1 exiting
2018-11-01 21:43:50.388105 [+] INFO: [upscaler] Thread 10 exiting
2018-11-01 21:43:50.390110 [+] INFO: [upscaler] Thread 11 exiting
2018-11-01 21:43:50.394121 [+] INFO: [upscaler] Thread 5 exiting
2018-11-01 21:43:50.395124 [+] INFO: [upscaler] Thread 6 exiting
2018-11-01 21:43:50.395124 [+] INFO: [upscaler] Thread 7 exiting
2018-11-01 21:43:50.396126 [+] INFO: [upscaler] Thread 3 exiting
2018-11-01 21:43:50.398131 [+] INFO: [upscaler] Thread 8 exiting
2018-11-01 21:43:50.399134 [+] INFO: [upscaler] Thread 2 exiting
[+] INFO: Upscaling completed
[+] INFO: Converting extracted frames into video
"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -r 23.976 -f image2 -s 640x480 -i C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\extracted_%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\no_audio.mp4 -y
ffmpeg version N-92202-gf72b9904fe 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. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[image2 @ 000000000465afc0] Could find no file with path 'C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\extracted_%d.png' and index in the range 0-4
C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\extracted_%d.png: No such file or directory
[+] INFO: Conversion completed
[+] INFO: Stripping audio track from original video
"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -i "D:\S01E01o.avi" -vn -acodec copy C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\output-audio.aac -y
ffmpeg version N-92202-gf72b9904fe 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. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, avi, from 'D:\S01E01o.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
  Duration: 00:20:50.46, start: 0.000000, bitrate: 1172 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1035 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
[adts @ 0000000004748000] Only AAC streams can be muxed by the ADTS muxer
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
    Last message repeated 1 times
[+] INFO: Inserting audio track into new video
"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -i C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\no_audio.mp4 -i C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\output-audio.aac -shortest -codec copy D:\S01E01n.avi -y
ffmpeg version N-92202-gf72b9904fe 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. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\no_audio.mp4: No such file or directory
[+] INFO: Program completed, taking 154.6568 seconds
wuast94 commented 6 years ago

it only comes if i use cudnn flag

k4yt3x commented 6 years ago

it only comes if i use cudnn flag

Do you have CUDNN drivers installed?

cr08 commented 6 years ago

I ran into this as well with no extra libraries or drivers installed. Just the basic 'full install' consumer Nvidia drivers for my GPU. Essentially the 'starting thread' lines showed, the whole process kinda of idled for a number of minutes with no work before displaying the 'thread exiting' messages and then attempting (and failing) to continue the rest of the script.

Based on some other tools that already use waifu2x-caffe it is a requirement to install the extra CUDNN library. From my brief testing it looks like installing extra CUDA cruft isn't a requirement and the basic drivers will suit it just fine.

Run over to https://developer.nvidia.com/cudnn and sign up for a full dev account (free) and download the appropriate CUDNN 'Library' for your version of Windows and CUDA. v10 should suffice as it did me. You'll get a zip file and in one of the folders a huge 200-300MB dll. Drop this DLL straight into the waifu2x-caffe folder.

EDIT: Upon further checks, according to the waifu2x-caffe github CUDA processing should work without CUDNN. Not exactly sure why that isn't the case here. However this isn't a terrible workaround. No installation, just dropping a dll from a zip file into the waifu2x-caffe folder and go.

k4yt3x commented 6 years ago

@cr08 I already have the CUDNN drivers installed a long time ago before I brought this project back to life. Also I have no extra hardware to test this software without CUDNN installed.

Therefore I'll figure out, somehow, how to test this script properly. Maybe I'll have to get another installation of Windows on a separate hard drive.

k4yt3x commented 5 years ago

Closing this issue due to inactivity. Feel free to repoen it at any time.