Saturday, December 22, 2007

Eliminating shaky frame holds

In a previous blog I mentioned I'd talk about getting good frame holds, so I'd better be true to my word. See my blog about getting good slow motion in Premiere for details on why frame holds can be shaky - I won't duplicate that here.

Shaky frame holds can be a sure sign of amateur work, but it's very easy to fix. The basic rule is this: ALWAYS deinterlace your frame hold clip (field options on the clip). It's now a still shot, so you don't need interlacing, and it can cause shakiness in any area of the frame where details differs from field to field (which is why someone's hand may be shaky in the frame hold when the rest is perfectly still). Some people prefer to simply export the frame and put the still .bmp or .tif on the timeline - that works too.

One other guideline - do not stretch out a frame hold clip by using speed - move the end point instead. Slowing it down too much (even though it's only one frame) can cause Premiere to do wierd things. If you're already at the end of your clip and need it to frame hold for more time, then repeat it - don't stretch the time. If you can't repeat it because you want a consistent zoom/pan across the entire frame hold, then put the individual clips in a separate sequence and then nest the sequence and zoom in on the sequence (which will be one "clip").

One other note - with CS3's time remapping feature, you can now gradually slow the footage down to a still, something I've longed to be able to do inside of Premiere for quite some time. Very cool. The deinterlacing rule still applies on the still frame.

Labels: ,

Monday, November 12, 2007

VOB Files and Adobe Premiere - Editing from DVD

I often find myself being given DVDs as source videos for a project. Whether it's creating a wedding video, a sports highlight film, a tribute video, or some other project, more and more people have their video footage on DVDs (only) these days. Obviously this is not a great situation for editing - the video file has already been compressed, so you've already lost quality to begin with. But the fact is that you have to work with what you've got.

You'd think that getting the files off the DVD to edit in Premiere (or the NLE of your choice) would be simple - copy the VOB files and drop them into Premiere. Oh that life were so simple. Premiere doesn't recognize VOB files. So you rename them to .MPG (or .AVI) and drop them into. That seems to work until you put one on the timeline and get no audio. If the DVD used AC3 as the audio track, then you'll have no audio because you can't bring an AC3 file into Premiere. I wish you could, but you can't - I think it's a copyright thing. Maybe you're lucky and the DVD you have was created using MPEG-1 Layer II as the audio. You drop it on the timeline and get audio but it just doesn't play back very well. Premiere stutters and playback is so bad it's unusable.

I've used a slew of tools to try to make this process easy on me and while there is no "Easy button" I've figured out something that works for me.

Enter VirtualDubMod. You can download it from sourceforge at:
http://sourceforge.net/project/showfiles.php?group_id=65889
Yeah, I know - it hasn't been updated forever, but it still works great. Sure it's not the most user friendly and pretty "open-source-ish" and to be honest I don't know what half of its features actually do, but it's a wonderful tool. The basic idea is that you open each VOB file and save it as an AVI. What? Render each file? That will take forever and gobs of hard disk space! Don't fret just yet, keep reading. (I'll talk using different tools to edit the compressed files later, but I prefer to edit with DV AVI files).

The first thing is getting the files off the DVD. Sure you can just copy them, and most of the time that works (for non-encrypted files) but sometimes it doesn't, you can get very weird results. For best results, I use another great little utility called DVDDecrypter. Its main purpose is really to break the Macrovision (or other) encryption on copyrighted DVDs and let you get at the video files. But that's a legal gray area, and that's not what I actually use it for. Most of the DVDs I'm given to use are not copy-protected. You can download DVDDecrypter from:
http://www.dvddecrypter.org.uk/

Ok, now you've got a bunch of .VOB files on your hard drive. It's time for VirtualDubMod. The first thing is that VirtualDubMod will create uncompressed AVI files. Many people think that's what they want, but actually it isn't. What you want (for optimal editing in Premiere) are DV AVI files, which VirtualDubMod doesn't make (out of the box). You have to get a DV AVI codec, which can be suprisingly hard to find. I use the Panasonic DV codec because it's free and you can download it from:
http://www.free-codecs.com/download/Panasonic_DV_Codec.htm
which also contains instructions on installing it. Once installed, it will show up as an available codec in VirtualDubMod (save as -> select AVI as the file type -> click change button -> select Panasonic DV Codec.) Now you can open the VOB file directly with VirtualDubMod and save it as a DV avi file and bring it into Premiere. Life's getting better (we're not done yet)!

