Hi everyone,
I'm capturing VHS tapes with Virtualdub (into Loseless HufYuv file). Each tape has multiple events in it, so I have to separate a single big video into multiple smaller videos. I do that with VirtualDub - and because VirtualDub was the only tool I worked with up until now, I also used it to masked overscan noise (basically cropping the bad information on the sides, and applying black boarders around to retain the original resolution. So while saving a single event from a single file - I would have masked it - both on the same run.
However, this had it flaws, because if the video had 5-6 events, I had to do 6 separated actions, because as far as I know - VirtualDub can only cut a single section (you can't select multiple parts and save them all in one go into multiple video files).
I'm working with AviSynth now - and this getting more complex, because while I retain the original resolution of the Loseless files, I crop those on the lossy file. So I find myself playing with crop() command multiple times, until I manage to crop the black bars perfectly. I was wondering if perhaps there's a better way to improve this workflow. Maybe a single AviSynth script that Cut a section from Video file, mask it - save the masked results (keeping huffyuv loseless), and then use the save pixel count used for the masking to crop the file.
Thanks!
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 20 of 20
Thread
-
-
You could add chapter markers into the existing video file. That would let you access each section without having to break up the original capture into multiple smaller videos. I think VirtualdubMod can do this. It is basically the same interface you've already learned, so other than downloading it, there isn't any new work or learning involved.
[edit]I just opened my copy of VirtualdubMod and the Streams --> Video Chapter does what you want. You can add all the chapters at once if you have a file that contains the positions of each chapter you want to add.
[edit2]More info here:
How do I put chapters in an avi file? -
Thank you! I will be checking this! It doesn't solve all the problems I have because some big events like a trip will be across couple of videos (and then I still need to cut them off and re-attach to a big single video). But I will check how chapters work!
I also checking the Trim() method in Avisynth and a way to first save HuffYuv file before the mpeg. -
It should be getting easier.
So I find myself playing with crop() command multiple times, until I manage to crop the black bars perfectly. I was wondering if perhaps there's a better way to improve this workflow.
If you're saying the crop values vary even within the same video, there are ways around that as well.
Maybe a single AviSynth script that Cut a section from Video file...
...mask it...
...save the masked results (keeping huffyuv loseless)
...and then use the save pixel count used for the masking to crop the file. -
Thank you manono. So let's go on the workflow for a second, it might makes more sense:
I have a long sing HuffYuv Loseless file with 3 events on it.
- I need to split it into three parts (so as you suggested, Trim(1, 5), Trim (5,10), Trim (11,20)).
- I want to mask it (so Crop and add borders).
There is where I started to get confused. I have an .avs script with the above information. I should open it the avs script IN VirtualDub? wouldn't "File->Save as Avi" will save a single file and not three, and don't I need it to use Full Recompose because I'm Cropping/adding bars?
Then when I have 3 HuffYuv Loseless Avi files - I want use FFMPEG to create x264 version. It means I need to write a complete new script - don't I? because now what runs the script is FFMPEG and not VirtualDub? And this script will Crop the black bars added during masking - so It means I need to know the specific values used in Masking. I wondered if I can do it all in a single script to save information sharing between two scripts.
Thanks! -
If you wish. Or VDub2. Or, if it's ready for the final encode, in whatever program you like that accepts AviSynth scripts. I use RipBot264 to make MP4s. VDub2 can also encode for your final format. If there's further work to be done than you might want to make another lossless AVI.
wouldn't "File->Save as Avi" will save a single file and not three,
and don't I need it to use Full Recompose because I'm Cropping/adding bars?
...because now what runs the script is FFMPEG and not VirtualDub?
And this script will Crop the black bars added during masking...
...so It means I need to know the specific values used in Masking.
I wondered if I can do it all in a single script...
...to save information sharing between two scripts.
I may not be understanding you clearly, though, and perhaps someone else can answer the questions better. -
-
Code:a = aviSource("E:\a.avi") b = aviSource("E:\b.avi") c = aviSource("E:\c.avi")
Feel free to correct me if I'm wrong
Thanks you both! -
To select segments from a single file, all filtered the same, and append the segments:
Code:AviSource("filename.avi") # get a single source Filters() # whatever filtering you want a = Trim(0, 999) # frames 0 to 999 frames b = Trim(2000, 2999) # frames 2000-2999 c = Trim(5000,0) # frames 5000 to the end a++b++c # append the segments in the order a b c
Code:AviSource("filename.avi") # get a single source a = Trim(0, 999) # first 100 frames b = Trim(2000, 2999) # frames 2000-2999 c = Trim(5000,0) # frames 5000 to the end a = a.Filters1() # Filters1 is symbolic for whatever filtering you want for segment 1 b = b.Filters2() # Filters2 is symbolic for different filtering for segment 2 c = c.Filters3() # Filters3 is symbolic for different filtering for segment 3 c++b++a # append them in a different order
Code:AviSource("filename.avi") # get a single source a = Trim(0, 999) # first 100 frames b = Trim(2000, 2999) # frames 2000-2999 c = Trim(5000,0) # frames 5000 to the end a = a.Filters1() # Filters1 is symbolic for whatever filtering you want for segment 1 b = b.Filters2() # Filters2 is symbolic for different filtering for segment 2 c = c.Filters3() # Filters3 is symbolic for different filtering for segment 3 # select which segment you want to output return(b)
Keep in mind that AviSynth uses the name "last" when you don't specify a stream name. So a sequence like:
Code:AviSource("filename.avi") Filters()
Code:last = AviSource("filename.avi") last = Filters(last) return(last)
-
-
Thank you for confirming it. I wonder:
Code:a = Trim(0, 999) # first 100 frames b = Trim(2000, 2999) # frames 2000-2999 c = Trim(5000,0) # frames 5000 to the end return c
Code:c = Trim(5000,0) # frames 5000 to the end return c
Thank you jgabo and manono. This helped me clear couple of things I wasn't clear about! -
Excuse, the interruption, but I think we're forgetting the changing nature of "Last" in those suggestions.
Shouldn't the trimming be more like:
Code:source = AviSource("filename.avi") # get a single source a = Trim(source, 0, 999) # first 100 frames b = Trim(source, 2000, 2999) # frames 2000-2999 c = Trim(source, 5000,0) # frames 5000 to the end
Scott -
That's a really good suggestions.
I had to learn programming in the 1960s, with paper tape and then, later, cards. With FORTRAN and all those old languages, you had to explicitly declare and type all variables. When implied variables and untyped variables began to appear, it made it easier for really simple programs, but almost always led down paths to puzzling outcomes like what you are pointing out.Last edited by johnmeyer; 4th Oct 2020 at 11:37. Reason: typo
-
-
Last edited by hello_hello; 8th Oct 2020 at 10:28.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Okiba,
The CropResize function in my signature has the ability to clean borders, and it also has a cropping preview if that helps, so you could do something like this to preview the cropping for each segment.
There's three types of cropping preview (CPreview = 1, 2 or 3). The picture below barely needs cropping, but to demonstrate....
The first two numbers are normally used for resizing, hence being zero, and the next four numbers are the usual cropping.
Code:# GCropResize specifies global arguments for each CropResize instance GCropResize(CleanBorders=true, CPreview=1) A = Trim(0,999).CropResize(0,0, 12,4,-8,-2) B = Trim(2000,2999).CropResize(0,0, 12,8,-26,-24) C = Trim(5000,0).CropResize(0,0, 16,4,-8,-12) A ++ B ++ C
[Attachment 55258 - Click to enlarge]
Once you're happy, remove the CPreview argument and CropResize will add borders for the original resolution while placing the picture in the centre.
Code:GCropResize(CleanBorders=true) A = Trim(0,999).CropResize(0,0, 12,4,-8,-2) B = Trim(2000,2999).CropResize(0,0, 12,8,-26,-24) C = Trim(5000,0).CropResize(0,0, 16,4,-8,-12) A ++ B ++ C
[Attachment 55259 - Click to enlarge]
You could also use auto-cropping, in which case the cropping you specify for each CropResize instance would just be any extra cropping required to remove whatever the auto-cropping missed. When auto-cropping is enabled via the global GCropResize function, the same auto-cropping is applied to the whole video. The GCropResize function automatically creates global variables specifying the video dimensions before auto-cropping, so each CropResize instance can still add the borders required to output the original dimensions.
Code:GCropResize(CleanBorders=true, AutoC=true, CPreview=1) A = Trim(0,999).CropResize(0,0, 0,0,-0,-0) B = Trim(2000,2999).CropResize(0,0, 2,2,-4,-0) C = Trim(5000,0).CropResize(0,0, 0,2,-0,-2) A ++ B ++ C
Last edited by hello_hello; 8th Oct 2020 at 11:04.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Ohhh, the preview options looks very cool! Because I don't yet trust Auto-cropping on some videos, this is much more intuitive then trying 20 pixel, see there's still black bar, try 22 pixel etc etc. Thanks!
-
It also has the advantage of not changing the video dimensions while the preview is enabled, so if you're using Trim() to append segments while cropping them differently, you don't have to worry about Avisynth complaining that the frame sizes don't match. And of course once you disable the preview, borders will be added to each segment for the original dimensions, so they'll still be the same.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview)
Similar Threads
-
Erros through the editing process with ffmpeg
By ghostrewel in forum EditingReplies: 0Last Post: 12th Oct 2019, 08:14 -
Process for Ripping DVDs for Editing in Premiere Pro?
By GothPanda in forum DVD RippingReplies: 2Last Post: 17th Dec 2017, 21:47 -
vdub post process - case of slow
By wolfdogg in forum Newbie / General discussionsReplies: 0Last Post: 2nd Dec 2016, 15:41 -
Advice on building PC for Capturing VHS tapes and Editing
By VHS-C98 in forum RestorationReplies: 2Last Post: 16th Dec 2015, 10:19