JMF Solutions

Accesing Individual Decoded Video Frames
[Pass-through Video Codec]

How to access individual decoded video frames from a Processor while processing the media.  This could be used for scanning the decoded data; computing statistics for each video frame, etc.

There are basically 2 ways to do it: 1) get the data from the output DataSource of the Processor; 2) using a pass-through plugin codec as a callback when individual frames are being processed.

This example will demonstrate the second approach:
  • Build the pass-through codec.  Specify what input format you desire and define that as the Codec.getSupportedInputFormats().
  • Create a processor from the input file.
  • Get the TrackControls from the processor.
  • Set your codec on the video track: TrackControl.setCodecChain(your_codec[]).
That way, your codec's process call will be the "callback" whenever a video frame goes through your plugin.

To require for a specific input to your codec, you can define your codec to support only your desirable type of input.  Then the processor will try its best to construct a data flow path to connect to your codec.
Platform: JDK 1.1.6 or later
JMF API: 2.0 or later
Implementation: AJ, WPP, SPP *

* AJ = All Java, WPP = Windows Performance Pack, SPP = Solaris Performance Pack
Related Classes
How to run this sample
  1. Download the source and compile it.
  2. Run as command line "java FrameAccess <URL>".
Source Code
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Duke's Choice Awards Nomination RHS

VTS OnDemand RHS Banner

Virtual Tech Summit Sept 2015 RHS banner

JavaOne 2014 Replay banner