Sometimes I have 10-12 DVDs of a whole football season and I need to make a highlight video. Sometimes the VOB files are little 5 minute clips on the DVD (depending on how it was created), so there are hundreds of VOB files. I don't want to open each one individually and click save as hundreds of times and wait for each file to transcode. Here's where VirtualDubMod gets cool. You can save that task for later, and then run them all at once with "Job Control." Ok, so that's better, but I still need to open the file (which takes a few seconds by itself), click save as, and give it a file name. That can still take forever. This brings me to the real reason I'm writing this article: scripting the VOB to AVI Job Control list for VirtualDubMod.

I wrote a little vbs utility (I know, you PHP and perl gurus out there are gagging) to search through a directory structure, find all the VOB files, and create a job control script that can be opened in VDubMod. (download link below) Ok, now your work flow looks like this:
1 - Use DVDDecrypter to get the VOB files onto your hard disk, in a separate folder for each DVD, all in the same parent folder. (I use two machines for this so I have two going at once, then copy the VOBs over to the same machine later)
2 - Run my script to create the Job Control List for VDubMod
3 - Open VDubMod, load the script, hit start and watch it crank away.
4 - Go to bed. It's going to be awhile. (Or if you have a fancy enough processor do something else while it's processing, like write a blog about it, which is what I'm doing write now. :-) )

Here is the script (lots of programs might complain about you downloading a VBS file, so I've renamed the extension to JRR. Rename it back to VBS after downloading):
createVirtualDubModJobs.jrr

My script is VERY unrefined, as I just created it. I'll probably refine it and upload a better version, but it works. You just need to edit the script and find the variables that set the parent folder for all your VOB files and the destination folder. The script assumes you have one parent folder with one or more subfolders that contain VOB files. Feel free to tweak to your liking.

Yes this will take gobs of hard disk space. Yes you still need to copy all the VOB files from the disks to your computer. Yes you still need to wait for VirtualDobMod to transcode all the VOB (MPEG II) files to DV AVI files.

Can't I just edit the VOB files in Premiere you ask? Yes - sort of. You can get a AVISynth Premiere Plugin, but it's a complicated, laborious process that you can't really script (have to do each VOB one by one). Also, I haven't played with it a lot, but I haven't had much luck getting it to work with Premiere CS3 anyway. If you want to look into it, here's the instructions and all download links for the relevant utilities:
http://www.wrigleyvideo.com/forum/index.php?s=776d0be8c3c99092874bce53a3756694&showtopic=22869

Labels: ,

Monday, June 04, 2007

Slow Motion in Premiere

With the new Premiere CS3, there's lots of talk about using the time remapping feature for variable slow motion (progressively slowing the clip down or speeding it up.) This is something that previously required After Effects, so it's pretty exciting to have that in Premiere. But that's not what I want to write about - I'm more interested in writing about how to achieve good slow motion results in Premiere Pro, especially when dealing with interlaced footage.

As a wedding videographer (and a sports videographer, where this article is even MORE relevant), I use slow motion ALL THE TIME. A little slow motion and the right song can do wonders for otherwise ordinary footage. But sometimes that slow motion causes your footage to become jerky, especially when using very low speeds with interlaced footage. What's the best way to get smooth slow motion (aside from filming at a higher frame rate)? I was struggling with this issue just tonight and came up with what seems (so far anyway - I need to test with more clips) to be a good solution.

First, let me address what is SUPPOSED to work, but doesn't seem to, or doesn't work all that great. First, Adobe will tell you to use the frame blend option. In my tests, this seemed to make little or no difference. Some will tell you to use integer multiples for your speed so that Premiere doubles (or triples, etc.) the frame rate evenly (50% = 2x, 33.33% = 3x, 25% = 4x, etc.). Again, with the particular clip I was having trouble with tonight, that seemed to help a LITTLE, but barely. Then there's always the time remapping feature in After Effects, but I wanted a solution that just uses Premiere. I've also come across suggestions to use the ReelSmart Twixtor plug-in - I haven't tried it - I don't really want to drop several hundred dollars on a plugin just to get good slow motion - shouldn't Premiere be able to handle this natively?

Enter the Posterize Time effect. Generally I've used this effect for slowing down frame rates when I actually want the footage to be jerky. Ever seen those commercials when they want to make something look really bad (like the competitor's product) or news stories about some nefarious scheme and they play footage in black and white with really jerky footage? There are rare occasions (think billion dollar man slomo sequences) where you actually want jerky footage. The plugin is also sometimes used to attempt to make 60i footage look like 24p to achieve a film look.

