VideoHelp Forum




+ Reply to Thread
Results 1 to 22 of 22
  1. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Hi there!

    It's probably a lame question but since I just haven't done this before I though to ask beforehand. I need to edit, crop, upscale and upload a video to youtube. I'll edit in Vegas, frameserve to MeGui, add avisynth and out to mp4. So I need to resize/crop snd upscale the file to 1920x1080 (I noticed that anything less for low quality videos and youtube will greatly reduce the quality after their conversion). So my questions are:

    Should I do the resizing/cropping in Vegas and then upscale in Avisynth or just better frameserve it as it is and do the resizing/cropping/upscaling with avisynth?

    And could you suggest a good script for that? I can see that people are suggesting nnedi3 and lanczos/spline for upscaling and resizing. Can you suggest any good settings?

    I will upload a clip if someone would like to check it out. That would be really helpful.

    2008.08.25 test.mpg
    Quote Quote  
  2. Most NLE's (not certain about Vegas) only do simple bicubic resizing. Check if there is a selection for different kinds. Avisynth of course gives you a whole potpourri from bicubic, spline, and lanczos, see the wiki article for more detail: http://avisynth.nl/index.php/Resize. That way you can test to see which one(s) work best on your footage.
    Quote Quote  
  3. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    It's a lot to take on for a start, that's why I asked the question the way I asked it. Anyway, I went as far as I could with my knowledge and here is where I'm stuck right now. I do editing in Vegas and frameserve the file to MeGui. The confusion is how to do the cropping in avisynth? Never done this before and not so much time right at this moment to experiment also. But I want to achieve this since if I send the file into MeGui and do the upscaling there, it's much faster rendering. The original resolution is 720x576. I can crop in Vegas for 1920x1080 upscaling but if I just send the cropped image to MeGui, that is a letterboxed image, then the final image will be streched into HD along with the letterbox. I don't know how to crop in avisynth. Here is my script:

    AVISource("C:\Users\Ashram\Desktop\temp\test.avi",
    audio=false).AssumeFPS(25,1)
    #deinterlace
    #crop
    #resize
    ConvertToYV12(matrix="PC.709", interlaced=false)
    QTGMC(preset="fast", sharpness=0.6, EdiThreads=1)
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=1920, fheight=1080)
    I will also add a Vegas cropped image (that would be nice to do cropping in Vegas, easy to crop there and position the subject to the center), if that is of any help.

    Btw. If I render test clips then at the end there is a clicking sound and the rendered clip start to play from the start, just before ending? Why is that? I have zero latency checked. And the upper and lower horizontal lines or the rendered clip are jagging a little. Why is that? I will add the best render I manage to do at this point (that is upscaled in Vegas, no nnedi3, only qtgmc)
    Image Attached Thumbnails Click image for larger version

Name:	Image2.jpg
Views:	645
Size:	130.2 KB
ID:	34721  

    Image Attached Files
    Last edited by Srivas; 5th Dec 2015 at 13:49.
    Quote Quote  
  4. Maybe something like:

    Code:
    Mpeg2Source("2008.08.25 test.d2v", CPU2="ooooxx", Info=3) 
    dehalo_alpha(rx=2.5, ry=2.5)
    TemporalDegrain(SAD1=75, SAD2=50, sigma=3)
    MergeChroma(last, aWarpSharp(depth=5))
    ChromaShift(c=2)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=960, fheight=720)
    Sharpen(0.2)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1440, fheight=1080)
    Sharpen(0.2)
    Quote Quote  
  5. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Hey Jagabo, thanks! It looks good!

    But what about cropping? I would do Full HD just for the youtube not to degrade the quality and also widescreen looks good. How to achieve that?

    I will definitely have to plunge into studying avisynth. These filters are amazing! And it's free!
    Quote Quote  
  6. You want to crop the top and bottom to make a 16:9 video? Enlarging the cropped frame even more and keeping sharp edges will require more sharpening. But that means noise in the image will be enhanced, so you want stronger noise reduction. Try something like:

    Code:
    Mpeg2Source("2008.08.25 test.d2v", CPU2="ooooxx", Info=3) 
    Crop(0,72,-0,-72) # adjust top and bottom crops to taste
    dehalo_alpha(rx=2.5, ry=2.5)
    TemporalDegrain(SAD1=200, SAD2=150, sigma=8)
    MergeChroma(last, aWarpSharp(depth=5))
    ChromaShift(c=2)
    Sharpen(0.2)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1280, fheight=720)
    Sharpen(0.2)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=1080)
    Sharpen(0.2)
    But I think this is looking pretty "plastic" and over filtered. Maybe a little less noise reduction...
    Last edited by jagabo; 5th Dec 2015 at 12:40.
    Quote Quote  
  7. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Yes, that's what I want but something is wrong here. This is what I'm feeding into Megui:

    Click image for larger version

