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

Progress stopping at 66 frames #1217

Closed
tricky2k opened this issue Nov 4, 2024 · 14 comments
Closed

Progress stopping at 66 frames #1217

tricky2k opened this issue Nov 4, 2024 · 14 comments

Comments

@tricky2k
Copy link

tricky2k commented Nov 4, 2024

Video2x 6.0.0 Qt6
Windows 10 64bits
NVidia RTX 3070
AMD FX-8320

I'm having this issue with both RealERSGAN, no matter the model, and libplacebo, with many of the videos I'm trying to upscale. It stops processing at exactly 66 frames, I get the message "Video processing failed for: [filename].mp4". Can't write a log, if I try the program just crashes after stopping at 66 frames without saving any logs

Something I've noticed about the source videos that failed and the ones that succeeded, looking at their properties:

  • [V: h264 main L3.0, yuv420p, WIDTHxHEIGHT, XXX kb/s] <- These failed

  • [V: ISO Media file produced by Google Inc. (h264 main L3.0, yuv420p, WIDTHxHEIGHT, XXX kb/s)] <- These succeeded

The latter are downloaded from Youtube, therefore reencoded by Youtube. The former are downloaded from other sources

I find it weird to say the least, I don't know if it's something to be expected, or if it happens to someone else

Thank you in advance and, most of all, thanks for this amazing program

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 4, 2024

Hmm interesting, seems like some kind of encoding or buffer issue. Have you looked at the debugging logs? Goto debug > set log level to debug > check Show Logs

@tricky2k
Copy link
Author

tricky2k commented Nov 4, 2024

Hmm interesting, seems like some kind of encoding or buffer issue. Have you looked at the debugging logs? Goto debug > set log level to debug > check Show Logs

Well, that's the problem. If I enable to show logs, instead of just stopping at 66 frames, the program crashes, so I can't save any logs to see what's going on. I'll keep trying anyway, maybe I'm lucky and I can save a log without a crash happening

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 5, 2024

That's interesting. I'm about to release a new version today, so you could try that in like a few hours. If you send me the video I can also check if it's the video that's causing the issue.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 5, 2024

The new version is out. You can give that a try too.
Btw I saw your sponsorship. Thanks for the support.

@slickrasta
Copy link

slickrasta commented Nov 5, 2024

Mine fails at frame 66 as well everytime.
4070 Super w/ 9700k on Windows 11 current update, GPU firmware up-to-date