ANYWAY, I discovered that I can actually use this effect to INCREASE the frame rate of my clip and give me better slow motion. Of course,I'm not literally increasing the frame rate of the source footage - that would require reshooting at a higher frame rate. I'm just "pretending" or telling Premiere that it's a higher frame rate. To be honest, I don't know EXACTLY what Premiere does when you use this filter with a higher frame rate than the source footage, but from my empirical evidence, whatever it does, it works pretty well.

First, I asked myself what Premiere actually has to do to slow down footage. Well, it has to increase the number of frames playing in a given time frame. If I play back my footage at 50%, it needs twice as many frames to make the same clip take twice as long at the same frame rate. The extra frames are accomplished through interpolation. So taken to an extreme, at 10%, each frame would now be doubled 10 times. You can see how this would lead to jerky footage - instead of the picture changing 30 times per second (or each field changing 30 times per second, or 60 times overall, to be more accurate dealing with interlaced footage), the frame will only change 3 times per second. So I came up with this formula, which may be completely baseless, so take it for what it's worth - it just seemed to work. Original FPS / speed = FPS for Posterize Time filter. So my original clip is 30fps, I want to slow it down to 40%. 30 / .4 = 75. I apply the posterize time effect, set the frame rate to 75, and by golly, it looks pretty good. Of course, it still looks pretty good when the fps is set to 30, so the formula really isn't that important, just the concept of using the posterize time effect.

Realistically, I've found that Premiere does slow motion just fine at 50% and above. It's only when you drop below that that you start to have problems...and using progressive footage is a whole different story, as is the definition many consumer camera manufacturers use to define "progressive." The reason I mentioned sports videography at the beginning of this article is because jerky footage (as well as interlacing artifacts) is much worse when there is more action happening in the clip, or when the camera itself is moving quickly. There is more change in the image from frame to frame (or field to field). I've found that as you increase the fps on the posterize time effect, you can end up smoothing the video, but blurring it more, especially for high action shots. The frame blending and interpolation process attempts to sort of take the middle ground when creating extra frames, so when there's greater differences between each frame and each field, those created frames can be quite blurry. When slowing high action shots down to extreme slow speeds, you have a trade off between clarity and smoothness with the posterize time effect.

Related to this article is achieving good frame holds - ones that don't shake violently. That's another topic related to interlacing - maybe I'll address that another time...

Labels: ,

Wednesday, December 20, 2006

An email response: interlacing, aspect ratio, bitrate, etc.

