Skip to content
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

ImageSequenceClip repeats frames depending on fps #464

Closed
PhillipGH opened this issue Mar 5, 2017 · 1 comment
Closed

ImageSequenceClip repeats frames depending on fps #464

PhillipGH opened this issue Mar 5, 2017 · 1 comment

Comments

@PhillipGH
Copy link

I was putting together a sequence of frames with ImageSequenceClip and saw that my animation seemed to hang at a certain point as if there were a repeated frame. However, I noticed the problem went away when I switched from 24 to 30 fps.

I wrote a program to reproduce the issue that makes ImageSequenceClips out of the same set of frames at different fps's and looks for repeated frames.

from moviepy.editor import *

frames_filenames = []
# set of frames that are all different
for i in range(20):
	frames_filenames.append('frames2/processing/' + str(i) + 'frame.png')

for frames_per_second in range(1,31):
	print("\nfps: " + str(frames_per_second))
	movie = ImageSequenceClip(frames_filenames, fps=frames_per_second)
	lastPixels = []
	count = 0
	for frame in movie.iter_frames():
		# band of pixels that is different in every frame
		pixels = frame[306,560:600,0]
		if len(pixels) == len(lastPixels):
			tuple = zip(pixels, lastPixels)
			difference = [x for x in tuple if x[0] == x[1]]
			if len(difference) == 600 - 560:
				print("frame " + str(count))
				print(difference)
				print("\n")
		lastPixels = pixels
		count += 1

Here is the output of this program:

fps: 1

fps: 2

fps: 3
frame 10
[(184, 184), (184, 184), (182, 182), (182, 182), (180, 180), (180, 180), (178, 178), (178, 178), (177, 177), (177, 177), (174, 174), (171, 171), (169, 169), (166, 166), (161, 161), (158, 158), (157, 157), (146, 146), (136, 136), (131, 131), (128, 128), (121, 121), (117, 117), (115, 115), (114, 114), (117, 117), (127, 127), (138, 138), (147, 147), (153, 153), (159, 159), (162, 162), (166, 166), (166, 166), (170, 170), (170, 170), (171, 171), (175, 175), (177, 177), (181, 181)]



fps: 4

fps: 5
frame 15
[(155, 155), (155, 155), (157, 157), (163, 163), (170, 170), (172, 172), (177, 177), (183, 183), (183, 183), (187, 187), (193, 193), (197, 197), (200, 200), (201, 201), (204, 204), (207, 207), (207, 207), (208, 208), (210, 210), (211, 211), (211, 211), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (216, 216), (217, 217), (218, 218), (218, 218), (216, 216), (216, 216), (215, 215), (215, 215), (215, 215), (215, 215), (215, 215), (215, 215)]



fps: 6
frame 10
[(184, 184), (184, 184), (182, 182), (182, 182), (180, 180), (180, 180), (178, 178), (178, 178), (177, 177), (177, 177), (174, 174), (171, 171), (169, 169), (166, 166), (161, 161), (158, 158), (157, 157), (146, 146), (136, 136), (131, 131), (128, 128), (121, 121), (117, 117), (115, 115), (114, 114), (117, 117), (127, 127), (138, 138), (147, 147), (153, 153), (159, 159), (162, 162), (166, 166), (166, 166), (170, 170), (170, 170), (171, 171), (175, 175), (177, 177), (181, 181)]



fps: 7

fps: 8

fps: 9
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]



fps: 10
frame 15
[(155, 155), (155, 155), (157, 157), (163, 163), (170, 170), (172, 172), (177, 177), (183, 183), (183, 183), (187, 187), (193, 193), (197, 197), (200, 200), (201, 201), (204, 204), (207, 207), (207, 207), (208, 208), (210, 210), (211, 211), (211, 211), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (216, 216), (217, 217), (218, 218), (218, 218), (216, 216), (216, 216), (215, 215), (215, 215), (215, 215), (215, 215), (215, 215), (215, 215)]



fps: 11
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]



fps: 12
frame 10
[(184, 184), (184, 184), (182, 182), (182, 182), (180, 180), (180, 180), (178, 178), (178, 178), (177, 177), (177, 177), (174, 174), (171, 171), (169, 169), (166, 166), (161, 161), (158, 158), (157, 157), (146, 146), (136, 136), (131, 131), (128, 128), (121, 121), (117, 117), (115, 115), (114, 114), (117, 117), (127, 127), (138, 138), (147, 147), (153, 153), (159, 159), (162, 162), (166, 166), (166, 166), (170, 170), (170, 170), (171, 171), (175, 175), (177, 177), (181, 181)]



