-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Failed to generate frame: Cannot Decode #202
Comments
Thanks for reporting. Are you able to reproduce it again if you convert with the exact same file and settings? What settings did you convert with (can you take a screenshot)? I was not able to reproduce this myself. |
I've got the same error on a screen recording from Big Sur. I fails on a specific frame, every time. I can trim the problematic frame out of the animation, and it won't fail then. (I didn't report, since I was going to investigate myself, but needed to update Xcode, and that took so long that I forgot about the original issue :D) |
@sindresorhus |
This is the error: (AVFoundationErrorDomain Code=-11821) Perhaps it's trying to say there's no frame at the given timestamp? In that case I suppose it'd be safe to skip the frame. |
No, that's a different error, and we're already handling that: Line 342 in 2760425
|
The error code is the error Not very helpful. Should we just ignore that? Seems wrong to do so. Handy tool: https://www.osstatus.com/search/results?platform=all&framework=all&search=-11821 |
Apple's documentation is useless: https://developer.apple.com/documentation/avfoundation/averror/averrordecodefailed but the StackOverflow answer mentions they've solved it by correcting their timestamps, so I suspect this may be another case of AV getting confused by a mismatched timestamp. |
Some observations. I'll look more into this when the final macOS 11 release is out. It seems to only fail at the following timestamps (Test 1):
The error does not happen if I remove Lines 174 to 175 in 2760425
It also doesn't happen with: generator.requestedTimeToleranceBefore = CMTime(seconds: 0.3, preferredTimescale: .video)
generator.requestedTimeToleranceAfter = CMTime(seconds: 0.3, preferredTimescale: .video) However, it does fail with If there's no other solution, we could consider ignoring any decode errors for the first 0.5 seconds. I would really like to find a better solution though. |
What do you mean by mismatched timestamps? |
Oh, I forgot the framework promises to support any timestamp. I thought it could fail if you asked for a timestamp that doesn't correspond to a frame (but maybe that still happens despite the API promise). |
Similar problem here. Here is the mov file: I am on Big Sur 11.0.1 on Apple silicon. |
@aheze Can you try upgrading to macOS 11.1 and then try rerecording and converting? I read in the release not that it fixes an issue with screen recordings. |
@sindresorhus just updated and tried the same video file, but got the same crash |
Because this is most likely a bug in the screen recorder that creates invalid videos. |
Ah. That's probably the problem, I was using xcrun to screen record the simulator... |
This is the release note item I was talking about:
|
@sindresorhus Hmm. My Xcode is still on 12.2, I'll try updating. |
macOS v.11.0 Beta (20A5364e)
Gifski v.2.9.0 (39)
Screenshot:
Video recording:
Bildschirmaufnahme 2020-09-10 um 16.18.34.zip
The text was updated successfully, but these errors were encountered: