View Full Version : Q: Would be a VDub trim point converter usefull ?
Darksoul71
13th November 2002, 12:43
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$
Antti
13th November 2002, 13:28
There is a tool for this kind of thing, vcf2avs. I've used it a couple of times.
Darksoul71
13th November 2002, 15:13
Hi Antti,
where can I find vcf2avs ?
-D$
Antti
13th November 2002, 16:44
Use Search.
Belgabor
13th November 2002, 16:46
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
Darksoul71
13th November 2002, 16:56
@Antti:
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
-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)
theReal
13th November 2002, 19:30
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 :D
btw. I'll also try VDubMod - haven't used it before
Antti
13th November 2002, 21:02
@Darksoul71: I said Search, not search! ;) Hint: doom9 forum search..
@theReal:
vcf2avs has worked great for me. Maybe VirtualDubMod is even better.
bb
14th November 2002, 09:46
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 :D
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
Belgabor
14th November 2002, 09:59
I'll try to improve the VirtualDubMod stuff to import the whole subset as trim statements.
bb
14th November 2002, 11:59
@Belgabor:
Great, that will make life much easier for all those caputure folks out there (like me...).
bb
Darksoul71
14th November 2002, 17:32
@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
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
14th November 2002, 18:21
VCT2Trim Release 1.0
File attached to this post.
Hopefully some mod can set this free.
Put feedback here in the post.
-D$
bb
26th November 2002, 13:18
Hi Darksoul,
here's my feedback: Your trim values seem to be off by one (one too large). Can you confirm this?
bb
Darksoul71
26th November 2002, 13:34
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
26th November 2002, 14:44
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 :o
-D$
What am I missing here ?
bb
26th November 2002, 15:36
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
Darksoul71
26th November 2002, 17:10
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$
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.