Showing posts with label rotate effect. Show all posts
Showing posts with label rotate effect. Show all posts

Sunday, April 22, 2007

perspective effect

We're onto part III of a two part series (ha, ha) on animating a compass-like graphic for use in a video. To sum up: in step one, we grabbed a black and white line drawing from google and did a bit of image cleanup to prepare this transparent image. Then in step two, we rotated the graphic using the rotate effect and automatic keyframing. Now our final step is to add a bit of perspective to turn our rotating compass from a flat, two dimensional image to something much more cool.

So let's get to it! If you have the project from the last blog entry handy, load it up in Cinelerra. You should have one track of the compass graphic with the rotate effect using keyframes applied. Let's make one quick adjustment to the default zoom level so that we can see the entire compass in the compositor. In the compositor, click on the Adjust Camera Automation button:


and set the Z axis to 0.4000:


The output window of the compositor should look something like this:


We have the basic layout ready to go. From the video effects resources, grab the perspective effect and apply it to the entire video track. We'll now set the parameters of the perspective effect. Click on the magnifying glass or right-click and select Show to view the perspective effect configuration screen. It should look something like this:


Now, the point of this exercise is to create the illusion that the compass appears to be rotating right in front of the viewers eyes. This is more difficult to explain than it is to do, so let's just make some changes to the perspective effect options and watch the results in the compositor.

Notice the little pull handles in the four corners of the X/Y graph of the perspective effect. These handles are represented as little circles. With the perspective effect options box centered directly in the middle of your display, pull the lower left handle all the way to the left border of your display. Now pull the lower right handle all the way to the right border of your display. The wider you pull these handles out, the more pronounced the effect, so if you have dual monitors or a really wide (1280 pixels or more) display, the effect will be even better. Once you're done, the graph on the perspective effect box should look something like this:


If you look at the output of the compositor window, it should look like this:


Now close the perspective effect box and playback the video. Note how the perspective effect has given a sense of three-dimesional depth to our simple, two dimensional graphic. Pretty cool, no?

For advanced users, go ahead and use automatic keyframes to zoom in and out on parts of the compass as it rotates. I'll detail that in the next entry.

until next time..good editing to you!

Saturday, April 07, 2007

automatic keyframing and the rotate effect

This is the second part of a two-part blog entry on rotating a transparent png in Cinelerra. Since we have created an interesting transparent gif:
http://crazedmuleproductions.blogspot.com/2007/04/transparent-png-as-rotating-image-on.html

Let's rotate it in Cinelerra!

I will do three things in this post:
1) load my project with only one video track, a static png image pulled to a length of 120 frames
2) apply a rotate effect to the track
3) use automatic keyframes to animate the rotate effect

Now, I must admit that I had misunderstood keyframing in Cinelerra. There are a number of ways to do keyframing, but when you work with effects, you will use automatic keyframing. Do yourself a favor and refresh your memory via the manual:
http://cvs.cinelerra.org/docs/cinelerra_cv_manual_en.html or the wiki:
http://cvs.cinelerra.org/docs/wiki/doku.php?id=english_manual:cinelerra_cv_en_17

First, I create a new project by typing "n" using the following specifications:


After we've loaded the project, we will have three preexisting tracks (two audio and one video track). Moving the cursor over any track and clicking the letter "d" to delete the last track on the timeline. We click "d" three times to delete the tracks.

Now, we load the png image I created in the last post noted above:


However, before we add this image as a new resource, a nice feature of Cinelerra is the ability to import images to a specific length onto the timeline. This is configured in Preferences -> Recording. Don't ask me why it is in the Recording dialog, but therein lies the Images section with one checkbox: "Import images with a duration of ." We will change this value to 4 seconds and click OK:


Now we can append the compass png to a new track by pressing the "o" key to Load a new resource. Before we select our png, we make sure to change the Insertion Strategy to Append in New Tracks:


The png will appear on the timeline with a length of four seconds. From the Resources box, pull a Rotate video effect on top of the track. We should now have a screen that looks like this:


We will now rotate our image. To do this, we will learn how to auto keyframe. For automatic keyframing to work, you first must have the little key icon ("Generate keyframes while tweeking") selected in either the project/timeline view or the compositor:


