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

No such file or directory #5

Open
My12123 opened this issue Aug 26, 2023 · 15 comments
Open

No such file or directory #5

My12123 opened this issue Aug 26, 2023 · 15 comments

Comments

@My12123
Copy link
Contributor

My12123 commented Aug 26, 2023

(venv) F:\FAST_Anime_VSR>python main.py
We are going to process all videos in X:\А\Монстр_encrypted\Новая папка
All files begin
We are super resolving X:\А\Монстр_encrypted\Новая папка\2.mp4 and we will save it at X:\А\Монстр_encrypted\Новая папка (2)\2_processed.mp4
Current supported input resolution for Super-Resolution is  defaultdict(<class 'list'>, {858: [168, 480]})
This resolution 858X480 is supported in weights/ folder!
The full frame name is 858X480 and partition frame name is 858X168
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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 --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
X:\╨Р\╨Ь╨╛╨╜╤Б╤В╤А_encrypted\╨Э╨╛╨▓╨░╤П: No such file or directory
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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 --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
X:\╨Р\╨Ь╨╛╨╜╤Б╤В╤А_encrypted\╨Э╨╛╨▓╨░╤П: No such file or directory
All Processes Start
Set new attr for inp_path to be tmp/part0.mp4
Set new attr for opt_path to be tmp/part0_res.mp4
P:No such file tmp/part0.mp4 exists!
Set new attr for inp_path to be tmp/part1.mp4
Set new attr for opt_path to be tmp/part1_res.mp4
P:No such file tmp/part1.mp4 exists!
All Processes End
Total time spent for this video is 0 min 7 s
After finish one thing, sleep for a moment!
@Kiteretsu77
Copy link
Owner

I am not sure if this is directory issue (seems to have some encrypted characters)You can send me a google link of this video and I can try on my own PC. I think that this will help me to locate the problem sonner. Thanks!

@My12123
Copy link
Contributor Author

My12123 commented Aug 26, 2023

There are Russian letters and spaces in the path, could this be a problem?
Link to the video https://static.trn.su/635216762.mp4?md5=LMWZVz5CQeSfRAlTIth5Wg&time=1693075261&d=1 https://static.trn.su/1215916127.mp4?md5=GJOOX2AB1O3i7_GjpIwa_Q&time=1693079955
Taken from https://v2.vost.pw/tip/tv/3016-seija-musou-salaryman-isekai-de-ikinokoru-tame-ni-ayumu-michi.html
https://v2.vost.pw/tip/tv/449-shinseiki-evangelion.html
I tried to change the path, another error appears

(venv) F:\FAST_Anime_VSR>python main.py
We didn't find such location exists!

@Kiteretsu77
Copy link
Owner

The link you give me is an 403.mp4 which is 720x1280. I can execute it with Real-CUGAN model (the Real-ESRGAN model seems to have some bug). Since your GPU is RTX 2060, I don't recommend to run Real-ESRGAN, which is much more intense than Real-CUGAN. For the Real-ESRGAN, I will take a time to research on it (since it is a new feature, there may be some minor case that make this mode not working).
Even if when you are using Real-CUGAN, I recommend you set full_model_num=0, and nt=1 in configs.py, to decrease GPU memory needs.

@My12123
Copy link
Contributor Author

My12123 commented Aug 26, 2023

How much GPU memory do I need?
I have a GPU
NVIDIA GeForce RTX 2060 SUPER
Dedicated GPU memory 8.0 GB
The total memory of the GPU is 19.9 GB
The RAM of the GPU is 27.9 GB

@Kiteretsu77
Copy link
Owner

Generally, 8GB memory for 2060Super is equivalent to my 3060Ti. So, in this case, I think that 480P-720P input using Real-CuGAN is possible, but I still think that it may be a little bit intense for Real-ESRGAN. You can first set full_model_num=0, and nt=1 and increase it gradually.

@My12123
Copy link
Contributor Author

My12123 commented Aug 27, 2023

It's working now. Thanks for the help.
2023-08-27_11-40-42
Takes 5.3 GB of GPU memory when setting full_model_num = 3
number nt = 1

@My12123
Copy link
Contributor Author

My12123 commented Aug 27, 2023

Takes 4.9 GB of GPU memory when setting full_model_num = 4
number nt = 1
2023-08-27_13-00-04
Why is the GPU not 100% loaded, but there is idle time when the CPU is loaded at 100% all the time?
Is it possible to extract frames with the GPU using the video core?

@Kiteretsu77
Copy link
Owner

The CPU is 100% loaded because the program needs to decode video and encode video at the same time. (Video compression and encoding is very computation expensive.) For the GPU, it is normal to myself that the GPU is not 100% loaded because sometimes GPU will face gap between frames. For example, in a scene, if there is no motion of a character, then the GPU is less reuqired to compute and we may delay the GPU computation. And when the GPU needs to communicate with resources, I think that the GPU will temporarily be less utilized.

@Kiteretsu77
Copy link
Owner

Kiteretsu77 commented Aug 28, 2023

To extract frames with the GPU, I think that this is a good idea, but I am not sure if this is supported in Moviepy. And also, the input source is usually CPU encoded, so using hardware decode may not be the most optimistic way because GPU is not good at complex macroblock analysis and decoding. Meanwhile, it is possible to use GPU as an encoding method, but GPU encoding cannot compress to a bitrate as good as CPU encoding because CPU generally use a more complicated macroblock parition and searching compared to GPU.

@Kiteretsu77
Copy link
Owner

