Export divx (or even uncompressed video) : any C++ library out there?
category: general [glöplog]
Hi,
I've been using opencv to export demoframes into an avi. For some reasons I don't want to do that anymore, is there an alternative library to use? The C++ library would:
* export a frame into a four-cc compressed or (worst case scenario) uncompressed .avi
* no directX pls.
I've been using opencv to export demoframes into an avi. For some reasons I don't want to do that anymore, is there an alternative library to use? The C++ library would:
* export a frame into a four-cc compressed or (worst case scenario) uncompressed .avi
* no directX pls.
ffmpeg? it's horribly documented but with some examples you might get it working. gcc only, i believe, but i guess you could compile it into a dll (or maybe download one that others already compiled). or a lib, does that work?
ahyes, http://ffmpeg.arrozcru.org/ may be a good starting point.
I'm not sure, but perhaps a look into the sources of DivFix++ might help a bit.
http://divfixpp.sourceforge.net/
http://divfixpp.sourceforge.net/
hmm, it's all getting back now. i believe that in my experience, it was easiest to first convert rgb to yuv yourself, and then pass that to ffmpeg's avcodec_encode_video() function. i can pass some code if ffmpeg is what you want to do and you can't find examples.
thanks. is there something similar on the mac os X for .mov files ?
If you're happy with VFW then there's some example code here: http://www.codeproject.com/KB/security/steganodotnet4.aspx
If you want something non-Windows-specific then just output uncompressed video frames + whatever you use for audio to an AVI container. Creating the chunks and index and whatnot doesn't take much effort. A few hundred lines of code and you're done.
If you want something non-Windows-specific then just output uncompressed video frames + whatever you use for audio to an AVI container. Creating the chunks and index and whatnot doesn't take much effort. A few hundred lines of code and you're done.
Navis: I know this will sound a bit too "d'oh" but, ever thought of checking the sources of .kkapture? It is open-source, and according to its change-log:
Quote:
direct xvid/divx encoding works now.
thanks all. I could use kkapture yes, but I'd like to control it myself from inside the application (and also have something similar on the mac too).
i guess that's why he asked you if you checked the sources. :)
I think you can isolate the part of .kkapture that does exactly that and incorporate into your own code. Refactoring, so to speak.
navis, ffmpeg seems to be able to write mov and it's cross platform.
So is ffmpeg what people on macs use for mov export, or there is another more popular/straightforward solution. FFmpeg looks like a bit of hassle to get to compile/work.
Navis: You know Mac's built-in video codecs include other formats than MOV as well :D. What's this obsession with MOV?
ehm none, I'm new to it and I thought that .mov it is the "lingua franca" for video on macs. Isn't it so ?
Navis: I am a full-time Mac user / coder and I have never heard such a thing. A video is a video. MOV is just a format.
fair enough. Thanks.
Keep in mind that ffmpeg has a viral license, if you care about that shit.
Decipher: I guess you meant "a format is a format, MOV is just a container" right? :)
-I used video for windows to output to an xvid avi. it was ok.
-Sometime later I then used quicktime sdk to do something similar. documentation could have been better, but it was ok after finding relevant sample code.
ffmpeg was awful. hard to get to work under visual studio, and documentation is very lacking. it seems to me the contributors enjoy having their little cult going on over there. complete waste of a good couple of weeks.
hope that´s of some help.
-Sometime later I then used quicktime sdk to do something similar. documentation could have been better, but it was ok after finding relevant sample code.
ffmpeg was awful. hard to get to work under visual studio, and documentation is very lacking. it seems to me the contributors enjoy having their little cult going on over there. complete waste of a good couple of weeks.
hope that´s of some help.
oh, if for some reason you decide to go for ffmpeg, let me just say this to save some of your time:
you can´t compile ffmpeg under visual studio
but, you can get it to work with some libraries produced by gcc. or something like that.
yeah, portable code huh.
you can´t compile ffmpeg under visual studio
but, you can get it to work with some libraries produced by gcc. or something like that.
yeah, portable code huh.
gloom: point. :)
What do you need it for? We use ffmpeg (as in using the commandline binary, so we think we're clear of the gpl virus) by stuffing jpegs down it's pipe and tell it to interpret it as mjpeg. Works pretty nice and we have easy access to all the encoder/format/processing options of ffmpeg.
the kkapture aviwriter is available as a standalone c++ class:
http://www.farbrausch.de/~fg/code/aviwriter/
if that helps.
http://www.farbrausch.de/~fg/code/aviwriter/
if that helps.
Cool thanks, I already worked it out how to do it with vfw.
ffmpeg in commandline is another option, sure. Sounds promising if I can't get it to work on the mac.
ffmpeg in commandline is another option, sure. Sounds promising if I can't get it to work on the mac.