Tuesday, December 07, 2004

TMPEGDisplay

We now have a working simple MPEG movie player in our Croquet Gallery. It would have been very easy to just embed one of the the two morphic players in a TMorphMonitor, but we have decided to go 100% Moph-free wheneven possible. The winning stratagy was to have the player be a subclass of TRectangle with a texture, and the MPEGFile object's videoReadFrameInto on that texture's form.

Interesting/Weird Stuff:
1) The default TMaterial causes my player to be completely invisible. Setting the material's ambiant alpha to 1.0 is a must.

2) The MPEGDisplayMorph has code that looks like it is sync'ing the video with the soundtrack, but it is not. It's just making an estimate based on when the soundtrack started playing & how much time has passed, which is why it does not handle pause. I keep my own starttime & reset it on pause.

3) Squeaks mpeg player seems to choke on some of our mpegs. Chopping them up into smaller segments makes it happier. But chopping involved re-encoding, so who knows.

4) I experimented with rendering the video on render vs step. Putting it in render does get more video frames on the screen (on my computer I average every 3rd frame in step and every 2nd frame in render), but the video is very jittery when done in render, which surprises me. Why would one render cycle take a different amount of time than the next?