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.88k stars 1.02k forks source link

Program keeps running, even though there shouldn't be any frames left to upscale #465

Closed Aidosity closed 2 years ago

Aidosity commented 3 years ago

Component Versions

Symptom

The video I am trying to upscale has 118223 frames, and had an estimated time of 10 hours to complete. After it finished those 10 hours and got through all those frames, it just kept going. It's been running for over 20 hours now and has finished over 230000 frames. Where are these extra frames coming from, and how come it hasn't finished yet?

Error Log or Screenshots

It hasn't crashed (yet) so no error log, it's just doing it's thing, but it don't stop! v2x v2xgui

k4yt3x commented 3 years ago

Hmmm interesting. Take a look at the console and see what it's doing.

RealLarwood commented 3 years ago

I have this issue as well, as far as I can tell it is simply a case of ffprobe getting the wrong number of frames for some files. I have a file with 43020 frames that get extracted but ffprobe returns 34865. Hopefully the number reported by ffprobe isn't used for anything important.

k4yt3x commented 3 years ago

What's shown in the console though?

RealLarwood commented 3 years ago

[+] INFO: Loading files into processing queue 2021-02-25 15:36:20.161214 [+] INFO: Input path(s): Y:\Anime\Monster\1.mkv 2021-02-25 15:36:20.183576 [+] INFO: File MIME type: video/x-matroska [+] INFO: Loaded files into processing queue 2021-02-25 15:36:20.187081 [+] INFO: Input file: Y:\Anime\Monster\1.mkv [+] INFO: Reading file information 2021-02-25 15:36:20.187581 [+] INFO: Executing: E:\Downloads\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin\ffprobe -v quiet -print_format json -show_format -show_streams -i Y:\Anime\Monster\1.mkv 2021-02-25 15:36:20.231619 [+] INFO: Creating cache directory E:\Downloads\video2x-4.8.1-win32-full\temp 2021-02-25 15:36:20.232120 [+] INFO: Extracted frames are being saved to: E:\Downloads\video2x-4.8.1-win32-full\temp\tmp8wrvdc4t 2021-02-25 15:36:20.232620 [+] INFO: Upscaled frames are being saved to: E:\Downloads\video2x-4.8.1-win32-full\temp\tmpo_pbj2rp [+] INFO: Starting upscaling video/GIF [+] INFO: Getting total number of frames in the file 2021-02-25 15:36:20.233621 [+] INFO: Executing: E:\Downloads\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin\ffprobe -v quiet -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 Y:\Anime\Monster\1.mkv [+] INFO: Calculating scaling parameters 2021-02-25 15:36:51.832765 [+] INFO: Framerate: 29.97002997002997 2021-02-25 15:36:51.833266 [+] INFO: Width: 720 2021-02-25 15:36:51.833266 [+] INFO: Height: 480 2021-02-25 15:36:51.833766 [+] INFO: Total number of frames: 34865 2021-02-25 15:36:51.834267 [+] INFO: Output width: 2160 2021-02-25 15:36:51.834267 [+] INFO: Output height: 1440 2021-02-25 15:36:51.834767 [+] INFO: Required scale ratio: 3.0 2021-02-25 15:36:51.835267 [+] INFO: Upscaling jobs queue: [2, 2] 2021-02-25 15:36:51.835768 [+] INFO: Executing: E:\Downloads\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin\ffmpeg -y -i Y:\Anime\Monster\1.mkv -pixfmt rgb24 E:\Downloads\video2x-4.8.1-win32-full\temp\tmp8wrvdc4t\extracted%0d.png 2021-02-25 15:36:51.837770 [+] INFO: Main process waiting for subprocesses to exit 2021-02-25 15:40:57.935277 [+] INFO: Subprocess 8256 exited with code 0 [+] INFO: Starting to upscale extracted frames 2021-02-25 15:40:58.568392 [+] INFO: [upscaler] Subprocess 19664 executing: E:\Downloads\video2x-4.8.1-win32-full\dependencies\waifu2x-ncnn-vulkan\waifu2x-ncnn-vulkan -n 1 -s 2 -t 400 -m E:\Downloads\video2x-4.8.1-win32-full\dependencies\waifu2x-ncnn-vulkan\models-cunet -g 0 -j 12:12:12 -f png -i E:\Downloads\video2x-4.8.1-win32-full\temp\tmp8wrvdc4t -o E:\Downloads\video2x-4.8.1-win32-full\temp\tmpo_pbj2rp 2021-02-25 15:40:58.608296 [+] INFO: Starting progress monitor Processing: 1.mkv (pass 1/2): 0%| | 0/34865 [00:00<?, ?it/s]2021-02-25 15:40:58.608796 [+] INFO: Starting upscaled image cleaner 2021-02-25 15:40:58.609797 [+] INFO: Main process waiting for subprocesses to exit Processing: 1.mkv (pass 1/2): 43012it [1:39:35, 7.10it/s]2021-02-25 17:20:34.805591 [+] INFO: Subprocess 7276 exited with code 0 Processing: 1.mkv (pass 1/2): 43020it [1:39:36, 6.92it/s]2021-02-25 17:20:34.931200 [+] INFO: Killing progress monitor Processing: 1.mkv (pass 1/2): 43020it [1:39:37, 7.20it/s] 2021-02-25 17:20:35.924553 [+] INFO: Killing upscaled image cleaner 2021-02-25 17:20:45.693696 [+] INFO: [upscaler] Subprocess 19664 executing: E:\Downloads\video2x-4.8.1-win32-full\dependencies\waifu2x-ncnn-vulkan\waifu2x-ncnn-vulkan -n 1 -s 2 -t 400 -m E:\Downloads\video2x-4.8.1-win32-full\dependencies\waifu2x-ncnn-vulkan\models-cunet -g 0 -j 12:12:12 -f png -i E:\Downloads\video2x-4.8.1-win32-full\temp\tmp8wrvdc4t -o E:\Downloads\video2x-4.8.1-win32-full\temp\tmpo_pbj2rp 2021-02-25 17:20:45.696698 [+] INFO: Starting progress monitor Processing: 1.mkv (pass 2/2): 0%| | 0/34865 [00:00<?, ?it/s]2021-02-25 17:20:45.697699 [+] INFO: Starting upscaled image cleaner 2021-02-25 17:20:45.698199 [+] INFO: Main process waiting for subprocesses to exit Processing: 1.mkv (pass 2/2): 43019it [6:42:11, 1.77it/s]2021-02-26 00:02:57.137681 [+] INFO: Subprocess 20420 exited with code 0 2021-02-26 00:02:57.240268 [+] INFO: Killing progress monitor Processing: 1.mkv (pass 2/2): 43019it [6:42:12, 1.78it/s] 2021-02-26 00:02:57.932863 [+] INFO: Killing upscaled image cleaner [+] INFO: Upscaling completed [+] INFO: Average processing speed: 1.1574546025520074 seconds per frame [+] INFO: Lanczos downscaling frames Downscaling: 7%|####1 | 2900/43020 [37:45<10:00:56, 1.11it/s]

