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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th November 2002, 12:43   #1  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Q: Would be a VDub trim point converter usefull ?

Hi there,

Iīve written an AVISynth generator like FitCD for my own use. Part of this generator is a VCF (Virtual Dub Config file) to AVISynth Trim Command-converter. What you can do with this ?

Very easy:
1) Edit out all commercials in your captured material using Virtual Dub. This is very comfortable.
2) Saving your cutpoints as VCF file
3) Open the source AVIs with my generator
4) Load the VCF file
5) Tool converts Virtual Dub range settings to AVISynth Trim commands
6) Save the AVISynth script
7) Encode with the encoder of your choice.

Most people here know how to get a speed advantage in Nandub/Virtual Dub with AVISynth with fast recompress but also CCE encoding is much faster with AVS compared to encoding from a VDub frameserver.

I could include the "convert from VCF" function into a small Delphitool. The resulting script could be a base for adding resize, etc.

Question: Would this be of interest ?

Kind regards,
D$
Darksoul71 is offline   Reply With Quote
Old 13th November 2002, 13:28   #2  |  Link
Antti
Registered User
 
Join Date: Oct 2001
Posts: 33
There is a tool for this kind of thing, vcf2avs. I've used it a couple of times.
Antti is offline   Reply With Quote
Old 13th November 2002, 15:13   #3  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Hi Antti,

where can I find vcf2avs ?

-D$
Darksoul71 is offline   Reply With Quote
Old 13th November 2002, 16:44   #4  |  Link
Antti
Registered User
 
Join Date: Oct 2001
Posts: 33
Use Search.
Antti is offline   Reply With Quote
Old 13th November 2002, 16:46   #5  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
There's an easy way:
[list=1][*]Download VirtualDubMod[*]Select the frist range you want to keep[*]Go to the script editor and open your avisynth script (or load the movie via Open via AviSynth)[*]Press Ctrl+T[*]Go to (2) and repeat ...[/list=1]



Cheers
Belgabor
__________________
VirtualDubMod [SourceForge : Tracker/DL] (FAQ, Some rules)
Be sure to also download the latest DLL package or get the all inclusive package!
Before you post questions, please read the VirtualDub and/or VirtualDubMod FAQ.
If you have a bug report or feature request for VirtualDubMod, be sure to read the rules first.
We give 100% of your donations to the Open Source community
Belgabor is offline   Reply With Quote
Old 13th November 2002, 16:56   #6  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
@Antti:
Quote:
Use Search.
Very funny

Both google and lycos didnīt gave any useful links on VCF2AVS.

@Belgabor:
Thanks for pointing out but my tool already does it for me

I was just asking "the public" if it would be useful to release this part of my tool as "standalone". Seems to me itīs not needed.

Fine, this saves me doing unnecessary work

-D$

P.S.: Just to make clear what I was talking of:

This part of a VCF file
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(688,28923);
VirtualDub.subset.AddRange(40720,31518);
VirtualDub.subset.AddRange(75474,58825);
VirtualDub.subset.AddRange(139121,60731);

is converted to this AVS code
Trim(689,29611)+Trim(40721,72238)+Trim(75475,134299)+Trim(139122,199852)

Last edited by Darksoul71; 13th November 2002 at 16:58.
Darksoul71 is offline   Reply With Quote
Old 13th November 2002, 19:30   #7  |  Link
theReal
Piper at theGates of Dawn
 
theReal's Avatar
 
Join Date: Nov 2001
Posts: 2,136
I'd be happy to have an easy standalone tool like that.
I have tried vcf2avs (written by bb), but somehow I couldn't handle the commandline correctly and it was faster for me to write the avisynth code myself. Since then I haven't tried it anymore...

If your tool had an easy GUI for stoopid users like me, it'd be great

btw. I'll also try VDubMod - haven't used it before
__________________
"Under a government which imprisons unjustly, the true place for a just man is also a prison"
Henry David Thoreau, On the duty of civil disobedience, 1849

