-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
The trim leading video frames feature fails sometimes #254
Comments
I was able to reproduce this by creating a v210 encoded .mov file: output.movI'll try and take a look later today. |
It seems that every Line 636 in 5c96617
This suggests that a different output format might be necessary, but I tried the ones listed and none of them worked. Also tried the actual format ( The sample file I uploaded earlier is so small that it's not immediately clear that it does actually have data, so here's a bigger / longer one that you can play back: output.movNot really sure where to go from here, not a video encoding expert by any means. I would be curious to find out the source of these v210 files, I can't imagine many consumer-oriented tools produce video in it since it's completely uncompressed. |
Thanks for investigating. This really looks like a macOS bug... How about we do this?
|
In the latest version, there are still some reported failures for this:
|
Another case. The trim error says:
However, the
So it seems like re-wrapping causes it to lose the codec info. It's also weird that it fails on |
Strangely both the App Store version and my locally built version of Gifski crash when selecting any video file (including regular old h264 .mp4s) with the error:
The only thing that I can think of that's changed is I upgraded to Monterey a few days ago. Is the app working for you on Monterey? If so I'll debug further, just want to check if it's an OS issue so I don't waste time. |
@codetheweb I have gotten many reports about the crash on Moneterey, but I have been unable to reproduce it myself... Could you try the latest App Store version v2.19.2? I tried some workarounds there. |
@codetheweb So it seems my potential fix did not work... I don't think that logging is related. I see spurious logging like that all the time. According to many crash reports, there's something in the SwiftUI parts that crashes, so either the estimated size thing or the speed slider. Would you be able to try to comment some stuff out in the SwiftUI parts and see if anything makes it not crash? I'm really lost on what the problem might be and I'm not able to reproduce either. |
Was able to fix it. The error seems to be here: Gifski/Gifski/EstimatedFileSize.swift Line 113 in 5990ce3
Specifying either For now I'd probably just set |
Thank you so much for finding a fix. Can you confirm that Gifski v2.19.3 fixes the issue? |
v2.19.3 does seem to have fixed it for me. 👍 |
Thanks for confirming. |
Getting back to the issue at hand: Not sure what's going on. I created a file that's as close to one of the logs above:
as possible (my file):
but it was handled just fine. This is a wild guess, but maybe there's some subtle differences in AVAsset handling depending on whether the architecture is x86 / ARM? Are you able to see the arch in crash reports? Thanks for the sponsor! :) |
Only x86 machines. |
Noticed a new codec that failed:
|
Given that we're not doing anything particularly fancy and this is happening across multiple codecs it seems to be a bug in AVFoundation in some capacity, but since I can't reproduce it I don't know where to begin investigating. The other thing I thought of today is we could try preloading the metadata, but I doubt that would make a difference since it should automatically be loaded synchronously. Maybe instead of keeping a codec blacklist we should keep a whitelist (specifically, probably only codecs for iOS screen recordings)? |
Note that I did recently get an ARM MacBook and that ProRes file that I generated earlier that worked on x86 no longer seems to work on ARM (just shows black frames and the message "Failed to get estimate" in the corner). Probably not related if all crash reports are on x86 but weird behavior nonetheless. |
Maybe at some point, but it's not a big problem as we still let continue. I have a small hope that someone will eventually email me a test case... |
Yeah, I doubt that's it. |
Some more thoughts. Wonder if we need to check https://developer.apple.com/documentation/coremedia/cmsamplebuffer/3242544-datareadiness Or whether we need to wait for https://developer.apple.com/documentation/coremedia/cmsamplebuffer/3242541-databecameready Also slightly relevant: https://stackoverflow.com/questions/29385893/buffer-size-of-cmsamplebufferref |
Maybe? I can't find much documentation on Doing |
@codetheweb I have noticed that there are a bunch of Crashlytics (automated) reports about this feature not working: "Could not trim empty leading frames from video.". Any ideas?
The text was updated successfully, but these errors were encountered: