Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th April 2010, 19:59   #1  |  Link
Cela
Registered User
 
Join Date: May 2004
Posts: 185
How to automate a 'best-of' procedure?

Hollywood makes serveral takes per scene and assembles the movie with a 'best of' each scene. The same is manually possible with VirtualDub.

Based on two versions of an avi, V1.avi and V2.avi, and a cutpoints.txt sheet which containes the frame numbers of the cut/replace-points, Hollywood's 'best of' scheme can be manually done with VirtualDub with a sequence of 'Append Avi segment...' commands from the File menu and concluded with a 'Direct stream copy'-mode 'Save as Avi' command.
The whole procedure sums up to a lossless, direct stream copy of selected frame segments from both V1.avi and V2.avi yielding a 'Best-of-V1&V2.avi'.

The workflow includes first to produce the appropriate avi segments using the cut points information from the cutpoints.txt sheet, then to append these avi segments and finally to save the new avi in 'Direct stream copy'-mode. The 'Direct stream copy'-mode is of great importance for preserving the original quality to the final avi.

It is easy to do it manually, but it quickly becomes boring and is an abundant source for human errors. Thus this is a classical candidate for automation.

One of many good applications for such a procedure would be the smart cleaning of glitches in an avi. For example, with the help of Gavino, a helpful Avisynth expert in this forum, an Avisynth procedure for cleanig duplicate frames is available which produces an cleaned, but recompressed copy of the original avi. It has the advantage that all duplicate frame segments are adequately replaced and it has the disadvantage that the whole avi had to be recompressed in 'Full processing mode'.
The 'best-of' procedure would restore the best of both avis, from the original avi in their original quality the segments which did not need interpolation (~99% of the avi) and the corrected parts which had to be recompressed due to interpolation (~1% of the original avi only but randomly distributed in up to some hundred small, mainly 1-frame spots).

Does anybody know a smart solution?
Cela is offline   Reply With Quote
Old 22nd April 2010, 00:25   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,424
Hello again, cela.

I think this sort of automation might be possible using VirtualDub's own scripting mechanism, but I don't know enough about that to advise you on the details.

However, unless your input source format is key-frame only, replacing individual frames will still require re-encoding of
all affected GOPs (at least).
Gavino is offline   Reply With Quote
Old 23rd April 2010, 17:44   #3  |  Link
Cela
Registered User
 
Join Date: May 2004
Posts: 185
Quote:
Originally Posted by Gavino View Post
Hello again, cela.

I think this sort of automation might be possible using VirtualDub's own scripting mechanism, but I don't know enough about that to advise you on the details.

However, unless your input source format is key-frame only, replacing individual frames will still require re-encoding of
all affected GOPs (at least).
Thanks four your excellent avs solutions for my problem in http://forum.doom9.org/showthread.ph...71#post1391871 how to find and interpolate duplicate frame glitches.

My input source format is key-frame only. I took care of this at recording time to enable frame accurate editing in VirtualDub.

My neighbour, who occasionally does some c++ programming, told me at a beer that he would be able to help me if he had appropriate procedure libraries for VirtualDub, MVTools and Avisynth. And programming examples and docus, i guess. But, I fear he is optimistic because you does not yet know the high sophistication of these advanced tools and what expertise would be needed to use them.

I hope there will be a VirtualDub expert in this forum who will help me with a scripting (or other programming) solution like you did with your avs solutions.

Last edited by Cela; 23rd April 2010 at 17:58.
Cela is offline   Reply With Quote
Old 23rd April 2010, 23:13   #4  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,424
A way to get an understanding of the VirtualDub scripting required is to carry out the process 'manually' (via the UI), then "Save processing settings". This will save a .vcf (script) file which you can then look at to see how to extend for multiple cuts, etc. Based on this knowledge, it may be possible to amend the dup-detection Avisynth script to generate the required .vcf script instead of a simple list of frames.
Gavino is offline   Reply With Quote
Old 24th April 2010, 20:50   #5  |  Link
Cela
Registered User
 
Join Date: May 2004
Posts: 185
Feature request: Cue-list driven append segments from specified avi(s)

@VirtualDub/VirtualDubMod experts and programmers

I have spent a good part of my spare time in last week's evenings (and nights) to manually test

Cue-list driven append segments from specified avi(s)
*********************************************
aiming to produce a realistic best-of compilation.

I may be wrong but these tests lead me to the conclusion that my feature request is more for programming than for scripting.

I assume every one of those superb experts, who are in command of the internals of VirtualDub and VirtualDubMod and keep creating new versions of these fine programs, which humble users like myself deeply admire, would not need as much time to program what would be needed for an elegant solution.

I am convinced that everything what is needed is already coded in VirtualDub/VirtualDubMod in the library routines that support the 'Save as AVI...' and the 'Open Append...' commands. There is not much more to do than these two commands do already.
The only addition is that the execution should be driven not only (as now) by interactive user input but also by batch input of a (user provided) cue-sheet text file.

The main addition to the existing code would be sequentialy reading consecutive lines of the cue-sheet text file and do what the cue-lines asks to be done, to append the so defined cue selections:

Let my contribution be the following
Feature Requirements Specification:
*****************************
User Input:
As input suppose there are 2 (or more) avi clips, v1.avi (the original), v2.avi (the interpolated version or a second take of the avi), etc.
and
a cue-sheet text file 'cues.txt' of the following format:
Example:
Code:
0	413	1
413	472	2
472	1739	1
1739	1764	2
1764	1977	1
...
or mor general:
Each cue line consists of three integer numbers seperated by a tab character (allows copy/paste from an Excel sheet)

sfos<tab>efos<tab>ifv
where
int sfos ... start frame # of selection
int efos ... end frame # of selection
int ifv ... input file version # (1 ... v1.avi, 2 ... v2.avi, ...) to use for the selection defined by this cue-line.

The frame numbering in the above example already takes care of VirtualDub's way of overlaying the end frame of the current clip with the start frame of the appended clip.

Program Processing:
Required processing simply would be to append each selection as if it had been written to disk by 'Save to Avi...' and then read from disk by 'Open append...' (without actually really writing to and reading from disk, of course).

Output:
At the end the final result should be ready to be written by the user by the 'Save as AVI...' command in 'Direct stream copy'-mode to a file 'appened.avi' (or by default into the same directory where input v1.avi is located)..

Expected benefits:
Cue-list driven editing would be so useful and simple. Other freeware, for example Mpeg2Schnitt (for PAL mpeg2 videos), provide even multi-file cue-list creation and multi-file cue-list driven editing for many years!
I wonder why it is not yet included as intrinsic feature in VirtualDub/VirtualDubMod.
It would considerably boost the editing potential and allow user friendly multi-take best-of compilations.

VirtualDub/VirtualDubMod programmers, please consider implementing this feature request.

Last edited by Cela; 24th April 2010 at 20:54.
Cela is offline   Reply With Quote
Old 29th April 2010, 12:21   #6  |  Link
Cela
Registered User
 
Join Date: May 2004
Posts: 185
Quote:
Originally Posted by Gavino View Post
...
I think this sort of automation might be possible using VirtualDub's own scripting mechanism, but I don't know enough about that to advise you on the details....
Hello again, Gavino.
The last few days I travelled the road you adviced me and using what I learned by examples in thread
http://forums.virtualdub.org/index.php?act...=ST&f=5&t=18547
and by reading the old but incomplete VirtualDub scripting language reference, v0.7 (the only reference I found), to express it poetically, I tipped a toe into the wide ocean of the VirtualDub scripting.

Now, I think I know a brute force workaround to accomplisch the 'best-of' automation by VirtualDub scripting and to produce that script with the help of my C# neighbour.
In a couple of days your two avs scripts will be complemented by two C# routines which convert the dups listing from your find_dups avs into a cue-list.txt and the create a VirtualDub script which will write the cue-clips to disk and then read/append from disk to compose the final new.avi.
Though an intrinsic solution withinVirtualDub would be much more elegant and performant, I am very happy to get a good workaround within a few days.

I never would have been able to get as far in such a short time without your help.
Cela is offline   Reply With Quote
Old 4th May 2010, 09:52   #7  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Each "take" in Hollywood is made as a single scene, ie they don't film the entire movie several times, but each scene (which also leads to goofs ). When it comes to assembling, the takes are trimmed (to fit within) and assembled. A good director does not use "blending" or other transitions (a plague for amateur videoediting software) unless s/he wants to use it on purpose.

And there is no software or robot to replace the operator. Imagine StarWars Episode LVII directed by R2D2 ...

You need to do this by hand ... It's not a big work, as you need anyway to screen the files ... most videoediting software, even the entry level ones, let you do this in their timeline.
Ghitulescu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.