Last edited by theReal; 13th November 2002 at 19:32.
theReal is offline   Reply With Quote
Old 13th November 2002, 21:02   #8  |  Link
Antti
Registered User
 
Join Date: Oct 2001
Posts: 33
@Darksoul71: I said Search, not search! Hint: doom9 forum search..

@theReal:
vcf2avs has worked great for me. Maybe VirtualDubMod is even better.
Antti is offline   Reply With Quote
Old 14th November 2002, 09:46   #9  |  Link
bb
Moderator
 
bb's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 2,665
Quote:
Originally posted by theReal
I'd be happy to have an easy standalone tool like that.
I have tried vcf2avs (written by bb), but somehow I couldn't handle the commandline correctly and it was faster for me to write the avisynth code myself. Since then I haven't tried it anymore...

If your tool had an easy GUI for stoopid users like me, it'd be great

btw. I'll also try VDubMod - haven't used it before
Well, when I posted my small proggie I asked for some feedback, but I didn't get much... If you'd like to have a GUI, I could make one. I was also thinking of extending the tiny proggie, e.g. to take over some more settings like the resizing.

@Darksoul71:
Feel free to extend your software. I'd appreciate this function in other tools as well. Do you share your tool with us?

bb
bb is offline   Reply With Quote
Old 14th November 2002, 09:59   #10  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
I'll try to improve the VirtualDubMod stuff to import the whole subset as trim statements.
__________________
VirtualDubMod [SourceForge : Tracker/DL] (FAQ, Some rules)
Be sure to also download the latest DLL package or get the all inclusive package!
Before you post questions, please read the VirtualDub and/or VirtualDubMod FAQ.
If you have a bug report or feature request for VirtualDubMod, be sure to read the rules first.
We give 100% of your donations to the Open Source community
Belgabor is offline   Reply With Quote
Old 14th November 2002, 11:59   #11  |  Link
bb
Moderator
 
bb's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 2,665
@Belgabor:
Great, that will make life much easier for all those caputure folks out there (like me...).

bb
bb is offline   Reply With Quote
Old 14th November 2002, 17:32   #12  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
@Antti: Ah, this makes more sense.

@theReal: Iīll release this part of my tool as standalone but remember: Itīs just a converter from VDub selectrange to AVISynthīs Trim. So not the big deal......

@bb:
I might release my tool to public but currently Iīm implementing direct CCE support with the unit Michael provides (see development forum). For releasing I see some problems. Most features donīt selfexplain and my tool is "PAL only". So I would have to write a solid doc for what I currently donīt have the time.

Weīll see. When I reach a stable state and have time to write some docs, may be.....

@Belgabor: I donīt know if this helps and although it doesnīt fit here. Here is the code snippet in Delphi I use to extract and convert the VDub selectrange to AVISynth trim
Quote:
procedure TForm1.ExtractRange(Sender: TObject);
var F : TextFile;
S : String;
I : Integer;
Start,
Duration : String;
Frames : Integer;

Begin
if OpenDialog2.Execute Then
Memo1.Lines.Clear;
Frames := 0;
TrimString.Text := '';
If FileExists(OpenDialog2.Filename) Then
Begin
AssignFile(F, OpenDialog2.FileName);
Reset(F);
while not Eof(F) do
Begin
Readln(F, S);
If (StrLComp(PChar(S), PChar('VirtualDub.subset.AddRange'),26)=0) Then
Begin
S := StringReplace(S,');','',[rfReplaceAll]);
S := StringReplace(S,'VirtualDub.subset.AddRange(','',[rfReplaceAll]);
S := StringReplace(S,',',':',[rfReplaceAll]);
Memo1.Lines.Add(S);
End;
End;
CloseFile(F);

