sindresorhus / Gifski

🌈 Convert videos to high-quality GIFs on your Mac
https://sindresorhus.com/gifski
MIT License
7.72k stars 290 forks source link

Skip incorrect out-of-range frames #262

Closed kornelski closed 2 years ago

kornelski commented 2 years ago

When using trimming the last frame has incorrect timestamp.

sindresorhus commented 2 years ago

When using trimming the last frame has incorrect timestamp.

I may be misunderstanding this, but your fix ensures that a frame is not before the first time code. Did you mean to say "first frame", not "last"?

How do I reproduce this? Do I trim from the start or end?

kornelski commented 2 years ago

I can reproduce it every time by using the trim feature - just trim any fragment of a video. The last frame that is being decoded and fed to gifski has timestamp that is before the first frame. There's some wraparound or buggy timestamping happening. Try changing this to an assert and see when it fails — that's how I discovered it, because it makes assertions fail inside gif.ski.

sindresorhus commented 2 years ago

There's some wraparound or buggy timestamping happening.

Very strange. I'll look into the core issue more when I have some time.