Color values getting disturbed while using WMTFX MoveA effect

Topics: Developer Forum, User Forum
Jun 14, 2011 at 10:11 AM
Edited Jun 15, 2011 at 4:28 AM

Hello,

      I want to create a video with series of images where each image should move to & fro in the video panel.

I am using Splicers library. When I tried to create a video of images using WMTFX effects. The output video shows the disturbed colors. I am not getting what is the problem with colors.

Please let me know if anyone has done workaround for the same issue. If the splicer does not support for the "Simple3D" class of WMTFX effects & transitions then please suggest any alternative solution in C#.net code

Code is added as below in my project in StandardTransitions.cs  :



public static readonly Guid WMTFX = new Guid("C63344D8-70D3-4032-9B32-7A3CAD5091A5");

public static TransitionDefinition CreateWMTFX()
{
  var transitionDefinition = new TransitionDefinition(WMTFX);
           
  var param1 = new Parameter("InternalName", "Simple3D");
  transitionDefinition.Parameters.Add(param1);

  param1 = new Parameter("MoveA", "left");
  transitionDefinition.Parameters.Add(param1);

  return transitionDefinition;

}

Thank you.

-- SAJ

 

Jun 14, 2011 at 1:35 PM

See my post here: http://splicer.codeplex.com/discussions/259638

Basically, Splicer doesn't play nice with the "Simple3D" effects library.

What you will need to do is code a pan yourself. Something along the lines of (NOTE: Pseudo-code below):

while (totalDuration < desiredDuration || totalMove < desiredMove){
    Get Moved Image Portion (moveDist)
    Add Image to timeline for (frameTime)
    totalDuration += frameTime
    totalMove += moveDist
}

Again, the above is pseudo-code. You'll have to implement the logic to get the panned image portion and add it to the timeline yourself. HOWEVER, note that using Splicer to do this will drastically increase render time and processor usage. Splicer is great for simplifying the use of DirectShow, however, it may be more efficient to use another method to render your pan effects. You could possibly render the pan effect to an AVI file with something like AVIWriter, and then add it to your Splicer timeline.


Jul 4, 2011 at 11:47 AM

Thanks XGundam05 for pseudo code.

I tried with it, but not succeeded. Found solution in another way that while creating videogroup we have to give the Short BitCount  parameter = 24 as following.

IGroup group = timeline.AddVideoGroup(24, 540, 350)

Previously it was 32 bit, thats why the output video resulting with color distortion when WMTFX effects are applied. Now WMTFX effects are working smoothly with splicer.

 Well, I have another question :

Q : Why the video is having jerk feel effect in between the adjucent images getting rendered.

Is there is any way to minimize this jerk ? Or can we have any code statement in Splicer to manage this somehow ?

The WMTFX transition is applied as following:

//------------------------ Move Left smaller Image -------------------------------
        public static TransitionDefinition CreateWMTFX_Move_SmallerImage(string direction)
        {
            var transitionDefinition = new TransitionDefinition(WMTFX);

            var param1 = new Parameter("InternalName", "Simple3D");
            transitionDefinition.Parameters.Add(param1);

            param1 = new Parameter("InitialScaleA", "0.70");
            transitionDefinition.Parameters.Add(param1);

            param1 = new Parameter("ScaleA", "0.70");
            transitionDefinition.Parameters.Add(param1);

            param1 = new Parameter("MoveA", direction);
            transitionDefinition.Parameters.Add(param1);

            param1 = new Parameter("MoveSpeedA", "0.50");
            transitionDefinition.Parameters.Add(param1);

            return transitionDefinition;
        }

Please let me know about this.

Thank you.

-- SAJ