Changing MovieOut's input resolution garbles still images

Hi,

I’m generating a series of still images using Python in an execute DAT. The resolution of each frame must vary according to the size of the text inside each image. I can see that my resolution changes are indeed taken into account by the MovieOut as the resolutions of the resulting files are as expected. The problem is that whenever I change the resolutionw or resolutionh of the TOP connected to the MovieOut’s input I get garbled images. Here’s the simplified code:

[code]def onOffToOn(panelValue):
num_lines = op(‘text’).numRows
line_counter = 0

op('bubble_text').par.resolutionw = 800
op('bubble_text').par.resolutionh = 50

for line_counter in range(num_lines+1):
	# Generate new filename and save image
	filename = 'NumSMS1.' + str(line_counter) + '.png'
	op('moviefileout').par.file = filename
	op('moviefileout').par.addframe.pulse()
	
	#Increase resolution on every iteration
	op('bubble_rectangle').par.resolutionw += 10
	op('bubble_rectangle').par.resolutionh += 5		
return[/code]

The resulting images appear as though there is a “sync” problem (sheared text or rectangles with diagonals for instance) and sometimes I will see part of the previous image inside the next one. Mismatched buffer sizes overflowing into a neighboring area perhaps? I’ve attached two images of an 810x55 green rectangle with rounded corners to illustrate the problem.

I’ve tried changing the type of TOP (text, rectangle etc) connected to the MovieOut and they also resulted in the same garbled output when I changed their resolution between adding frames.

I also tried changing the MovieOut’s output resolution to Custom and explicitly matching its resolution to that of the input TOP’s. Same result.

If I manually change the resolution in the code and generate only one image at a time there is no problem. The files come out as expected. It is only when I try changing the resolution within a single execution of my code generating a series of images that I will get garbled files. Strangely, even the first file in a series is garbled when I do this.

Thanks!


If you arn’t trying to do this as part of a real-time system, I would suggest you use save() with a custom filename you manage instead of the Movie File Out TOP. If you are saving an image sequence in the Movie File Out TOP it won’t allow you to change the resolution during a record. What you are experiencing is a bug for sure, but the correct behavior would be to ignore your resolution changes during a record.

Malcolm,

Using save() on the last TOP in the chain worked. I just removed the MovieOut. Thanks for the suggestion!

I did notice however that if I set the save method’s async parameter to True any filename I specified before it was disregarded and the file was given the same name as the TOP it was called from instead. This had the effect that all my files were being overwritten by following save operations.

Perhaps the first thread doesn’t have time to finish before the next one starts in async mode? Don’t know why this would affect the filenames though.

Anyway I’l just leave async to its default False value. Works fine that way!

Thanks again!