k4yt3x commented 3 years ago

Looks like it's running just ifne

RealLarwood commented 3 years ago

Yeah it's running fine but you can see the progress bars don't match. It detected 34865 frames and the upscaling passes showed being out of 34865 frames but they both reached 43020, for whatever reason the lanczos stage knows the correct number.

attania commented 3 years ago

I was having the same issue earlier, but I found out it was due to the audio in my source having reportedly more frames than the video source (video has 4969 frames, audio has 6211 frames). Could be applicable in this case, too? Anyways, I fixed it by removing the audio source from my file via MKVToolNix (FFMPEG can do the same as well).

Attached below is what FFProbe found for me.

{ "streams": [ { "index": 0, "codec_name": "mpeg2video", "codec_long_name": "MPEG-2 video", "profile": "Main", "codec_type": "video", "codec_time_base": "1001/30000", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "width": 720, "height": 480, "coded_width": 0, "coded_height": 0, "closed_captions": 0, "has_b_frames": 1, "sample_aspect_ratio": "186:157", "display_aspect_ratio": "279:157", "pix_fmt": "yuv420p", "level": 8, "color_range": "tv", "chroma_location": "left", "field_order": "progressive", "refs": 1, "r_frame_rate": "30000/1001", "avg_frame_rate": "30000/1001", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "bit_rate": "8328000", "disposition": { "default": 0, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0 }, "tags": { "language": "eng", "BPS-eng": "8328014", "DURATION-eng": "00:03:27.240366666", "NUMBER_OF_FRAMES-eng": "4969", "NUMBER_OF_BYTES-eng": "215737221", "SOURCE_ID-eng": "0100E0", "_STATISTICS_WRITING_APP-eng": "MakeMKV v1.16.3 win(x64-release)", "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-29 12:19:54", "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID" }, "side_data_list": [ { "side_data_type": "CPB properties" } ] }, { "index": 1, "codec_name": "pcm_s16le", "codec_long_name": "PCM signed 16-bit little-endian", "codec_type": "audio", "codec_time_base": "1/48000", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "sample_fmt": "s16", "sample_rate": "48000", "channels": 2, "bits_per_sample": 16, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "bit_rate": "1536000", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0 }, "tags": { "language": "jpn", "title": "Stereo", "BPS-eng": "1536000", "DURATION-eng": "00:03:27.020000000", "NUMBER_OF_FRAMES-eng": "6211", "NUMBER_OF_BYTES-eng": "39747840", "SOURCE_ID-eng": "01A0BD", "_STATISTICS_WRITING_APP-eng": "MakeMKV v1.16.3 win(x64-release)", "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-29 12:19:54", "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID" } } ], "format": { "filename": "C:\ffmpeg\bin\acacia.mkv", "nb_streams": 2, "nb_programs": 0, "format_name": "matroska,webm", "format_long_name": "Matroska / WebM", "start_time": "0.000000", "duration": "207.240000", "size": "255641303", "bit_rate": "9868415", "probe_score": 100, "tags": { "encoder": "libmakemkv v1.16.3 (1.3.10/1.5.2) win(x64-release)", "creation_time": "2021-04-29T12:19:54.000000Z" } } }

k4yt3x commented 2 years ago

Please reopen if you're still having this problem.