Page 1 of 1
Movies Exported from OpenSim 3.3 Take 0 Time
Posted: Sat Oct 10, 2015 1:00 pm
by fregly
When I animate a walking motion in OpenSim 3.3 and then click on the Movie icon to export a movie as a .avi file, OpenSim 3.3 exports the movie, but then when I play it back on my Mac, the total time is 0 seconds.
I have to go back to OpenSim 3.01 to be able to export movies that play back with non-zero total time.
I am running OpenSim (multiple versions) on Windows 7 through Parallels on a Macbook Pro.
Any thoughts on why OpenSim 3.3 and versions after 3.01 export movies lasting 0 seconds?
Thanks!
B.J.
Re: Movies Exported from OpenSim 3.3 Take 0 Time
Posted: Sat Oct 10, 2015 2:40 pm
by aymanh
Hi B.J.,
The story is a bit more complicated, as described here
http://simtk-confluence.stanford.edu:80 ... ing+Movies
The summary is that 32 bit versions will always export movies, while 64 bit versions can export a sequence of snapshots that you'll need to use a third party tool to make a movie (as a workaround).
Please let us know if that's different from the behavior you're observing.
Best regards,
-Ayman
Re: Movies Exported from OpenSim 3.3 Take 0 Time
Posted: Sun Oct 11, 2015 5:07 am
by masterv
Hi Ayman,
Thank you so much. I was having this problem and I used a third party screen capture application to record the simulation videos.
I didn't know about the movie frame capture method.
Thanks
Vishal
Re: Movies Exported from OpenSim 3.3 Take 0 Time
Posted: Mon Oct 12, 2015 12:13 pm
by fregly
Hi Dr. Habib,
Great! Makes total sense now.
Somehow I missed the OpenSim documentation explaining the issue with making movies in 64-bit OpenSim.
I'll install 32-bit OpenSim as well just for making movies in the future. It's good to know about the individual frame export option as well for 64-bit OpenSim.
Thanks for your help!
B.J.
Re: Movies Exported from OpenSim 3.3 Take 0 Time
Posted: Tue Oct 13, 2015 8:53 am
by bradh
Here is some example MATLAB code (I use in a function) to fix the movies produced by OpenSim 64bit. Give it the filename to read, a new filename, and the desired length of the movie.
Code: Select all
filenameIn='test.avi'; %Movie to be read
filenameOut='testNew.avi'; %New filename
desiredDur=1; %Desire Duration in Seconds
mInfo=VideoReader(filenameIn);
fps=mInfo.NumberOfFrames/desiredDur;
vid = VideoReader(filenameIn);
writerObj = VideoWriter(filenameOut);
writerObj.FrameRate = fps;
open(writerObj);
nFrames = vid.NumberOfFrames;
vidHeight = vid.Height;
vidWidth = vid.Width;
mov(1:nFrames) = struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),'colormap', []);
for k = 1 : nFrames
mov(k).cdata = read(vid, k);
writeVideo(writerObj, mov(k).cdata);
end
close(writerObj);
Re: Movies Exported from OpenSim 3.3 Take 0 Time
Posted: Tue Oct 13, 2015 11:16 am
by aymanh
Brad,
Thanks much for sharing this code, I'm sure it'll come in handy for many of our users on 64 bit machines.
Best regards,
-Ayman