Jump to content

Batch mode Image Stabilization with VideoPad


Recommended Posts

I'm trying to create a procedure where I can batch mode image stabilize all my videos without having to do them one at a time.  I know how to do batch mode with the the batch mode option but it seems like image stabilization is a separate process.  Any help?  Also when you image stabilize videos it creates a stabilized video in your video directory on your C Drive and I have to delete it periodically once the stabilization is completed otherwise the hard drive will fill up with the stabilized videos that I don't need any more.  Example: if I have a file named "test.mp4" it will create a new file named "test - stabilized.avi"on my video directory on my C Drive.  Once my stabilized video is stored I no longer need this file and it can be deleted.

I am currently using VideoPad full-blown professional version the 7.10 Windows with 16 processors dual Xeon workstation.

Link to post
Share on other sites

Yes I have done that and that does work I can stabilize multiple videos by selecting them in the program.  The problem is I want to do a lot more than just stabilize the videos in a batch process.  2 it leaves stabilized AVI droppings on the C drive and will fill up my SSD hard drive with the stabilized videos.  I know I can do it manual I'm trying to create an automated batch version that does the whole procedure.  I'm trying to basically stabilize videos, do a few other effects, change the audio delay, all in one operation.

Link to post
Share on other sites

It's possible to save effects as a template, to be later applied to multiple clips.  After specifying the effect/s click the SAVE folder in the toolbar (fourth from the left) and name the template.  It will be listed at the bottom of the effects window.  Separate templates can be created for audio and video.

Later, select clips to which the template is to be applied, click VIDEO or AUDIO EFFECTS on the toolbar (not on the clip) and answer yes to the apply to all query.

As for clearing the drive, perhaps a Windows .bat file or other means...

Link to post
Share on other sites

Hi

The stabilization of a clip is done from the Clip bin with  essentially a plug-in third party app from Virtual Dub. It can't be linked to the VP normal effects. The latter can be linked as Borate describes to form a template which can then be saved and applied to multiple clips as though it were a single effect. One possible scenario would be to apply all your effects (e.g. the template) to the desired clips and then create a sequence. After this stabilize the whole sequence. It's not a good workaround however and would take for ever. (Stabilizing can be time consuming.)

Nat

Link to post
Share on other sites

I'm going to experiment with what you guys recommend.  And yes I know stabilization takes for ever and that's why I'm trying to come up with an automated method to stabilize in the background.  That's one of the reasons why I have a workstation with 16 processors.  It seems that VP uses the multithreading well.

As far as clearing the C drive,  A batch file was my idea also.

Link to post
Share on other sites

Let me make sure I understand what you guys are saying.  1) the image stabilization cannot be done as an effect but you can do it by selecting as many clips as you want right clicking and then say stabilize and will all stabilize all of them in order.  It will create a temporary file in the videos directory as an AVI that will have to be later deleted so I have to make sure I don't run out of hard drive space.  It cannot be done as an effect item.  2) I can then create an effects item that can delay the video and do other auto correction of color  and store it as a template.  But since one of the items I want to do is to delay the video by several frames from the audio I will have to do the effect of delaying the video first, then stabilizing everything, and then finally writing my last effects as of post operation template after the image stabilization.  Is that seem to be correct?

Link to post
Share on other sites

A video or audio offset is not an effect.  It's the result of placement on the sequence.

A template of effects can be created and applied in the same manner as single effects are applied.  The template won't include an offset or stabilization.

The process might be along these lines...

1.  Apply effects and/or the templates you have created to the clips on the sequence.

2.  Make the offset adjustments, to bring A/V into sync.

3.  When satisfied, export the sequence as an mp4.

4.  Import the resulting file, which will now be a single clip (discrete original clips are merged).

5.  Right-click in the bin and stabilize the new clip, then add it to the timeline.  This assumes that your intent is to stabilize all the original material.

Use FILE|SAVE PROJECT AS regularly (not FILE|SAVE} and increment its # so as to not overwrite a prior save.  You can then revert, should problems arise.

Link to post
Share on other sites

Hi

 

Point (1) You can stabilize all the videos in the clip bin in one go if required. This is an action separate to adding effects to the clips which can only be done on clips placed on the timeline.

  • Place cursor over the bin and press Ctrl +A. This selects all the clips in the bin
  • Right click one of the selected clips in the bin and select Stabilize Videos from the menu.
  • The clips will be stabilized one at a time and the bin clips will be replaced by a Stabilized version of the same file type.  Copies will also be saved to the designated folder set up under Options/Disk. The original unstabilized clips will not be affected.