Name:	1.png
Views:	315
Size:	422.8 KB
ID:	34725

    And this what comes out according to the script:

    Click image for larger version

Name:	2.png
Views:	226
Size:	912.5 KB
ID:	34727

    I just want to remove the letterbox.

    EDIT: The script is proper, I missed the cropping in the script. Now it's ok.

    btw. didn't tweak the sharpening yet.
    Last edited by Srivas; 5th Dec 2015 at 13:52.
    Quote Quote  
  8. Set up your Vegas timeline as a 16:9 square pixel composition, either 854x480 or 720x404. Do all your repositioning within that "cropped" frame and frameserve from there.
    Quote Quote  
  9. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Bingo! Thank you both, you saved my day! That's it!

    I have to say jagabo that the results are much better than I expected as compared with what Vegas can do natively plus noise reduction. How did you learn all this, man??

    Btw. do you mind to explain what's the math behind the resize values in the script? And where does the 720x404 composition come from? I can understand that 172 pixels are cut away but how do you know the size of the letterbox in the first place?
    Quote Quote  
  10. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    And jagabo, I just noticed that you already added cropping in the modified script,
    Crop(0,72,-0,-72) # adjust top and bottom crops to taste
    That would have eliminated the last two posts. Sorry.
    Quote Quote  
  11. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    And just for reference, if that thread might be useful for someone, this is the actual script to get it working as per frameserving from vegas (that means an avi source and required YV12 colorspace).

    AVISource("C:\Users\Ashram\Desktop\temp\untitled.a vi", audio=false).AssumeFPS(25,1)
    ConvertToYV12(matrix="PC.709", interlaced=false)
    dehalo_alpha(rx=2.5, ry=2.5)
    TemporalDegrain(SAD1=200, SAD2=150, sigma=8)
    MergeChroma(last, aWarpSharp(depth=5))
    ChromaShift(c=2)
    Sharpen(0.2)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1280, fheight=720)
    Sharpen(0.2)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=1080)
    Sharpen(0.2)
    Quote Quote  
  12. Not sure if that is correct approach, Jagabo fixes everything in Avisynth, to get
    1440x1080 or 1920x1080 (with Crop(0,72,-0,-72) ) , so he should frame serve original clip, 720x576, he might need to interpret his footage to 4:3 PAL video, right click his clip/properties/Media Tab and set Pixel Aspect Ratio to PAL DV,

    but in his sample, video is flagged as progressive and it seems to be progressive, but he frame serves interlaced video, judging by his script. Jagabo does not deinterlace in his script. So this might need to be straighten up in his Vegas project as well. Vegas should have project properties of the clip, they have to be the same, clip properties (PAL DV but progressive) and projects properties (PAL DV but progressive), if frame serving, this is important.

    Maybe if he fixes his project settings, his clip in Vegas preview window would look correct without interpreting his footage.

    EDIT: sorrry I did not talk to you (Srivas) directly, I thought smrpix input was last in this thread
    Last edited by _Al_; 5th Dec 2015 at 13:46.
    Quote Quote  
  13. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Al, thanks for noticing. I already fixed that in the process. I will edit the above post to make it less confusive. The file is progressive and this is how it's set in the final script.
    And the other point is valid also. Right now cropping is done twice, right? I should have had to post the original clip but I thought it might be easier for me to do the initial cropping in Vegas and just remove the letterboxing in avisynth. But then again, if that would affect the final material, then I will adjust to the learning curve...
    Last edited by Srivas; 5th Dec 2015 at 13:54.
    Quote Quote  
  14. Do not crop in Vegas, because you are frame serving project properties, you'd need to fix even project properties to those values as smrpix suggested, but that would mean Vegas got his hands on video (DV is not square pixel) , and then Avisynth would do it again anyway, I'd just set project as clip (PAL DV but field order changed to progressive) and then use these lines in Avisynth:

    Code:
    Crop(0,72,-0,-72)
    .
    .
    
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1280, fheight=720)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=1080)
    Quote Quote  
  15. Originally Posted by Srivas View Post
    Right now cropping is done twice, right? I should have had to post the original clip but I thought it might be easier for me to do the initial cropping in Vegas and just remove the letterboxing in avisynth. But then again, if that would affect the final material, then I will adjust to the learning curve...
    Technically, you're not really cropping in Vegas right now, you're just adding black bars to the image which need to be cropped out afterwards. That's why I suggested you create your timeline as a 16:9 composition and frameserve an actual (cropped)16:9 signal.
    Quote Quote  
  16. It looks that he had those black bars in Vegas' preview window because his project properties were set wrong. It should be ok now.
    Quote Quote  
  17. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Ok, I got your points. You see, I also did some initial cropping in Vegas. This is how it looks like:

    Click image for larger version