Once the key icon is lit, we will put the insertion point at equal intervals of 0 frames, 30 frames, 60 frames, 90 frames and 120 frames and set keyframe points. To do this, first move the insertion point to the beginning of the timeline, the 0 frame mark. In order to get frames to be the unit of measure on the time bar, cycle through the different time bar measurement options by clicking Shift-click while your mouse is on top of the time bar. Also make sure that Settings -> Align to Frames is chosen.

Once the insertion point is on our first 0 frame mark, go ahead and click the magnifying glass icon on the Rotate effect. The effect shows default degrees of rotation as well as a custom degree text box. Pivot on X and Y coordinates may be selected, but we will not change these values. Draw pivot simply puts a crosshair on the output.

We will keep it simple and set this first rotation point to 0 degrees:


Have the Compositor window showing while you perform the next few rotate keyframes. Repeat this process of selecting a new insertion point and increasing the rotation. Set the 30 frame mark to 90 degrees, the 60 frame mark to 180 degrees, the 90 frame mark to 270 degrees and the 120 frame mark to 360 degrees. As you change keyframes, you should see the output in the compositor change as well. At the end of the process, you should now have a timeline that looks something like this:


Once all the keyframe points are set, deselect the "Generate keyframes while tweeking" icon. We do this so in case we inadvertantly press a key, we don't start generating keyframes unknowingly. After the keyframes are set, set the insertion point back to the beginning of the timeline by pressing CTRL-left arrow and hit the spacebar to replay.

Et Voila! You should have successfully rotated your image! Thank Cinelerra's interpolation engine for the way that the intervening frames are rendered in the video playback. Nice!

Soon, I will post the rendered result for you to compare your results. And in my next post, we'll apply the perspective effect to make the rotate MUCH cooler!

Friday, April 06, 2007

transparent png as a rotating image for video

So I just watched Casino Royale for the third time and I really dug the GUIs they showed at various times during the film. One of the coolest was a graphic of a compass/altimeter as it focuses in on the compound of a bad guy in the Bahamas. I thought that adding something similar to my videos would be damn cool and should be fairly easy to do with transparent gif and the rotate effect in Cinelerra. I didn't know it, but I was about to get a lesson in automatic keyframing of effects, which I've never done before. But first, I will focus this blog entry on the transparent gif creation.

The plan was to get a gif or jpeg image of a compass, turn the background transparent and colorize the black lines of the compass. Later on, we'll rotate the image and fool with the perspective, like this:
Rotating compass
2.7MB

As I am not a very skilled user with Gimp, I thought I would keep my life simple and grab a black and white graphic of a compass off of the web to use as the image to rotate:


I loaded the image into Gimp. This particular image was already a transparent gif, so that saved me the step of adding an alpha (transparent) layer. I then cropped the image to the desired area by selecting the area I wanted using the Rectangle Select (Free Select). I erased the extra bits around the edges using the Erase with a Fuzzy Circle brush with a diameter of 76 pixels:


The large diameter brush was necessary due to the fact that the image was fairly large (1224x1142).

When I looked at the lines of my "compass", the lines appear fairly thin and weak:


Most likely, they would not show up very well overlayed on a video. So I needed to thicken them up. In order to use most of the filters in Gimp, you need to convert the image to RGB. So, I converted the image from Indexed to RGB using Image -> Mode -> RGB. RGB mode enabled me to try out some filters.

To thicken up the lines of the compass, I first used Filters -> Edge-Detect -> Difference of Gaussians with a Radius 1 of 3 and a Radius 2 of 1 pixels. I deselected the invert checkbox. This thickened the lines nicely, but not enough to really stand out. So after playing with a number of filters, I found the perfect one: Filters -> Edge-Detect -> Neon. I left the Radius at 5 and cranked up the Amount to 1.00 to really fatten up those weak, thin lines:

I needed to select a very bright color that would stand out overlayed on a video. To do this, I needed to select all the areas of the same color and drag my chosen color on top of the selected region. First, I chose Select Regions by Color and clicked on part of the compass. This selected all regions of the same color in the graphic. I then chose a suitably bright color for the new color of the compass (#21f811) and dragged that color from the color selection box on top of the selected region:



Finally, as the Neon effect had made the lines a bit jaggy, I deselected my regions of color (Select -> None) then applied a Gaussian Blur of 1 horizontal and 1 vertical pixel using IIR blur method. This rounded those sharp edges, but tended to mute the colors a bit:


I will try to improve the brightness of the selection by using a Neon gradient. That will be a future entry.

I saved the final image as a PNG:


that Cinelerra could import:


Next: automatic keyframing using the rotate effect!