OT - DeShaker Batch render?

Comments

Laurence wrote on 5/23/2007, 9:43 PM
When I use the Cineform VDub variation, I lose picture quality that I don't lose if I use the uncompressed version then render from there to Cineform. It looks like a colorspace issue, but I'm not sure yet. In any case, the degredation in quality is quite noticable when VDub does the render to Cineform.
johnmeyer wrote on 5/23/2007, 9:44 PM
Also, what would be the correct syntax for setting the VDub compression to the Main Concept DV codec (since I'm sure quite a few of us will want to do exactly that)?

Three different ways to answer this:

1. Read my previous post.

2. Go back to any of the posts that have the newer version (same functionality, but updated readme with instructions which answer your question), download that version, and read the readme file.

3. "dvsd"


Laurence wrote on 5/23/2007, 10:06 PM
Thinking of the dulling of the colors when you choose the Cineform codec in the Deshaker script:

I believe what is happening is that the colorspace is changing when the uncompressed proxy is being passed to Virtualdub. Thus the default "automatic" setting isn't set right.

Is there some way to pass this colorspace setting automatically through another variable?

If not, maybe the following might help:

It looks like if you want to use the Cineform codec, you will need to set the VDub colorspace to one of the 4:2:2 modes. In the Virtualdub vcf file, this seems to be represented by the following line:

VirtualDub.video.SetInputFormat(XX); where the XX default would be "0" and "10" would be the first 4:2:2 mode option.

I believe that somehow this value (or perhaps one of the other options) needs to be passed to VDub in order for it to render to the Cineform codec in the correct color space. I'm looking at the script, but I don't understand the syntax well enough to do this.
johnmeyer wrote on 5/23/2007, 10:19 PM
When I use the Cineform VDub variation, I lose picture quality that I don't lose if I use the uncompressed version

I already covered this in a few of the other posts. As I said there, you need to set the Cineform codec RGB settings manually in VirtualDub. These are saved in the registry somewhere from one session to the next. You do NOT need to edit or do anything further with Vegas or the script.

I have a different version in Cineform, so your mileage may vary, but in my system, I open VirtualDub, select video compression, select the Cineform codec, and then click on the Configure button. Try starting with the settings shown and see what happens. If they don't work, try all four variations of the RGB decode and encode settings.

Again, as I said above, these are remembered from one session to the next, so once you set them, they will always be this way.



Laurence wrote on 5/23/2007, 10:21 PM
Sorry about my lame comments. I just want it to work perfectly and once again I am way behind you.

Edit:

Question: Since both Vegas and VDub use RGB internally anyway, does it make sense to just check the RGB tabs all the time?
johnmeyer wrote on 5/23/2007, 10:34 PM
Question: Since both Vegas and VDub use RGB internally anyway, does it make sense to just check the RGB tabs all the time?

I have no idea.
Laurence wrote on 5/23/2007, 10:40 PM
I just finished a Vegas render with the RGB tabs checked and using the Cineform option within your script, and it looks exactly as it should. This is so wonderful, it's hard to express!
johnmeyer wrote on 5/23/2007, 10:41 PM
I just finished a Vegas render with the RGB tabs checked and using the Cineform option within your script, and it looks exactly as it should. This is so wonderful, it's hard to express!

Have fun.

BTW, here are the strings for some of the other codecs:

// Use one of the following lines instead of line above, for other VirtualDub codecs.
//var VirtualDubCompressor = "cfhd"; // Cineform
//var VirtualDubCompressor = "dvsd"; // MainConcept DV
//var VirtualDubCompressor = "hfyu"; // HuffYUV
//var VirtualDubCompressor = "xvid"; // XviD


Laurence wrote on 5/23/2007, 10:58 PM
I noticed that the audio is still from the original clip, so you kind of need to keep both clips in order for the project to work. Looking at the numbered clips in the Deshaker directory, the audio is offset from the picture. It seems to me like a better approach might be to delay the audio in Virtualdub so that it lines up and then drop that in along with the video. Is that asking too much? I feel like I'm getting so much for free already.

That or if with the take format, that is not possible, just drop the audio from the deshaken clips altogether.
johnmeyer wrote on 5/23/2007, 11:59 PM
I noticed that the audio is still from the original clip, so you kind of need to keep both clips in order for the project to work.

The audio for the second clip is irrelevant. I actually considered turning off audio in VirtualDub to save a little time.

If you ever want to use the clips in some other project, just use the nested VEG feature in Vegas. The deshaken version of the clip, with perfectly synced audio, will instantly be available.

Go the Deshaker site and read the author's musings about this subject (the fact that audio sync is lost once you use the edge compensation).

I just spent the last hour looking into ways to fix this, both in the script and in VirtualDub. Perhaps something will come to me tomorrow. In the meantime, use the nested VEG idea.
Grazie wrote on 5/24/2007, 12:06 AM
Hi Guys!

John, Laurence and I are speaking on SKYPE right now! Wanna join in?

And again - JOHN! - You are brilliant!!

biggrazie

Laurence wrote on 5/24/2007, 12:08 AM
Wierd. In the past I've always just corrected this in VirtualDub using the Audio skew correction available under the audio interleave options. I seem to remember it was like 999 ms or something like that.
johnmeyer wrote on 5/24/2007, 7:23 AM
Laurence (and others):

I looked at the audio offset issue and realized that the original script that I started with always used the audio from the beginning of the project. Thus each event had the same audio. So, just adding an offset in VirtualDub was useless. I realized that you might want to use the video without reference to the original project, so I fixed the script to include the correct audio. However, as pointed out by the Deshaker author, the audio is offset by the amount specified in the edge compensation spec (which is somewhat hard-wired in this script to 30 frames).

Anyway, I fixed the whole thing and uploaded yet another version. You can go back to the original post where I linked to the download and you will find that it now links to the new version:

My Post Where I Link to Yousendit

With this version of the script, please don't change the FILLFRAMES parameter (which specifies how many previous/next frames deshaker will use for edge compensation). There is still one place in the script where I "hard-wired" 30 frames.

I'm linking to that post rather than the Yousendit site in order to reduce the number of links I have to maintain.

I have some fairly serious work that I must complete, and then the Memorial Holiday begins, so unless I broke something, I am finished with this script for awhile.
Marco. wrote on 5/24/2007, 8:25 AM
John, is the deshaker script supposed to work with any Vegas language version?

Marco
johnmeyer wrote on 5/24/2007, 8:51 AM
John, is the deshaker script supposed to work with any Vegas language version?

I have no idea. I don't know how the Sony engineers handle internationalization.

Rather than try to find an answer, why don't you just try it and see if it works?
riredale wrote on 5/24/2007, 9:06 AM
Kudos for all the work and insight you've put into this. All the other NLE guys are going to be wondering where all the Vegas guys got the money to hire SteadiCam operators for their shots.

I'm just finishing up my 2 1/2 hour France Choir documentary (surround sound, HDV widescreen--cool), and several dozen of the shots were "walking" shots, so they each got the DeShaker treatment. This was over the past 2 weeks, so they didn't benefit from your work, but I'll experiment with the script in the near future for later inclusion into my workflow. My only tweak will probably be just to marry it to the M-Jpeg codec I've been raving about recently.

Now go put your feet up and have a glass of wine.
Marco. wrote on 5/24/2007, 9:06 AM
Actually I did, but sorry to say it does not work here. Tried on three different systems. Here's the error message appearing:

Microsoft.Vsa.VsaException: UnknownError (0x801330FF): System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Sony.Vegas.Renderer.get_Templates()
bei JScript 0.Global Code() in Sony.Vegas://Script/__ScriptText__:Zeile 154.
bei Sony.Vegas._Startup.Startup()
bei Microsoft.Vsa.BaseVsaEngine.Run()

Marco
jetdv wrote on 5/24/2007, 9:10 AM
Getting the render template should fail in the international versions. For example, "Video for Windows" is explicitly being used but the french version uses "Vidéo pour Windows", for example. Getting it by GUID (ea9d287b-c85a-11d3-bb3a-0050da1a5b06) would be the same in all versions but you'll still have an issue with getting the template which doesn't have a GUID.
Marco. wrote on 5/24/2007, 9:55 AM
Are the only Vegas render templates used in the script those ones in the User Modification Area?

I modified them to the template name used in my german Vegas version but same error when running the script.

Edit:
I tried in Vegas 6 now which still is an english version. It works fine there. So maybe really a language issue.

Marco
Laurence wrote on 5/24/2007, 11:00 AM
With the latest version, the audio and the video now line up in the take clips stored in the "C:\Deshake" folder. Of course I'm never satisfied though. All it needs to be perfect is to have those pesky first thirty silent black frames removed. Also, the audio on the timeline is still from the original pre-deshaken clip. I wonder if it might be better just to turn the audio off on those clips.

None the less, what an impressive script. The magic it works is just incredible!
Laurence wrote on 5/24/2007, 11:35 AM
OK now this is really cool:

Lets say I have a folder full of Cineform HDV clips that need deshaking and I want to end up with another folder full of exactly the same clips (all perfectly trimmed and with the correct audio attached).

I can do this in two steps:

1/ First drag all the clips to the Vegas timeline, select them and run the Deshaker script (using the Cineform compression option).

2/ Run Gearshift in timeline mode with the proxy type set to "none" and the HD Media type set to 1080i Cineform with the "place in folder" tab checked and the destination set to wherever you want the deshaken files to be.

That's it. Because the Gearshift rendering is smart-rendering, it takes about as long as filecopying.

I just did a folders worth of HDV clips (16 altogether). The entire process took about a half hour (with me away from the PC most of that time) and the clips in the new subdirectory are perfect. That would have taken me hours the old way!
Laurence wrote on 5/24/2007, 11:51 AM
OMG! Now that I have a directory full of clips I can play from media player, I'm looking at them and they look just wonderful. I used a spiderbrace that day and the shake was not horrible but none-the-less, quite annoying. Now they all look like tripod shots. Even that bit of sideways wobble you get with the Spiderbrace is just totally gone. With A-B comparisons between the original and deshaken footage, there is no loss of clarity and just the tiniest bit of extra zoom. It just looks great! What a difference! Yeah I'm happy!
Marco. wrote on 5/24/2007, 12:20 PM
O.k. I found out it's actually only that template name in the User Modifikation Area. But I can't find a way to make it work. If in the script I modify the renderers/template name to what is given in the Vegas render GUI - same error. Maybe a problem with handling foreign charakters like our German "ü"?

Marco

johnmeyer wrote on 5/24/2007, 1:40 PM
O.k. I found out it's actually only that template name in the User Modifikation Area. But I can't find a way to make it work.

You are correct: there is only one line you have to modify. It sounds like you are doing the right thing, but perhaps there is a mistake somewhere along the way. I described yesterday, in another post, the steps to do this. Let me repeat here, with some additional information.

First, here is the code you want to change:

var VegasRenderTemplate : RenderTemplate =
Vegas.Renderers.FindByName("Video for Windows").Templates.FindByName("Default Template (uncompressed)");
(I wrapped that one line to make it easier to read here).

All you need to do is change the FindByName part of the definition. The name you use is the exact name given in the Vegas template area. You can avoid having to type this name by first selecting the template, then selecting the Custom button, and then you can select the preset name at the top of the dialog and press Ctrl-C to copy it. You will see what I mean in the dialog below. It is the top line (where I pasted some fake German text, which is shown selected) that you want to copy. You can copy this text, even if it is from a Vegas preset.



Paste that into the script to overwrite the existing "Default Template (uncompressed)" name.