Click here to Skip to main content
14,236,520 members
Rate this:
Please Sign up or sign in to vote.
See more:
Algorithm to convert a sequence of images to a video file?
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

There is no such single algorithm.

There is a great number of different media container formats, see http://en.wikipedia.org/wiki/Media_container[^]. Now, there is a great number of video compression algorithms and standards, see http://en.wikipedia.org/wiki/Video_compression[^]. Then, most of the media containers can, well, contain, some big subset of different video compression formats, so the number of possible "video file formats" is really big, so nobody even considers this set; everyone works with the combination. Uncompressed video is also possible and is considered as one of the possible compression formats. Finally there are piece of software called codecs, each of them can work with some sub-set of the format, see http://en.wikipedia.org/wiki/Video_codecs#Video_codecs[^]. Don't forget that video files also include audio, and audio is synchronized with video (which is one of the problems, in fact). This also adds to a great number of options.

For a nearly comprehensive set of codec capabilities you can download a freeware product called K-Lite Codec Pack, see http://en.wikipedia.org/wiki/K-Lite_Codec_Pack[^], http://codecguide.com/[^].

But this is only for Windows, and you did not tag your platform. Shame is on you. Don't tell us "Java", this is not enough. (However, why not enough? There are also pure Java codecs, for JMF, see http://jffmpeg.sourceforge.net/[^]. About JMF (Java Media Framework) see http://en.wikipedia.org/wiki/Java_Media_Framework[^]).

For different platforms like Linux, there are also different codecs packs. See http://news.softpedia.com/news/How-to-Install-Multimedia-Codecs-in-Linux-39555.shtml[^].

To close this discussion: you can more or less easily find an application which will solve this problem for you. I did what you want to do using VirtualDub, http://en.wikipedia.org/wiki/VirtualDub[^], VirtualDub, GNU License. It is only for Windows and operates only on AVI files (http://en.wikipedia.org/wiki/Audio_Video_Interleave[^]).

However, if you still want to do it by yourself using Java, first select the standards you want to implement, and go ahead, find the documentation and implement it. My mission was to warn you about the scale of the problem and list what's involved. Maybe the easiest way would be creating your own format and implementing it. Nobody else would be able to use it though, but I'm not sure this is one of your requirements. :-)

—SA
   
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100