for I := 0 to Memo1.Lines.Count - 1 do
begin
Duration := StrRScan(PChar(Memo1.Lines.Strings[I]),':');
Duration := StringReplace(Duration,':','',[rfReplaceAll]);
Frames := Frames+StrToInt(Duration);
Start := StringReplace(Memo1.Lines.Strings[I],':'+Duration,'',[rfReplaceAll]);
If ( TrimString.Text='') Then TrimString.Text := 'Trim('+IntToStr(StrToInt(Start)+1)+','+IntToStr(StrToInt(Start)+StrToInt(Duration))+')'
else TrimString.Text := TrimString.Text+'+Trim('+IntToStr(StrToInt(Start)+1)+','+IntToStr(StrToInt(Start)+StrToInt(Duration))+')'
end;
End;
End;
PM me if you have any problems here.....

yours,
D$
Darksoul71 is offline   Reply With Quote
Old 14th November 2002, 18:21   #13  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
VCT2Trim Release 1.0

File attached to this post.

Hopefully some mod can set this free.

Put feedback here in the post.

-D$
Darksoul71 is offline   Reply With Quote
Old 26th November 2002, 13:18   #14  |  Link
bb
Moderator
 
bb's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 2,665
Hi Darksoul,

here's my feedback: Your trim values seem to be off by one (one too large). Can you confirm this?

bb
bb is offline   Reply With Quote
Old 26th November 2002, 13:34   #15  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Hi bb,

Iīm not quite shure:

VDub uses 0 for the first frame. AVISynth uses 1.
As I edit out commercials with a few frames "overhead" I never really payed attention to the trim strim being correctly for 100%.

Iīll have a look to this.
What do you mean with "my trim vales are one off" ? Do I trim a frame too much or one to less ?

Anyway, thanks for feedback.

-D$
Darksoul71 is offline   Reply With Quote
Old 26th November 2002, 14:44   #16  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Hi bb,

youīre correct: My generated trim commands are a bit off but I donīt understand why...
Iīve used a 40 min computer show I captured saturday as base. I only trimed of a little bit at the beginning and a little bit at the end.

This is the part of the VCF file:
Virtual Dub Config:
============
VirtualDub.subset.AddRange(549,43168);

This is the Trim command my tool generates:

AVISynth Trim Command:
================
Trim(550,43717)

The duration varies by 4 frames and I donīt understand why !
Duration:
======
VDub (after loading VCF file): 43168
VDub (using AVS Trim command): 43172

Whatīs wrong here ? In VDub the first frame is 0. For AVISynth
itīs 1 AFAIK because 0 is used for begin/end of the movie.
In AVISynth "Trim(0,4000)" will "cut" off the first 4000 frames of a movie.
So I have to add one frame for the first frame of VDubīs config file:
550 instead of 549. After this VDub saves how many frames are used.
(here 43168). So for the trim command I have to calculate the lastframe:
550+43168=43718.

This is one frame less than my tool calculates but with this the AVISynth file
would be one frame longer (= +5 for my AVS compared to the orginal VirtualDub cut points).

Although I have no problems with the trim command being a few frames off this bothers
me because I want the AVS trim points EXACT as the VDub cut points. I canīt see the trees in the wood

-D$

What am I missing here ?
Darksoul71 is offline   Reply With Quote
Old 26th November 2002, 15:36   #17  |  Link
bb
Moderator
 
bb's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 2,665
Quote:
Originally posted by Darksoul71
Whatīs wrong here ? In VDub the first frame is 0. For AVISynth
itīs 1 AFAIK because 0 is used for begin/end of the movie.
In AVISynth "Trim(0,4000)" will "cut" off the first 4000 frames of a movie.
I think here's the error: AviSynth counts from 0 as well, not 1. The 0 has a special meaning only as the second parameter (meaning "till the end").

If you want to cut off the first 4000 frames, the trim command is:
Trim(4000, 0)
(= skip frames 0...3999, start with 4000, till the end).

bb
bb is offline   Reply With Quote
Old 26th November 2002, 17:10   #18  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Hi bb,

you were correct. Iīve change this in my tool and attached the latest version of VCF2AVS_Trim to this posting.

Thanx onces again.

-D$
Darksoul71 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 - 2024, vBulletin Solutions Inc.