Accesing Individual Decoded Video Frames
[Pass-through Video Codec]
|
|
Problem
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.
Solution
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.
|
|
| Requirements |
|
| 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 |
|