Fabio de Miranda's Library tagged → View Popular
Omnividea FOBS - FFMpeg C++ & JMF Bindings
Fobs4JMF is a JMF PlugIn which allows to use the wide range of formats supported by ffmpeg in your Java applications. It uses the C++ API provided by Fobs and JNI to make it avialable at the Java side. This plugin integrates perfectly in the Java Media Framework, allowing existing and new applications to open and edit video and audio files in all the formats supported by ffmpeg using the standard JMF API.
Transcoding to Different Formats (JMF)
Given an input URL, the object is to transcode the input media to different track formats and generate a resulting file with the transcoded data. The output file could also be of a different content type from the original input.
http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/Transcode.java
Transcoding in JMF
Plugging FMJ decoders and renderers into JMF
Decoders from the FMJ project can be used as plug ins for JMF. But some work is required.
FMJ plug ins do not work out of the box, because JMF is very picky about the format descriptions that a plug in returns to advertise its input/output capabilities.
To get support for PNG-encoded AVI and QuickTime videos in JMF, one can use the FMJ PNGDecoder as a codec plugin. JMF can only build a data flow graph though if one patches the FMJ PNGDecoder and the FMJ ImageIODecoder as follows:
Method PNGDecoder.getSupportedInputFormats needs to return a new VideoFormat(”png “) object so that JMF can associate it with the corresponding “png ” FourCC in the video files. This VideoFormat object can be returned in addition to the PNGFormat object which is already returned.
Method ImageIODecoder.getSupportedOutputFormat needs to return a new RGBFormat(inputCast.getSize(), -1, Format.byteArray, inputCast.getFrameRate(), 24, 16711680, 65280, 255) object, so that JMF can build its flow graph for rendering the video. This RGBFormat object can be returned in addition to the RGBFormat object which is already returned.
To get support for JPEG-encoded AVI and QuickTime videos in JMF, one can use the FMJ JPEGRenderer as a renderer plugin. The following patch is needed in FMJ:
Method JPEGRenderer.getSupportedInputFormat needs to return new VideoFormat(VideoFormat.MJPG, null, Format.NOT_SPECIFIED, Format.byteArray, Format.NOT_SPECIFIED). This is needed, so that JMF can associate it with the “MJPG” FourCC in the video files. Again, this format object can be returned in addition to the one already being returned.
Thanks to these patches, my own little media player MultiShow is now able to play JPEG- and PNG-encoded videos in AVI and QuickTime files.
In case someone is interested in the code. The patched FMJ code is available in the download file of MultiShow.
Posted by werner.randels
Sponsored Links
Top Contributors
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