The CPU is 100% loaded because the program needs to decode video and encode video at the same time. (Video compression and encoding is very computation expensive.) For the GPU, it is normal to myself that the GPU is not 100% loaded because sometimes GPU will face gap between frames. For example, in a scene, if there is no motion of a character, then the GPU is less reuqired to compute and we may delay the GPU computation. And when the GPU needs to communicate with resources, I think that the GPU will temporarily be less utilized.

Also, I think that my naive Frame comparison (using Mean Square Error) is not efficient, so it cost a lot of CPU resources when I frequently use it.

@My12123
Copy link
Contributor Author

My12123 commented Aug 28, 2023

In Waifu2x-Extension-GUI, it is already possible to extract frames from video using GPU and many ways, and there is support for a large number of video cards.
2023-08-28_10-30-10
Here is a link to NVENC Video Encode and Decode GPU Support Matrix https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new
Instructions https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/index.html#nvidia-video-codec-sdk-v12.0
Zulko/moviepy#1014

@My12123
Copy link
Contributor Author

My12123 commented Aug 28, 2023

I managed to run Real-ESRGAN
image
2023-08-28_14-04-41

F:\FAST_Anime_VSR>call .\venv\Scripts\activate
We are going to process single videos located at F:\FAST_Anime_VSR\i.mp4
Current supported input resolution for Super-Resolution is  defaultdict(<class 'list'>, {640: [128, 360]})
This resolution 640X360 is supported!
The full frame name is 640X360 and partition frame name is 640X128
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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 --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\FAST_Anime_VSR\i.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.12.102
  Duration: 00:03:30.15, start: 0.000000, bitrate: 590 kb/s
    Stream #0:0(jpn): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 485 kb/s, 30.30 fps, 30.30 tbr, 16k tbn, 60.61 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(rus): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream map '0:s:0' matches no streams.
To ignore this, add a trailing '?' to the map.
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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 --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\FAST_Anime_VSR\i.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.12.102
  Duration: 00:03:30.15, start: 0.000000, bitrate: 590 kb/s
    Stream #0:0(jpn): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 485 kb/s, 30.30 fps, 30.30 tbr, 16k tbn, 60.61 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(rus): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, ipod, to 'tmp/output_audio.m4a':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
    Stream #0:0(rus): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=    2518kB time=00:03:30.11 bitrate=  98.2kbits/s speed=5.68e+03x
video:0kB audio:2463kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.259129%
All Processes Start
Set new attr for inp_path to be tmp/part0.mp4
Set new attr for opt_path to be tmp/part0_res.mp4
This process id is  0
weights/Real-ESRGAN\trt_640X128_float16_weight.pth
weights/Real-ESRGAN\trt_640X128_float16_weight.pth
Total FUll Queue size is  1400
Total Divided_Block_Queue_size is  1400
res_q size is  3500
Full Model Preparation
Real-ESRGAN full : 0
[08/28/2023-13:58:32] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
torch2trt full load+prepare time 0.712 s
Real-ESRGAN full : 1
[08/28/2023-13:58:32] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
torch2trt full load+prepare time 0.221 s
Real-ESRGAN full : 2
[08/28/2023-13:58:33] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
torch2trt full load+prepare time 0.218 s
Partition Model Preparation
Real-ESRGAN partition : 0
[08/28/2023-13:58:33] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
torch2trt full load+prepare time 0.146 s
Real-ESRGAN partition : 1
[08/28/2023-13:58:33] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
torch2trt full load+prepare time 0.151 s
====================================================================================================
Current Processing file is  tmp/part0.mp4
Total frame:5040         video decoded frames:0
Total frame:5040         video decoded frames:50
Total frame:5040         video decoded frames:100
Total frame:5040         video decoded frames:150
Process 0 had written frames: 0
Total frame:5040         video decoded frames:200
Total frame:5040         video decoded frames:250
Total frame:5040         video decoded frames:300
Total frame:5040         video decoded frames:350
Total frame:5040         video decoded frames:400
Total frame:5040         video decoded frames:450
Total frame:5040         video decoded frames:500
Total frame:5040         video decoded frames:550
Total frame:5040         video decoded frames:600
Total frame:5040         video decoded frames:650
Total frame:5040         video decoded frames:700
Process 0 had written frames: 50
Total frame:5040         video decoded frames:750
Total frame:5040         video decoded frames:800
Total frame:5040         video decoded frames:850
Total frame:5040         video decoded frames:900
Total frame:5040         video decoded frames:950
Total frame:5040         video decoded frames:1000
Process 0 had written frames: 100
Process 0 had written frames: 150
Total frame:5040         video decoded frames:1050
Process 0 had written frames: 200

@Kiteretsu77
Copy link
Owner

In Waifu2x-Extension-GUI, it is already possible to extract frames from video using GPU and many ways, and there is support for a large number of video cards. 2023-08-28_10-30-10 Here is a link to NVENC Video Encode and Decode GPU Support Matrix https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new Instructions https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/index.html#nvidia-video-codec-sdk-v12.0 Zulko/moviepy#1014

Good to know this! I will do some research on this. Hardware decode may be helpful. However, I think that my first pripority will be on hardware encode because encode usually spends more resources thant hardware decode.

@My12123
Copy link
Contributor Author

My12123 commented Aug 29, 2023

The original problem is not solved in the title of the video, I can only use English letters. Text in another language and numbers are not displayed correctly in the terminal.

@Kiteretsu77
Copy link
Owner

The original problem is not solved in the title of the video, I can only use English letters. Text in another language and numbers are not displayed correctly in the terminal.

Currently, I think that taking English input as the only way is an easier choice to avoid unkown characters bug somewhere in the program (from other public libraray also).

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

2 participants