Encoding audio+video to movie file anno 2012

BlitzMax Forums/BlitzMax Programming/Encoding audio+video to movie file anno 2012

Danny(Posted 2012) [#1]
I know this topic is as popular as it is painful; but what are today's options in BMax if I want to render a sequence to movie file and add my own (synced) audio stream.

My current priority is being able to encode movie files, I don't necessarily need to play them back (yet) - but obviously it would be nice if that would be possible as well..

I'm open to any target movie format, but prefer mp4 files for the moment. I'm also willing to pay (library and or license) where necessary.

I've heard about the Pantson.Theora module, but that doesn't seem to be supported or developed anymore.

Cheers for any feedback!
Danny.


SystemError51(Posted 2012) [#2]
This really is a long shot, but you could use the SavePixmapJPG function, and dump a sequence of jpg images, which you then store in an array, which you then in turn save as binary object (using a TBank).

That way you could read the object again as TBank, and add your own audio stream.

I'm pretty sure this is a pretty ugly trick, but it might just work.


Kryzon(Posted 2012) [#3]
Hi Danny, with the advent of free, complete libraries this task is but a few hours of work interfacing with BlitzMax (which is kinda cheap, given that they work with "Command Line Interfaces").
Couple one of them with that SavePixmapJPG function SystemError51 pointed out and you're golden.

Take a look at FFMPEG:

http://electron.mit.edu/~gsteele/ffmpeg/
http://ffmpeg.org/faq.html#How-do-I-encode-single-pictures-into-movies_003f

FFMPEG can also encode an audio file to a MP4-compatible audio stream.
When you have the encoded video and encoded audio, you can multiplex them together into a MP4 file without the need to re-encode (and optionally add subtitles and other metadata). Encoding takes a while; multiplexing lasts but a few seconds.
(More about this here.)

Last edited 2012


Danny(Posted 2012) [#4]
Wow, thanks guys. FFmpeg indeed seems to be exactly what I need.
Thanks for that!!

Danny