Here's my debug log:
[2024-11-05 13:44:24.924] [debug] Processed frame 66/24936
[2024-11-05 13:44:24.925] [debug] Frame not ready
[libx264 @ 0000025358db46c0] frame= 0 QP=21.77 NAL=3 Slice:I Poc:0 I:5280 P:0 SKIP:0 size=57063 bytes
[asf @ 0000025358e06d00] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 3668 >= -66
[2024-11-05 13:44:25.162] [error] Error muxing packet
[2024-11-05 13:44:25.163] [critical] Error encoding/writing frame: Invalid argument
[2024-11-05 13:44:25.163] [critical] Error processing frames: Invalid argument
[AVIOContext @ 000002534bf39240] Statistics: 262144 bytes read, 0 seeks
[AVIOContext @ 000002535956c040] Statistics: 731 bytes written, 0 seeks, 1 writeouts
[libx264 @ 0000025358db46c0] frame I:1 Avg QP:21.77 size: 57063
[libx264 @ 0000025358db46c0] mb I I16..4: 23.9% 59.7% 16.4%
[libx264 @ 0000025358db46c0] 8x8 transform intra:59.7%
[libx264 @ 0000025358db46c0] coded y,uvDC,uvAC intra: 64.5% 45.2% 8.3%
[libx264 @ 0000025358db46c0] i16 v,h,dc,p: 16% 18% 3% 62%
[libx264 @ 0000025358db46c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 18% 3% 9% 12% 12% 14% 9% 11%
[libx264 @ 0000025358db46c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 17% 2% 9% 14% 11% 13% 9% 11%
[libx264 @ 0000025358db46c0] i8c dc,h,v,p: 13% 58% 20% 8%
[libx264 @ 0000025358db46c0] kb/s:13833.46

Edit: I thought it was all files but I had only tried about 10 different wmv files. Tried an mp4 and it didn't fail at 66. Are wmv files not supported?

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 5, 2024

It might be because of how the file was encoded. Perhaps it's VBR or something? If you could send me one of the files that failed I can debug it and see what's wrong with the video. In theory if it's a video file it SHOULD be supported. If it's breaking then it's a bug. Maybe it's an edge case or something I didn't consider when writing the current code. This new version is a complete rewrite in C++ so I have to consider a lot of low level stuff. Maybe I missed something.

You can either send it here or to my email at [email protected]. You can also use something like Google Drive or wormhole.app. Having a broken video to test with will help speed things up a lot.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 5, 2024

Please also try these, separately:

  • Set container format to .mkv
  • Uncheck Copy audio and subtitle streams

It might be a non-video stream that's causing the issues.

@tricky2k
Copy link
Author

tricky2k commented Nov 5, 2024

The new version is out. You can give that a try too. Btw I saw your sponsorship. Thanks for the support.

NP, it's the least I could do. I just tried with the new version and the same happens. I already had disabled "Copy audio and...", so I just changed the container to mkv. This is Realesrgan log:

[2024-11-06 00:29:06.347] [info] Output video dimensions: 2560x1920
[libx264 @ 000002114603d4c0] using SAR=1/1
[libx264 @ 000002114603d4c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 000002114603d4c0] profile High, level 5.0, 4:2:0, 8-bit
[libx264 @ 000002114603d4c0] 264 - core 164 r3192 c24e06c - H.264/MPEG-4 AVC codec - Copyleft 2003-2024 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[0 NVIDIA GeForce RTX 3070] queueC=2[8] queueG=0[16] queueT=1[2]
[0 NVIDIA GeForce RTX 3070] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 NVIDIA GeForce RTX 3070] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 NVIDIA GeForce RTX 3070] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1
[0 NVIDIA GeForce RTX 3070] queueC=2[8] queueG=0[16] queueT=1[2]
[0 NVIDIA GeForce RTX 3070] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 NVIDIA GeForce RTX 3070] fp16-p/s/u/a=1/1/1/1 int8-p/s/u/a=1/1/1/1
[0 NVIDIA GeForce RTX 3070] subgroup=32 basic/vote/ballot/shuffle=1/1/1/1
[0 NVIDIA GeForce RTX 3070] fp16-8x8x16/16x8x8/16x8x16/16x16x16=0/1/1/1

Link to my Drive for a video giving the error. I downloaded it from the Internet Archive:
https://drive.google.com/file/d/1ehDyarwsL3_XnY10lwQvOvngmsi3H00_/view?usp=sharing

Same video, but downloaded from Youtube, therefore reencoded, and working fine in Video2X:
https://drive.google.com/file/d/1-TGWPi4EYgWOOaAWJm4cFfnoPUkzOKSc/view?usp=sharing

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 5, 2024

Thanks. I'll take a look at it shortly.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 5, 2024

Thanks I was able to reproduce the issue. I'll see how this can be fixed.
Looks like it has to do with B/P frames.

@tricky2k
Copy link
Author

tricky2k commented Nov 5, 2024

I'm in no hurry, since I can do with videos from youtube and all of them work well, but it can be of help for other users

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 6, 2024

I fixed it:

image

It was not I/B/P frames. The issue was with stream mapping. I did some bad math that causes the streams to not be mapped correctly when the first stream in the file isn't the video stream. Usually video files have the first stream as the video and the second would be audio, but the problematic file was the other way around. My tests didn't cover this case so I didn't catch this issue before.

I'll close this issue when the fix commit is fixed.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 6, 2024

Issue fixed in 33b7c53. It will be rolled out in the next release, probably 6.1.1

@k4yt3x k4yt3x closed this as completed Nov 6, 2024
@tricky2k
Copy link
Author

tricky2k commented Nov 6, 2024

Fantastic, thank you!

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

3 participants