I was recently helping someone with some general video editing questions using Premiere Elements (I use Premiere Pro, and I really don't know Elements that well). I ended up with a pretty lengthy response, so I thought it would be something I could post on this blog, since I hardly ever put anything here.

Original email:

Josh,

My name is ..., I spoke to ... and she said you wouldnt mind giving me some pointers using Adobe Premiere Elements. I was so impressed with the Highlight DVD that you made that I purchased the same camera that ... has and also bought Adobe Premeire Elements.

I tried to burn one of the games just to make sure it was working in "wide screen" but found that the video was very pixelated and rough. I also noticed that even though I formated it for wide screen, it was in 4.3.

I tried to use the Adobe help pages and couldnt find much help. I found a website that said I should make sure the 'average data rate" was the same on the video clip and the DVD project file. The clip is 1.1 MB / second. But I cant find anywhere to adjust that setting the project file.

Your DVD came out so smooth. Should I have bought a different version other than "Elements" or do you think Elements can suffice and theres just some tweeking I need to do.

I am a ... by trade and know how to use a computer but when it comes to graphical design and video rendering, Im kind of and idiot. Any suggestion or information that you could lend would be greatly appreciated. Feel free to reply to this email or call me at ...

******************************

My response:

This is really lengthy, sorry. I keep a blog (which I rarely edit) and thought my response might make good content for it, so that's why this is kind of long.

Premiere Elements is a great program, and what I recommend to most people looking to edit their home videos. I actually use Premiere Pro, which is in some ways similar, but in many ways very different. In addition, I use Premiere Pro to edit, and Encore DVD to actually author the DVD. Because of that, I don't know how much help I can be, but I'll do what I can.

When I create a new project in Premiere, the first screen asks me what type of project it is: NTSC vs. Pal, SD, HD, 4:3, 16:9, etc. It has presets that cover the basics. I edited the football video in a preset called "Widescreen 48khz" which is DV NTSC, 29.97 fps, 720x480 with a 16:9 ratio and a 1.2 pixel aspect ratio (the 48Khz represents the audio sample rate).

Pixelation is generally caused by overcompression, or using too low of a bitrate when transcoding the video to MPEG2. If you are using footage directly from ...'s camera then your source is HD 1080i footage, which has to be downsampled to SD to edit and burn to a DVD (in the next little while we will be able to edit in native HD and burn to either Blu-ray or HD-DVD but for now it has to be downgraded to SD or Standard-def to put on a DVD). However, ... did not give me the native footage, but rather clips burned to DVD using the software that came with the camera. This meant that by the time I got the footage, it was already downgraded to SD and compressed to MPEG2, but it was still great quality. Premiere Pro lets me edit natively in MPEG2, but I get much better performance working with uncompressed AVI files, so I actually took all of her footage and converted it into uncompressed AVI files before working with it. I essentially copied the .VOB files from the DVD and renamed them to .MPG, then transcoded them to uncompressed AVI files. If you look at a video DVD, it will generally have several .VOB files in the VIDEO_TS folder. These are just MPEG2 files with a .VOB extension. You can just copy them to your computer, rename them to .MPG and play them. Unless of course the disc is copy protected, then you have to use decrypting software like DVDDecrypter, but that is another story.

You mentioned that the video on the DVD was smooth - that actually was a bit of work, and I actually thought it could have been a lot smoother. Although ...'s camera is HD, it is still interlaced footage (like almost all consumer camcorders), and by the time I had the footage ready to edit I thought the interlacing artifacts were very distracting. Basically, interlacing is the fact that each frame is actually composed of two fields. One field represents every odd horizontal line of resolution, and the other field the even lines. What happens is when you have quick motion (like football - especially close up shots like ... running down the sidelines right next to the camera) is that the camera captures the first field, then when it gets the second field in the frame, the picture has changed by 1/60th of a second, which doesn't seem like much, but the player has moved ever so slightly from when the first field was captured. This causes interlacing artifacts, particularly along vertical lines. It can make the footage seem very shaky, enough to make you sick in extreme cases (particularly when combined with handheld footage - even the steadiest of hands produce shaky video). By the way, I'm told you did most of the filming of the games. I thought the footage was excellent, and is definitely one of the reasons the final highlight video turned out so good. Professional cameras film in 24p (for progressive), which means that there is 24 frames per second (as opposed to the 29.97 you get in most consumer cameras) and each frame only has one field, so there is no interlacing. A lot of consumer cameras claim to film in "progressive mode" but it is generally not "true" progressive like a professional camera would do, but that's another story. For the football video, I actually deinterlaced all of the footage. This is a trade-off. You trade smoothness for clarity, sort of. Deinterlacing is accomplished in a lot of different ways by different software, but the end result is that both fields in each frame are made to be identical. If you've ever paused a movie and had some part of the picture shake back and forth, that is as a result of interlacing - one field of the frame is in one place and the other field in another place, so it alternates between them when you pause it. Anyway, deinterlacing eliminates that problem and makes the movie much more clear, especially along lines of contrast, but it can make fast motion a bit more jerky, as the advancement from frame to frame can actually become detectable to the human eye - kind of like a little flip book. It especially becomes apparent in slow motion clips. If you look at the slow motion clip of ... (I think it is ...) jumping in the air to catch the ball (I think it is in beginning of "Rock you like a Hurricane") you can visibly detect the advancement from frame to frame. Good slow motion is very hard to achieve without a very nice, true progressive scan camera. The camera you bought actually has a feature to record 12 (I think) seconds of video at a higher frame rate, so that you can do extreme slow motion and still maintain a relatively high frame rate, yielding much better slow motion or stop frames.

Ok, having said all of that (some of which you may already know), let me try and answer your questions a little more specifically. To end up with widescreen footage you want to make sure that your project settings are widescreen, and that when you export it your export settings are also set to widescreen. You can potentially edit in 16:9 and export to 4:3 and vice versa. In Premiere Pro, when you select File -> Export -> Adobe Media Encoder, you get a dialog box that lets you choose from several presets and customize them if necessary. I can verify in this dialog that it is exporting to NTSC DV 16:9. I'm not familiar with the capture process with your camera, but its capture software may also have the option to convert to 4:3 when you pull the footage off the camera.

I can also specify the bitrate in this dialog box. I usually use 7 Mbps, which gives me roughly an hour of content per disc. There is also a generic "quality" setting which refers to lossy compression and should normally be set to 5 (on scale of 1 to 5). If you are encoding to 1.1 Mbps, you are going to get a lot of footage onto one DVD, but it is definitely going to be very pixelated and choppy - the only way to fix that is to increase your bitrate. I think you may be trying to get all the games onto one disc. At full quality, you only get one hour per DVD. The reason Hollywood movies are longer is because they are using 9 GB (roughly) DVD's instead of the 4.7 GB disks available to the general public. Unless you have your movies professionally authored, you can only use 4.7 GB disks. You can get dual layer DVD's and get double the capacity, but they are not going to playback in most DVD players. You can get two hours on a basic 4.7 GB disc using a lower bitrate (like 4 Mbps), and the quality is still somewhat ok. Anything above that and you really start seeing pixelation. It could be that the 1.1 you are referring to of the original clip is actually 1.1 megaBYTES per second, as opposed to 1.1 megaBITS per second. 1.1 MBps (bytes) would be equivalent to 8.8 Mbps (bits) per second. I'm not familiar enough with the camera and capture process to know what kind of clips you are dealing with.

The reason the Adobe help file refers to "average data rate" is because files are often encoded using variable bit rate. Any given portion of the video may be encoded at a different bitrate, depending on how much action and information is in each frame. The average bitrate in megabits per second (mbps) is roughly ((file size in MBytes) / (length in seconds) * 8). You can also use a utility like GSpot Codec Information Appliance (google it for more info) to tell you everything you'd ever want to know about your video file.

I don't think your issue is with using Elements as opposed to some other video editor - it's a matter of determining what type of source clips you are dealing with, what your project and export settings are, and how much you're trying to fit on one disc. Unfortunately I can't tell you exactly how to specify project or export settings in Premiere Elements. But you will at least want to make sure that when you play (in windows media player or whatever) the original clips captured from the camera that they look OK - I'm assuming that they do, otherwise you would have noticed the bad quality when editing them in Premiere.

Anyway, sorry for the novel. Feel free to ask me any follow up or more specific questions - I promise not to be so long-winded!

*************************************
And for anyone reading this blog, feel free to post any further comments, corrections, or clarifications to anything I've said here. I'm always learning from others!



Labels: ,

Sunday, April 30, 2006

Blending two images into each other in Adobe Premier Pro 2.0

I was recently looking for an easy way to do a certain effect in Adobe Premiere Pro 2.0. I figured it out, so I'd thought I'd post my solution. Below is the copy of the post on Adobe's forums.

Link to the movie demonstrating the desired effect

Link to the PSD file used for the image matte

Pasted from Adobe's forum:
I am looking for away to accomplish an effect where I have two images on the screen. One fills the left half, one fills the right half. They blend into each other in the middle. The pictures then each move toward the middle and as they move, they continue to blend into each other. I cannot for the life of me figure out how to accomplish this. I would think you could just take a photoshop document that is half white, half black, blended in the middle, and then apply a luma matte to both images with one of them reversed. The problem with this (and any other type of matte I've tried to make work) is that the matte moves with the image. Any thoughts?

***************

After sleeping on this one I figured out a simple way to do it. Because the image matte moves with any motion keyframes on the image, I put the image in its own sequence, and animated it there. I then placed the image matte on the sequence, and since the sequence has no motion keyframes, the image matte stays put. All that's left is to then put the matte'd sequence on top of the other image that's moving into the center (which doesn't need a soft edge or anything else because the matte'd sequence is on top of it). I've put a sample of what I'm talking about on my blog at:
http://www.beyondpictures.com/blog/bp/2006/04/blending-two-images-into-each-other-in.html

Labels: ,