Point (2) You can create a Template of multiple effects that can be used on timeline clips or a group of selected timeline clips. Use one of the clips or a dummy clip to set up your template

  • Place the clip on the timeline and add all the effects you require.
  • Once you are satisfied with the result of these multiple effects on this single clip,.....
  • Click the blue Cassette icon tab (4th one along above the effect parameter window) Save as Effect Chain template
  • Give your template a same and save it.
  • Remove the dummy clip from the timeline and add all the stabilized clips for your project from the clip bin
  • Edit as required then select all the clips by placing the mouse on the video track and using Ctrl + A
  • Click the Video Effects tab on the top toolbar (not an FX on the video track)
  • Scroll the effects pane down to Templates.
  • Select your created template. The effects you setup should then be applied to all the selected clips. You may also be prompted for this.

Point (3) Delaying the video is more difficult...(and I am still thing of a way this can be done. Difficult as grouped clips cant be unlinked from their audio as far I know....) I'll have to think about that.

You may have to export all the edited work and then re-import it in order to unlink the sound track and make the required displacement.

Nat

Link to post
Share on other sites

Okay I pretty much understand what you guys are saying now.  I get all the video clips the way I want and then as a separate procedure I can right-click and stabilized all of them at one time and walk away for a long time as long as I have enough computer hard drive space.  I estimate with a machine that I have it's about a 100% time of each video clip at 640x480 on my workstation.  Thanks for your tremendous help.

I think now I'll make a video post about computer resources.

Link to post
Share on other sites

Or, the alternative suggested earlier...

If ALL clips are to be stabilized, export your edited sequence, then import the resultant single clip, and stabilize that clip.  May or may not achieve the desired result, but it's worth a try.

Link to post
Share on other sites

Hi Russ

"... Okay I pretty much understand what you guys are saying now.  I get all the video clips the way I want and then as a separate procedure I can right-click and stabilized all of them at one time ...."

Stabilize all the clips in the bin first.  Then put them on the timeline to edit. Remember you can only stabilize the clips in the bin. You can't stabilize the clips on the timeline. It might seem that you can do this in the order you mention .... editing first and then stabilizing the clips in the bin..... since the bin clips are renamed with "Stabilized" added to their name and the timeline is cleared. However when  the timeline clips  return it appears that they retain their original name...so I am not sure if, in fact they are actually updated..

aa.jpg

I shall have to test this with a shaky clip.

Stabilizing the clips in the bin first and then building the timeline ensures that the correct clips are used.

Nat

Link to post
Share on other sites

You can add effects to a clip by right-clicking it in the bin and choosing effects, then stabilizing and placing the clip on the sequence...

or by applying the effect to the clip that's already on the sequence, then right-clicking it in the bin and stabilizing.

Either way, the sequence clip will have the effect and stabilization.

After stabilizing, the bin clip will be replaced with the stabilized version and the original will vanish, as Nat noted.

Link to post
Share on other sites

Hi

Being a really steady clip that I originally tried out (-_-) , I have done a check on the files that come back to the timeline after stabilization of a really shaky clip.(I  had to get my wife to do one :D)    Although the name does not have "stabilized" added to them if hovered over, like the clip bin files,  they are in fact, stabilized.

Nat

Link to post
Share on other sites

A bit more testing revealed that a clip placed on the sequence after being stabilized displays the "stabilized" label on its sequence clip.

But if the clip is first placed on the sequence, then stabilized - no label.

In either case, a right-click on the sequence clip, then on PROPERTIES lists it as stabilized.

Link to post
Share on other sites

Hi B

"... A bit more testing revealed that a clip placed on the sequence after being stabilized displays the "stabilized" label on its sequence clip."

That would be logical as THAT is the clip being added. It's just an oversight I think that if one does it in the reverse order  the name is not updated with the timeline .The clip info from the hover must come from from a different source. But at least we know now. 

Nat

Link to post
Share on other sites
  • 7 months later...

Okay guys I have pretty good size project that I have to stabilize 100 videos.  I have in the past figured out with the help of you guys here how to stabilize many videos at one time by bringing them in selecting them all and click stabilize.  Then it is a matter of just saving all the files once they are stabilized.  So I really need to figure out a way to batch file the stabilization like we do the other effects in VideoPad.  As I understand, you cannot do stabilization as one of the video effects it's a separate process.  So I want to come up with a way to take the file since they are numbered one to 100 and send them into VideoPad stabilize them and send them on their merry way in another folder.

My thoughts are to start VideoPad with the "-stabilize" option which will bring up the stabilization menu directly.  Now I need to get VideoPad to automatically do the enter button on the "ok" prompt.  Then I need to export the file and quit VideoPad.  Then the Windows batch file can do several things and start VideoPad again with a new file.  I am determined to make this a complete procedure so I don't have to sit there and baby it for 7 days.  Thoughts?

Link to post
Share on other sites

