-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Duration floating point round-off causes "IndexError: list index out of range" in write_videofile #646
Comments
Can confirm this problem, thanks for spotting! |
@tburrows13 Who are you asking for confirmation? |
I meant that I can confirm this problem, sorry! |
@tburrows13 Great. Thanks for your help. |
Can confirm this is still happening. the output of concatenate_videoclips assumes there's one more frame than there are in the clips that were merged. Seems to happen because of the float precision when the time of certain clip cannot be represented exactly. |
Temporary workaround if anyone's still stuck:
|
Still get the same |
I'm still getting this issue now... Could you please look into this? |
1 similar comment
I'm still getting this issue now... Could you please look into this? |
I fixed this issue in manually. There is a prbloem in File concatenate.py, line 66
'clip.duration' is not always an integer. so if you change 'clip.duration' to integer thing, that problem will solve. But I don't know this solution make another problem. |
Hello, I am still having issues with this, ehile using the latest version (v1.0.3) and the patch suggested before ( final_clip = concatenate_videoclips(list_of_clips) Any news on how it will / can be fixed? |
I just posted a question on Stack overflow write_videofile throws list index out of range - but works I am wondering if it may be related to this I have a bunch of videos in a directory 1.mp4, 2.mp4 .... I am merging them into output_1_2.mp4. The following code works, but .. Its throwning an error that i cant seem to figure out.
Again it works the files are merged, im just trying to understand the why
is throwing an list index out of range error. As the code works i can probably just ignore it. This question is more out of curiosity. Code
|
I see this as Closed, but it is still happening. I had this issue a few moments ago and I realized the error. I concatenated some clips and obtained a duration of 8.116666666666667 when printed. If I apply the % operand the result is not 0 so, as it is detecting a value greater than the expected (maybe 8,1166666666666666666666666666667, just did it in my calculator app), it goes to the next frame that doesn't exist and fails. I saw a workaround that seems to be working, but it is actually writing twice (one when it fails and the second one when fixed). I think this code below is faster and easier (
The It worked for me and you avoid the double |
The sample code creates a color clip with a duration of 2.24, a size of [1080, 1080] and fps=50.0
The clip writes properly after CompositeVideoClip but if it is concatenated then the duration changes slightly and writing fails.
The file writes successfully
The write_videofile() fails with IndexError
The text was updated successfully, but these errors were encountered: