JMF Solutions

Rotation Effect

How do you create a custom Effect plug-in and create a Processor that uses the effect? For instance, how do you create a rotation effect on a video track?

An Effect plug-in is similar to a Codec plug-in in terms of number of inputs, number of outputs and functionality. As far as the Processor is concerned, an Effect is treated the same way a Codec is. The main differences are in the way they are registered and their behaviour. Unlike a Codec, an Effect typically does not modify the format of the data. An Effect usually modifies the data bits in some way. For instance, a mirror effect or a mosaic effect.

The RotationEffect class works on 24-bit RGB data. It uses the rotation matrix multiplication formula to rotate and scale the incoming video frames in real-time. It pre-computes sine and cosine values to arrays in order to improve performance.

To make a Processor use this effect you need to instantiate the RotationEffect and set it on a configured Processor's video track. This part is done by the TestEffect sample program.
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
How to run this sample
  1. Download the java sources, compile them and set the CLASSPATH to point to them.
  2. Run TestEffect with a URL in the command line

  3. For example,

    java TestEffect file:/C:/
Source Code
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve

Java 8 banner (182) IoT banner RHS (160)