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. |
4th August 2002, 12:36 | #1 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 2,665
|
Converter for VDub->AviSynth cuts and crops
Hi,
I got bored converting the VirtualDub "AddRange" into AviSynth "Trim" commands, and VirtualDub "SetClipping" into AviSynth "Crop". So I wrote this tiny program to do the work for me. Maybe someone else will find it useful. (see attachment) bb Last edited by bb; 16th January 2003 at 07:42. |
4th August 2002, 12:47 | #2 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 4,454
|
Too bad i can't verify it as this isn't "my" forum
Well, that saves some time, nice job! Regards, Koepi
__________________
Koepi's new media development site |
4th August 2002, 15:20 | #3 | Link | |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
I didn't test it yet, but just by reading the readme:
Quote:
Since avisynth 2.0.? you can use negative values for crop width and height that will be interpreted as distance from the right and bottom border; vdub parameters will map to Crop(x1,y1,-x2,-y2). Maybe we could do the same for Trim, were a negative value would mean 'framecount' instead of 'last frame' ?
__________________
dividee |
|
4th August 2002, 16:47 | #4 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 2,665
|
Thank you for the flowers, Koepi, but this is just a quick'n dirty small CLI. Nothing famous, but I thought I'd share it with you.
@dividee: If you have a 640x576 captured source, and you want to crop let's say 80 pixels from top and bottom, wouldn't the crop statement be: Crop(0, 80, 639, 495) instead of Crop(0, 80, 640, 496)? I think width and height are somehow "zero-based". Please correct me, if I'm wrong (because then I'd quickly change the proggie). Regarding the negative values for the third and fourth parameters, I don't use them, which doesn't hurt and helps the compatibility with earlier versions of AviSynth. I second the idea of modifying the Trim statement's syntax. Keep in mind that "last frame" is "first frame" + "framecount" - 1 (here is it again, the -1). bb Last edited by bb; 4th August 2002 at 16:50. |
4th August 2002, 17:26 | #5 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 4,454
|
the values are correct in vdub and not 0 based.
regards, Koepi
__________________
Koepi's new media development site |
4th August 2002, 17:50 | #7 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 4,454
|
bb,
yes, ex-actly That's how I create my avisynth scripts and this never failed. Regards, koepi
__________________
Koepi's new media development site |
4th August 2002, 18:20 | #9 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
I'll make the change in avisynth:
trim(100,-100) will be the same as trim(100,199) Note that previously you couldn't easily keep only the first frame of a clip, as 0 for lastframe means end-of-clip: trim(0,0) is the same as trim(0,last.framecount-1) With the new syntax you could do it with clip(0,-1).
__________________
dividee |
5th August 2002, 19:07 | #10 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 2,665
|
Another small update: will now put all Trim(...) statements into a single line (otherwise AviSynth won't process it). I'm planning on an auto-insert function which fill fill in a placeholder in an AVS template with the cuts and crops. This way you can create your favourite script, insert a placeholder like <<<cuts/crops>>>, feed this template into vcf2avs, and you're ready to go.
Anybody interested? bb Last edited by bb; 16th January 2003 at 07:41. |
10th January 2003, 19:10 | #12 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 2,665
|
I finally found the time to code a few more lines in C++, so here's the result:
Code:
vcf2avs_gui beta 6 - It recognizes VirtualDub's resize filter and adds a SimpleResize command accordingly. - It has a GUI. Have fun! bb Last edited by bb; 14th January 2003 at 15:58. |
14th January 2003, 07:16 | #13 | Link |
Moderator
Join Date: Oct 2001
Location: Germany
Posts: 2,665
|
There's a bug in vcf2avs_gui beta 6: The last trim command is applied twice for some reason. Just delete the last trim and you're ok. I'll upload a corrected version as soon as possible.
(11 downloads and nobody noticed? Strange...) bb |
16th January 2003, 17:53 | #17 | Link |
Registered User
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
|
Very sweet!
So far I've just read the readme, haven't run it because of a question ... I usually do HDTV caps and keep the ac3 sound, muxing it into the avi after encoding. Then I trim out commercials. However this is a wasteful habit because it means I wait (sleeping) while encoding about 50% more than I need and then throw it away. But the sound has to be added of course before I clip out commercials. I'm not sure how to use vcf2avs and accomplish this. Anybody know? (assuming I still want to keep ac3) Maybe I'm just asking again for direct audio copy in Avisynth, or maybe there is another answer. - Tom |
16th January 2003, 20:50 | #18 | Link | |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Quote:
BTW: the avs editor in DVX (3.0 RC5 can be dowmloaded in the forum) has also a VD to Trim converter, but I think VDMod is the best way to cut, I've coded the converter only to be able to make a comp test after I've cutted with VD 'Dolemite
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
|
16th January 2003, 21:27 | #19 | Link | |
Registered User
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
|
Quote:
I guess the main thing that bothers me is that HDTV caps often can contain enough garbage in them that vdub/avisynth can crash. It is a pain to cut commercials out of a 3 hour movie and then have to do it again. So my main problem is probably just ignorance of vdub. What do you save and load again to have the cuts back so you don't have to cut again on a 2nd try? Is the cut data always saved when you save processing settings? - Tom |
|
16th January 2003, 22:26 | #20 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
VD saves and loads everything except files but they can be opened easily by hand. VDMod saves also audio files. Using delete selection you will find a VirtualDub.subset.AddRange methods for each block in your script.
'Dolemite
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
|
|