Hi Russ

".... Then it is a matter of just saving all the files once they are stabilized. ....."

The stabilized files are automatically saved to the folder you designate in Options/Disk/Save converted files to..

There are two possible ways to work with this..

  1. Create a folder on the desktop called Stabilized Files
  2. Set the VP Options/Disk/Save converted files  to to your desktop Stabilized Files folder
  3. Load all 100 clips to the clip bin.
  4. Do Ctrl A on the bin to select them all
  5. Right click the bin and select Stabilize Videos
  6. Go and have a cup of coffee B)while VP stabilizes them all.
  7. When complete all the files in the bin will have been labelled stabilized and copies will be in your desktop folder.
  8. Drag files to the timeline for project editing. (Original files remain unstabilized in their original folder.)

Alternatively..

  1. Add the unstablized clips to the clip bin
  2. Drag to the timeline for film editing
  3. When the editing is finished do Ctrl A on the clip bin to select them all
  4. Right click the bin and select Stabilize Videos
  5. Go and have a cup of tea B)while VP stabilizes them all (If there is hundreds then have another cup of tea!)
  6. When complete all the files in the bin will have been labelled stabilized and copies will be in your desktop folder AND all the files on the timeline will have been replaced by the stabilized version. Any edits/effects/titles etc you made will remain unaltered.

It is well to mention that even though you may have stabilized the clips, a very shaky clip may show borders where the shake movement correction moves the frame outside the preset zoom parameters. You will still need to check clips for this (they can be fleeting) and add a further zoom to the clips concerned to eliminate the borders. The stabikize parameters could also be set to different values but these are fairly complicated to set up and it's probably much easier to use the default values set up for this plugin by VP.

Nat

 

Link to post
Share on other sites

Thanks guys, I did figure out that all the stabilized videos are stored in a particular place on the disk using the tools option to change its directory.  And how to change the directory.  I normally put all my stabilized videos on a temporary SSD in a particular directory.  I think I will take your advice and do all image stabilization as one final process and put all the clips into the bin like you talked about and stabilizing at one time.  Then I'll take the entire directory of stabilized files and run through handbrake.  I like handbrake because you can specify exactly encoding level that you want to use and if you want to use H264 or H265.  It also will use all cores for the processing.  I've noted that some of the third-party apps don't use all the cores that they could.

My largest machine has dual Xeon with 8 cores each or 16 cores total and handbrake does use all 16 cores.  In fact do you guys know at what level NCH does a site license?  Right now I have the master cut license for each computer but I'm only one engineer running several machines.

Link to post
Share on other sites
  • 4 weeks later...

@Russ Croucher

As I mentioned in a previous topic , I do something more time saving:

1) Before starting editing , I start stabilizing all videos with a stand alone stabilizer (i prefer ffmpeg its a gnu , free) . Stabilized files get a new name / folder. I prefer ffmpeg than the build in deshaker . I prefer ffmpeg even over Mercalli 4 . For some reason Videopad use pretty old version of Deshake (2.4) . FFmpeg have less borders and better results from both of them (Deshaker 2.4 / Mercalli 4) .

2) At the same time or later or next day or whenever I want I start editing the whole project .

3) If I chose to replace some sections with stabilized ones , I isolate them in a separate clip , and I chose 'Replace Clip File' and I replace them whith the stabilized ones. If the stabilized files are not ready yet I save the project and continue replacing files later or tomorrow ...

4) (Optionally) FFmpeg batch files can be structured like a watchfolder so they can be run in a separate machine in my LAN , so I got 0% CPU consumption in my PC during stabilization (when they run from another PC) .

Here are some batch script I use:

 

@ECHO OFF 
CLS
MD Videos

for %%a in (videos\*.*) do (
    DEL transforms.trf
    ffmpeg -i "%%a" -vf vidstabdetect -f null -
    ffmpeg -i "%%a" -vf vidstabtransform=smoothing=50:crop=keep:invert=0:relative=0:zoom=0:optzoom=2:zoomspeed=0.2:interpol=bilinear:tripod=0 -map 0  -c:v libx264 -preset fast -crf 9 -c:a aac -b:a 192k "videos\%%~na-DONE.mp4" 
    DEL transforms.trf
)

echo
echo
echo "------>>>>>>>>>> J O B  I S  N O W  C O M P L E T E <<<<<<<<<<------"
echo 

PAUSE
EXIT

 

More:

ffqueue gui

 

 

Link to post
Share on other sites
  • 1 month later...

One comment about the license for VideoPad, they have a commercial license and they had to pay for that license that's probably why they're using a very old version. They probably bought the license 10 years ago. I would need to look at the actual license agreement even for the free software to make sure that I can use it commercially. I use VideoPad commercially.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...