gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
59 stars 38 forks source link

`writeQuicktime` isn't always lucky, so frames are sometimes out of order #144

Open kklamberty opened 1 year ago

kklamberty commented 1 year ago

We stopped being lucky about the order in which frames were processed for the writing of Quicktime movies. This fix makes it so that the list of frames will be sorted. It makes it so that writing to Quicktime from a movie from the command prompt will include the frames in alphabetical order, which is not ensured by default when we list the contents of a directory.

It turns out we were lucky on the processing order for a long time. I'm not sure if this problem occurs for non-Mac users of if luck continues to prevail for other users.

This fix does not seem to impact the order when using the Write Quicktime button in the movie player, but seems to fix things for writeQuicktime() at the command prompt.

String[] filesArray = dir.list();   // after this line of MovieWriter.java in the getFrameNames() method
Arrays.sort(filesArray);            //   add this line to MovieWriter.java to the getFrameNames() method