fps: 13

fps: 14

fps: 15

fps: 16

fps: 17
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]


frame 12
[(180, 180), (178, 178), (171, 171), (169, 169), (160, 160), (157, 157), (146, 146), (146, 146), (146, 146), (140, 140), (140, 140), (126, 126), (115, 115), (110, 110), (119, 119), (137, 137), (138, 138), (149, 149), (160, 160), (167, 167), (179, 179), (186, 186), (188, 188), (191, 191), (194, 194), (196, 196), (199, 199), (200, 200), (201, 201), (201, 201), (203, 203), (203, 203), (203, 203), (203, 203), (203, 203), (203, 203), (202, 202), (201, 201), (201, 201), (199, 199)]



fps: 18
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]



fps: 19

fps: 20
frame 15
[(155, 155), (155, 155), (157, 157), (163, 163), (170, 170), (172, 172), (177, 177), (183, 183), (183, 183), (187, 187), (193, 193), (197, 197), (200, 200), (201, 201), (204, 204), (207, 207), (207, 207), (208, 208), (210, 210), (211, 211), (211, 211), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (214, 214), (216, 216), (217, 217), (218, 218), (218, 218), (216, 216), (216, 216), (215, 215), (215, 215), (215, 215), (215, 215), (215, 215), (215, 215)]



fps: 21
frame 14
[(226, 226), (226, 226), (226, 226), (226, 226), (226, 226), (225, 225), (225, 225), (225, 225), (225, 225), (225, 225), (225, 225), (224, 224), (226, 226), (225, 225), (224, 224), (223, 223), (226, 226), (224, 224), (223, 223), (222, 222), (220, 220), (219, 219), (218, 218), (215, 215), (215, 215), (214, 214), (207, 207), (209, 209), (213, 213), (213, 213), (213, 213), (212, 212), (212, 212), (212, 212), (211, 211), (209, 209), (209, 209), (208, 208), (207, 207), (208, 208)]



fps: 22
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]



fps: 23

fps: 24
frame 10
[(184, 184), (184, 184), (182, 182), (182, 182), (180, 180), (180, 180), (178, 178), (178, 178), (177, 177), (177, 177), (174, 174), (171, 171), (169, 169), (166, 166), (161, 161), (158, 158), (157, 157), (146, 146), (136, 136), (131, 131), (128, 128), (121, 121), (117, 117), (115, 115), (114, 114), (117, 117), (127, 127), (138, 138), (147, 147), (153, 153), (159, 159), (162, 162), (166, 166), (166, 166), (170, 170), (170, 170), (171, 171), (175, 175), (177, 177), (181, 181)]



fps: 25
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]


frame 18
[(215, 215), (214, 214), (211, 211), (209, 209), (208, 208), (207, 207), (202, 202), (200, 200), (198, 198), (196, 196), (193, 193), (190, 190), (188, 188), (187, 187), (185, 185), (183, 183), (186, 186), (185, 185), (187, 187), (188, 188), (191, 191), (193, 193), (196, 196), (199, 199), (204, 204), (205, 205), (210, 210), (213, 213), (217, 217), (218, 218), (219, 219), (219, 219), (218, 218), (218, 218), (216, 216), (216, 216), (215, 215), (213, 213), (212, 212), (212, 212)]



fps: 26

fps: 27

fps: 28

fps: 29
frame 6
[(230, 230), (230, 230), (230, 230), (230, 230), (230, 230), (229, 229), (229, 229), (228, 228), (228, 228), (228, 228), (228, 228), (227, 227), (227, 227), (226, 226), (226, 226), (224, 224), (222, 222), (221, 221), (220, 220), (219, 219), (214, 214), (213, 213), (212, 212), (213, 213), (205, 205), (200, 200), (197, 197), (194, 194), (189, 189), (181, 181), (174, 174), (166, 166), (158, 158), (152, 152), (144, 144), (136, 136), (126, 126), (121, 121), (120, 120), (122, 122)]



fps: 30
neitzal added a commit to neitzal/moviepy that referenced this issue Mar 14, 2017
ghost pushed a commit that referenced this issue Apr 19, 2017
* Fix issue 464, repeated/skipped frames in ImageSequenceClip

* Add test for issue #464, repeated/skipped frames of ImageSequenceClip
@keikoro
Copy link
Collaborator

keikoro commented Nov 25, 2017

Looks like a fix for this was merged, so I'm closing this issue. Please reopen or submit a new issue if the problem persists.

@keikoro keikoro closed this as completed Nov 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants