Recording Movies

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Jonan
Gnoblar
Posts: 11
Joined: Wed Aug 27, 2008 3:49 pm

Recording Movies

Post by Jonan »

Is there something similar to CS's movie recorder plugin in Ogre?

I've been searching but I haven't found it.
Image
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Not that I know of, but then I've always used Fraps so it's never occurred to me to look.

In theory all you need to do is pull down the contents of the surface using HardwarePixelBuffer::blitToMemory and pass the results to whatever encoder you want. Fraps is easier though.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

there is also the open source version of fraps: http://taksi.sourceforge.net
this can be something you release with your application for free if needed (fraps is not free...).
Watch out for my OGRE related tweets here.
Jonan
Gnoblar
Posts: 11
Joined: Wed Aug 27, 2008 3:49 pm

Post by Jonan »

The problem is that they are both Windows-only and a plug-in like CS's could be multi-platform.
Image
User avatar
Gohla
Gnoblar
Posts: 10
Joined: Mon Jun 09, 2008 9:43 pm

Post by Gohla »

Maybe this is something you're looking for: http://sourceforge.net/projects/revel/

You need to compile libcorexvid for it though, I tried compiling it in VC8 and Code::Blocks (windows) but failed...
ppClarity
Gremlin
Posts: 194
Joined: Sat Sep 02, 2006 12:27 am
x 2

Post by ppClarity »

:roll: Another library using the GPL instead of the LGPL. Makes it useless for anything but GPL'd projects. Hrm... a bit of digging looks like this is really the fault of the Xvid codec project: They're intentionally GPL.

*shrugs* their loss.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

You got me in the mode for an experiment; I am going to try to create the plugin you need soon. I will keep you posted.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Can you give me a link to a cross platform video encoding library with lgpl licence that you can feed frames into?
Watch out for my OGRE related tweets here.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Would libtheora do for your purpose? This would mean only one output format, but the library is under BSD license and cross-platform.
http://www.theora.org/doc/libtheora-1.0beta3/

Otherwise, there's FFmpeg and specifically libavcodec, see http://ffmpeg.mplayerhq.hu/ . It's LGPL, should be cross-platform as well.

Personally I have used neither of them, so this is just what came into my mind immediately.
User avatar
Game_Ender
Ogre Magi
Posts: 1269
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Post by Game_Ender »

I have used libavcodec. It works reasonably but the learning curve can be a little high.

Shameless Plug: The onboard videos from our robot (visit my profile link) is recorded with libavcodec and libavformat.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

What about a windows only simple plugin based on this?
Watch out for my OGRE related tweets here.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Post by CABAListic »

Ultimately cross-platform support would be cool, seeing as how Ogre itself is cross-platform. But I figure that once the infrastructure of your plugin is completed, changing the video encoding backend shouldn't be too hard... right? :)
So for the sake of simplicity and a proof of concept do go ahead and use whatever seems good to you.
User avatar
pjcast
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2543
Joined: Fri Oct 24, 2003 2:53 am
Location: San Diego, Ca
x 2
Contact:

Post by pjcast »

Some cross platform encoders off the top of my head (other than GPL stuff):

* Theora - BSD license. Works ok.
* FFmpeg - LGPL. more than a codec, supports many codecs
* GStream - similar to FFmpeg.
* Dirac - I think BSD. Newest Wavelet based codec from the BBC people. Still experimental, but recently reached a 1.0 release (http://diracvideo.org/)
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
ppClarity
Gremlin
Posts: 194
Joined: Sat Sep 02, 2006 12:27 am
x 2

Post by ppClarity »

Assaf Raman wrote:What about a windows only simple plugin based on this?
Adapting FFMpeg's output_example.c seems to be about the same level of complexity. Just need to rewrite get_audio_frame (line 132) and fill_yuv_image (line 306).

Yeah, yeah... go do it myself... Time! Time! My kingdom for a spare day!
User avatar
Azatoth
Gnome
Posts: 327
Joined: Sat Jul 10, 2004 6:46 pm
Location: Sweden
x 4
Contact:

Post by Azatoth »

You might want to look into GLC for inspiration. It's a standalone recorder for Linux systems, just like Fraps, so it's not exactly what you're needing, but it's FOSS and released under a MIT like license, so you could perhaps get some good ideas or code from it.
The main problem with recording live video would be to get a good balance between the size of the final recording and the speed of the compression. Too large recordings and the IO system becomes a bottleneck, and too aggressive encoding and the CPU becomes a bottleneck. I think GLC has hit a nice balance there.
Ember, GPL virtual world client.
Development blog
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

CABAListic wrote:Ultimately cross-platform support would be cool, seeing as how Ogre itself is cross-platform. But I figure that once the infrastructure of your plugin is completed, changing the video encoding backend shouldn't be too hard... right? :)
So for the sake of simplicity and a proof of concept do go ahead and use whatever seems good to you.
This is what I am going to do.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

here is a working plugin. It works well with opengl. d3d9 seems to have an issue with copyContentsToMemory - I guess we should take a look at how taksi does this and see how to do it better.

Only windows for now.

Using - compile then add to Plugins.cfg.

You will see a new screen to select the avi encoder when you start the samples.
Last edited by Assaf Raman on Fri Sep 26, 2008 6:18 pm, edited 1 time in total.
Watch out for my OGRE related tweets here.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Post by Thieum »

Great !
but you use copyContentsToMemory instead of blitToMemory, is there a big difference between the two methods, for example in term of speed ?
(other that it's more convenient to call a method directly on the RenderTarget instead of the HardwarePixelBuffer)
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Here is the final version of the plug-in (for now).

It adds to render system configuration (the one you see at start) the option to create a captured avi file and you can also select the rate of the sample.

The code seems to work better with d3d9 then OpenGL now.

Here is a sample video I captured in real time to AVI with the this plugin (I selected the video codec “Divx ;-) MPEG-4 Fast-Motionâ€
Watch out for my OGRE related tweets here.
User avatar
captnoord
Halfling
Posts: 42
Joined: Wed Apr 30, 2008 11:01 am

Post by captnoord »

Another one to bookmark. I am sure this may come in handy..
To be or not to be that is the question that dazzles us for centuries, now modern science have found the answer: 0x2B | ~0x2B == 0xFF
Image
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

I added my code to the SVN for backup.
https://ogreaddons.svn.sourceforge.net/ ... iUsingVfw/
Watch out for my OGRE related tweets here.
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Post by AshMcConnell »

Fantastic, I'll definitely be using this in the future. I am hoping to be able to render a replay to video in the future (so people can share replays online),

I was hoping to have a small app that takes the replay, runs it through a rendering engine as fast as possible and renders to a video - without displaying the rendered image, just writing it to file.

Assaf, do you think this would be a suitable way of doing it?

Thanks for your hard work!

All the best,
Ash
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

@AshMcConnell: Yes, it will not be hard to mix this code up to get what you need.
Watch out for my OGRE related tweets here.
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Post by AshMcConnell »

Assaf Raman wrote:@AshMcConnell: Yes, it will not be hard to mix this code up to get what you need.
Great!

Thanks again
Ash
Jonan
Gnoblar
Posts: 11
Joined: Wed Aug 27, 2008 3:49 pm

Post by Jonan »

Is this plug-in working on Linux?
Image
Post Reply