Name:	4.png
Views:	443
Size:	248.5 KB
ID:	34728

    I wanted to position the subject in the center. How can you do the same in avisynth?
    Quote Quote  
  18. do not crop in Vegas but in Avisynth instead of :
    Crop(0,72,-0,-72)
    use something like this:
    Crop(0,36,-0,-108)

    If you'd need to crop differently in every clip in Vegas, THEN you'd need to use Vegas for it, like you just did, keep the same project properties, that is what smprix perhaps think, that would introduce those black borders in Vegas. You'd use the same script in Avisynth (cutting those black borders) But you'd introduce one more resize (bicubic or whatever Vegas uses) in your whole process. And there is one more thing, your video is not square pixel, so you'd cut certain number of pixels that keep real aspect ratio at the end, that is why it is better to leave it all to avisynth. Well in PAL land aspect ratio screw up is not that visible as in NTSC land, so ....
    Last edited by _Al_; 5th Dec 2015 at 14:14.
    Quote Quote  
  19. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Thanks! Just did a comparison and the quality is slightly better also. That just confirms your point.

    Actually I could just render the whole video directly with avisynth now. That's cool!
    Last edited by Srivas; 5th Dec 2015 at 14:19.
    Quote Quote  
  20. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Late in the game, but here's my 2cents:

    Vegas is great for editing, but just like like most NLEs, it is only average as a video processor. That is where AVISynth shines. Let AVISYnth do ALL the cropping, resize, noise reduction & deinterlace. The only downside to using AVISynth is the lack of an interactive GUI to make the adjustments (though AVSPMod can help with that).

    IIWY, I would:
    Edit all natively in Vegas, keeping the project properties the same as the source clips (e.g.: DV-PAL in->DV-PAL out).
    Either export uncompressed/LL or frameserve, to AVISynth.
    In AVISynth, do the Deinterlace, Crop*, Resize*, and NR (I'd do it in that order, even if it isn't as efficient memory-wise), sharpening last.
    That will frameserve/source the MEGUI encode. With it, I'd save to HQ (if CQ/CRF) or high bitrate (if VBR/CBR) AVC (standard YV12 colorspace, standard levels & profiles). Upload that.
    Make it a 1080p60 for uploading. Might even do that trick with resizing (in AVISynth) to UHD (2160p60) to let YT drop it down, as that has been reported to make the resulting HD encodes better.

    Scott

    *Use crop & resize figures that will compensate for the change from non-square pixel to square pixel, as well as accommodate the possible change of Aspect Ratio.
    Quote Quote  
  21. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Not bad 2 cents, Cornucopia!

    I was just wondering why is it that there is no avisynth based NLE out there? I can see some discussion on forums from 2007 but that is like 8 years ago. Is it so difficult to recognize the power of avisynth? Or it's the usual money-makes-the-world-go-round program? Although it would be a money-maker for sure. But then is that against the freeware policies or something? Anyway...

    You made good points, I will go that direction.
    Quote Quote  
  22. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Editors (Linear AND Nonlinear) in their infancy were EDL/script-based. And they were a frickin' pain to work with that way (yes, I've been around long enough to work on CMX A/Broll editors), once you get beyond a dozen clips to manage. Graphical, object-oriented approaches make much better sense work-flow-wise.
    AVISynth is great for processing, but it would be a reversion/devolution to try and shoehorn modern NLEs into AVISynth's structure.
    Someone could make an NLE plugin that does AVISynth processing on selected clips/sequences, but even that isn't easy or without pitfalls (because of the unpredictable open-ended nature of scripting). And of course, it DOES revolve around making money - a venture like integration of AVISynth into NLEs is far from trivial so it would need to be funded, and that changes peoples' motivations.

    Practically speaking, those who use the big NLEs usually fall into the category where the kind of processing work that needs to be done on their clips isn't as drastic as consumer/hobbyists', making AVISynth less necessary (IOW, the clips & the NLE are "good enough"). And then there are those few people & times where LOTS of work needs done to process, and AVISynth is the best at that, but those at least lend themselves to a batch/script-based workflow, so the NLE is less necessary. Only rarely are both essential to a project.

    Scott
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!