Jump to content
  • Advertisement
Sign in to follow this  
floatingwoods

OpenGL Simple API to encode movies

This topic is 2494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I am looking for a cross platform (Windows, Mac and Linux) library tat allows me to create movies from my openGL buffer content. It doesn't need to be anything fancy, best would be if I simply had following routines:

- char recorderInitialize(int resolutionX,int resolutionY,cont char* fileAndPath,int framerate);
- char recorderAddFrame(const unsigned char* buffer);
- char recorderEnd();

Of course I could wrap an api into above's routines, but I am at a loss about what API to use.
Any help or hint is greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement
if you just want to capture something, maybe an existing capturing solution would be enough? e.g. FRAPS or http://camstudio.org/ (I don't know if there is something for linux).

otherwise maybe ffmpeg or x264, those are open source, cross platform, but I don't know how simple the interface is

Share this post


Link to post
Share on other sites

otherwise maybe ffmpeg or x264, those are open source, cross platform, but I don't know how simple the interface is

x264 is GPL, so unless he's going to GPL his code or fork over the money for a commercial license it probably won't work.

I'm a maintainer for FFmpeg, and I'll be honest. If you can use it, do. It's awesome. But there's a pretty steep learning curve. FFmpeg is LGPL, so as long as you use dynamic libraries and don't link to any GPL libraries (like libx264), you're fine in terms of licensing.

One option is using Google's VP8 encoder, libvpx. It's completely free and doesn't have any kind of restrictive license (it's a BSD style license). You can use libvpx through FFmpeg, and personally I'm a fan of this idea. The VP8 codec is very competitive to H.264, and it gives good quality and compression ratio.

One thing you'll need to be aware of is the cost of encoding a video. It's a very CPU intensive process. This is one reason why I advocate using FFmpeg in this case: it gives you access to lots of different codecs, and you can easily play around with which ones work for you (in terms of CPU and memory requirements) and which ones don't, without having to change lots of code.

If you go with FFmpeg, you'll pretty much have to create a wrapper that'll do those functions for you. You'll have to setup the encoder, push frames to the encoder and encode them, and then clean up the encoder. It's pretty much a write once, use many times kind of thing. There are samples you can google that'll show you how to setup and initialize FFmpeg, encode a frame, and then clean up FFmpeg. Just write the code in some wrapper functions and then you'll have your easy API that you're asking for. I can help if necessary and answer questions should you have them (as best as I can), but just remember there is a steep learning curve to FFmpeg and you probably won't finish it in a day if you aren't already familiar with video encoding.

Share this post


Link to post
Share on other sites

[quote name='Krypt0n' timestamp='1328806866' post='4911356']
otherwise maybe ffmpeg or x264, those are open source, cross platform, but I don't know how simple the interface is

x264 is GPL, so unless he's going to GPL his code or fork over the money for a commercial license it probably won't work.[/quote]he didn't mention any restriction regarding license, another alternative is to use intel's IPP, it cost something, but is damn fast and it's about a page of code (which can be copied from some tutorial's on intel's site) to create mpeg2/mpeg4/h264 movies.



One option is using Google's VP8 encoder, libvpx. It's completely free and doesn't have any kind of restrictive license (it's a BSD style license). You can use libvpx through FFmpeg, and personally I'm a fan of this idea. The VP8 codec is very competitive to H.264, and it gives good quality and compression ratio.[/quote]I think the main x264 developer disagrees with you about this: http://x264dev.multimedia.cx/archives/377

something to keep in mind is also that, in case the project is distributed as binary, you might need to pay licensing fees to the codec/patent owners.

Share this post


Link to post
Share on other sites

[quote name='Cornstalks' timestamp='1328807768' post='4911361']
[quote name='Krypt0n' timestamp='1328806866' post='4911356']
otherwise maybe ffmpeg or x264, those are open source, cross platform, but I don't know how simple the interface is

x264 is GPL, so unless he's going to GPL his code or fork over the money for a commercial license it probably won't work.[/quote]
he didn't mention any restriction regarding license
[/quote]
I know, I wasn't saying libx264 was a bad suggestion, I just think it's important to make it clear that it is indeed GPL and it's something to be aware of, seeing as most of the projects I've seen on GameDev are not GPL. Maybe I should've said that a little better.


One option is using Google's VP8 encoder, libvpx. It's completely free and doesn't have any kind of restrictive license (it's a BSD style license). You can use libvpx through FFmpeg, and personally I'm a fan of this idea. The VP8 codec is very competitive to H.264, and it gives good quality and compression ratio.

I think the main x264 developer disagrees with you about this: http://x264dev.multi...cx/archives/377
[/quote]
I never said VP8 is better than H.264, I said VP8 is competitive to H.264. The differences between the two are very small in real life.


something to keep in mind is also that, in case the project is distributed as binary, you might need to pay licensing fees to the codec/patent owners.

This is very true, and something worth looking into for your own protection, floatingwoods.

Share this post


Link to post
Share on other sites
Thank you very much for all the replies and detailed information!

I will definetely have a look at ffmpeg and x264. I am open to any solution, also non-free solutions, as long as I don't have to spend one week to have it working on all 3 platforms ;)

Cheers!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!