open-cogsci / python-mediadecoder

A media decoding library based on MoviePy
http://open-cogsci.github.io/python-mediadecoder
MIT License
9 stars 3 forks source link

movies shorter than 1s give an error #4

Open dev-jam opened 6 years ago

dev-jam commented 6 years ago

When playing movies that are shorter than 1s I get an error about the max_duration in timer.py:

max_duration needs to be greater than 1.0

The goal of this condition is unclear to me. Removing the condition fixes the problem (but maybe creates problems in other cases).

dschreij commented 6 years ago

It was intended to be a failsafe for when people try to load corrupted movies (they have no duration indication), or files that are no movie at all. I never expected anyone to play videos shorter than 1 second. If it doesn't break anything in your case, I will consider removing this check, although I should test a couple of edge-case scenarios first...

dev-jam commented 6 years ago

Maybe change the value to something really small like 0.0001?

dschreij commented 6 years ago

Yes, or maybe even 0.5s would suffice. I doubt people will ever want to play movies shorter than that (or maybe I'm falling into the same trap again). Would it be possible for you to play around with this setting, test if it works correctly and submit a PR? Otherwise I'll see if I can work on this in the weekend.

dschreij commented 6 years ago

Still haven't had a chance to look at this, but it's not gone from my radar...