Happy Otter Script help for DVD to H.264

MikeLV wrote on 1/29/2019, 2:26 PM

If there's a moderator who wants to delete my other recent post on this topic, please do so.

I have some older video content on DVD (NTSC, 4:3). Need to convert to H.264 to upload to Wistia for streaming video. I don't have the original footage, only the DVD. So I used DVD Decrypter to rip the chapters off, and place them onto the timeline. I have to do this because color and sound corrections are necessary before any encoding.

I don't want black bars on the video, so going to 16:9 is not an option.

Has anyone use HOS to work on this type of footage? If so, what is your best recommendation? I'm brand new to HOS, and there's so many settings, I don't know where to begin, as usual. 😩

Comments

wwaag wrote on 1/29/2019, 4:58 PM

Here's what I'd do assuming that: (1) All you want to do is use HOS for the final render and (2) that your source material coming from DVD is interlaced and you need progressive footage for upload. Is that correct?

If so, load your footage into Vegas and do all of your normal editing. Once you're ready for the final render, launch Render+.

Select the Advanced mode and then Click on the Encoder blue options Gear and you will get this dialog. The settings shown will give your a reasonably high quality render.


Close and then Click on the Avisynth blue options gear and you will get this dialog.

Assuming you want to de-interlace and maintain all of the temporal information, select a preset in the Deinterlacing box--I'd start with medium and leave the Double Frame Rate box unchecked. This is a bug I just discovered. Checking the box will yield the same frame rate while unchecking the box will double it. This will be fixed in the next version release. If you want a 30P frame rate, check the box--if you want 60P (my recommendation), leave it unchecked.

Next, under Frame Size, select 960 x 720 and choose either Lanczos4 or Blackman as the resizer since they are considered better for uprezzing. Click OK to close and then begin the render. The final render will keep your 4:3 aspect ratio with no black bars.

If you have problems, upload a short clip of your footage and I'll take a look. Good luck.

Sorry about the missing images--something is fouled up.

Last changed by wwaag on 2/1/2019, 11:44 AM, changed a total of 11 times.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Former user wrote on 1/29/2019, 5:23 PM

If you look closely, the image is there as a very small box, after the word dialog on the start of the next line, there’s an image upload issue since at least last week, i’ve mentioned it to moderators but got no feedback as to whats wrong and if or when it'll be fixed, maybe they don’t know anything either.

rraud wrote on 1/29/2019, 5:39 PM

Sorry about the missing images--something is fouled up.

Sorry to go off topic but.. The Vegas video website is fouled up, I tried to up-load images a few days ago and got the same result.

vkmast wrote on 1/29/2019, 5:44 PM

Yes. The upload files issues have been reported to admins.

 

Musicvid wrote on 1/29/2019, 5:50 PM

I don't want black bars on the video, so going to 16:9 is not an option

Mike, none of the player options listed on Wistia's site are 4:3, so your source will always play with black side bars, unless you choose to crop from top and bottom.

A number of things about Wistia are raising red flags for me, including wanting 44.1k audio (noncompliant), serving arcane bitrates and resolutions, width-based screen scaling (why?), all make me wonder if they really know what their doing by taking a road less traveled, or if they're just beginners.

They'll learn.

MikeLV wrote on 1/29/2019, 5:56 PM

Musicvid, yes you're right that they don't show any 4:3, however, from testing, I can see that when I upload 4:3, it stays 4:3 so I'm not too worried about that part of it.

wwaag, thanks for the instructions, I'll give them a try and see how I get along. Is there a reason you said to use 960x720 as opposed to 640x480, or 720x540? Just curious. I'll let you know how I make out with your instructions.

Musicvid wrote on 1/29/2019, 6:04 PM

I suggest you upscale vertically as little as needed. 640x480 or 720x540 is what I would do; I'll post a couple of little scripts for you to try.

MikeLV wrote on 1/29/2019, 6:15 PM

And I just realized I can't see your encoder settings because of the image upload issue. I'll check again later to see if it appears.

Musicvid wrote on 1/30/2019, 10:09 AM

See if this passes muster at Wistia. It looks super on my computer.

Use these together. Easy enough to set the size to 720x540 if you want.

Code for NTSC43.avs

SetMemoryMax(1024)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
AVISource("C:\ProgramData\HappyOtterScripts\Magix Vegas Pro\RenderPlus\fs_6688.avi").killAudio()
ConvertToYV12(interlaced=true,matrix="PC.601")
AssumeFPS (30000, 1001)
AssumeBFF()
QTGMC(Preset="Faster", FPSDivisor=2)
LanczosResize(640,480)
Prefetch(4)

Code for NTSC43x264.ccj

avs2pipemod -y4mp <inAVS>  | ffmpeg -y -f yuv4mpegpipe -i -  -itsoffset 0.0444 -i <inTempWav> -map 0:0 -map 1:0  -c:v libx264  -pix_fmt yuv420p -crf 20 -preset veryfast -x264opts tff=0  -movflags +faststart  -c:a aac -b:a 192k  <outFile>.mp4|||ffmpeg -y -i <inTempVideo>  -itsoffset 0.0444 -i <inTempWav> -map 0:0 -map 1:0 -vcodec copy  -c:a aac -b:a 192k  <outfile>
 

 

MikeLV wrote on 1/30/2019, 10:38 AM

Now I see them. Couple of questions: I'm not using Magix Vegas, I'm using Sony. I looked at the folders and my files for HOS appear to be under C:\ProgramData\HappyOtterScripts\Sony Vegas Pro\RenderPlus so I guess I need to change the path? Also, should that fs_6688.avi exist in that folder already, or is that the frame serve file that gets created at the time of encoding?

Last question, how exactly do I use these scripts? I understand I need to copy the code into a file for each of them, but where do I save the script files on the hard drive? Thanks!

Musicvid wrote on 1/30/2019, 10:49 AM

There's an Avisynth scripts folder and Custom Command Lines folder in Render+

Start in Program Data/Happy Otter Scripts.

It's covered in the docs and the UI itself. Sorry, I don't have it on a Sony install.

MikeLV wrote on 1/30/2019, 11:58 AM

Musicvid, here's what your scripts provided:

https://dax702.wistia.com/medias/uu1u89rn51

I think it looks good; it's so hard for me to compare these things though, everything starts looking the same to my eyes after a while. I guess you'd want to see the original DVD video to see how it compares so I'll try to get a clip of that.

wwaag wrote on 1/30/2019, 12:22 PM

@MikeLV

The numbers shown are created at runtime. They enable simultaneous renders from multiple projects.

The script and command line shown by Musicvid are created each time RenderPlus is executed. There is no need to save them unless you want to use a script created by RenderPlus in AviDub. In that case, there is an option to save a script which is then placed in the Avisynth scripts folder.

To duplicate the 640 by 480 output, simply select Custom in the frame size Presets downdown list and then enter 640 and 480. The script shown takes a 60i source and produces a 30P output which essentially throws out half of the temporal information (deletes every other frame) which is OK if there is not a lot of movement. You'll note that the FPSDivisor is 2. If you want smoother motion, choose Double Frame Rate (actually untick the Double Frame Rate box--which is a bug). The produced script will have an FPSDivisor of 1 which keeps every frame. In such cases, a 60i source creates a 60P output. The choice is yours, dependent upon the type of source footage you have.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

MikeLV wrote on 1/30/2019, 1:06 PM

wwaag, not sure what you're referring to about numbers created at runtime? I was able to save the script files to the correct folders and load them from RenderPlus. I think it's good to save them as files because it allows me to use them again and again, which I will.

I changed the FPS divisor to 1, and here is the outcome:

https://dax702.wistia.com/medias/0oq9g04bue

I will also try 720x540 and see if it's any better looking on wistia

MikeLV wrote on 1/30/2019, 1:35 PM

Here's a short clip from the DVD itself in mpg format

https://www.dropbox.com/s/95si7o671lyr7w7/Untitled.mpg?dl=0

Musicvid wrote on 1/30/2019, 1:42 PM

wwaag, not sure what you're referring to about numbers created at runtime? I was able to save the script files to the correct folders and load them from RenderPlus. I think it's good to save them as files because it allows me to use them again and again, which I will.

I changed the FPS divisor to 1, and here is the outcome:

https://dax702.wistia.com/medias/0oq9g04bue

I will also try 720x540 and see if it's any better looking on wistia

MikeLV wrote on 1/30/2019, 10:58 AM

Musicvid, here's what your scripts provided:

https://dax702.wistia.com/medias/uu1u89rn51

I think it looks good; it's so hard for me to compare these things though, everything starts looking the same to my eyes after a while. I guess you'd want to see the original DVD video to see how it compares so I'll try to get a clip of that.

That's as good as it's going to get. HO decombed the guitar strings as well as HB.

It won't look better at 540p, just a little bigger.

wwaag wrote on 1/30/2019, 1:52 PM

@MikeLV

"wwaag, not sure what you're referring to about numbers created at runtime?"

That was in response to a question you posed in a prior post.

"Also, should that fs_6688.avi exist in that folder already, or is that the frame serve file that gets created at the time of encoding?"

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

MikeLV wrote on 1/30/2019, 3:54 PM

Before I move forward with these settings. I'm curious to see how the video would look in the course player, in 16:9 with the black vertical bars to make it perhaps 720p. How would I make the settings in HOS to accomplish that?

MikeLV wrote on 1/30/2019, 4:47 PM

I did just a quick test using render as in vegas to go to 720P. It actually doesn't look that bad. If I could get the black background of the video to match the black color of the black bars it would look better.

wwaag wrote on 1/30/2019, 4:49 PM

At the moment, you can't do this inside of R+. Letterboxing works, but not pillarboxing. I had planned to include that in the last version release, but didn't get it finished. The whole crop dialog in R+ is in need or reworking. Regardless, here's what you can do--simply add the line "AddBorders(160,0,160,0)" to the existing script and save it. Then load as a custom script. Here's the script showing where it should go.

SetMemoryMax(1024)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
AVISource("C:\ProgramData\HappyOtterScripts\Sony Vegas Pro\RenderPlus\fs_5944.avi").killAudio().AssumeFPS (30000, 1001).AssumeBFF()
ConvertToYV12(interlaced=true,matrix="PC.709")
AssumeFPS (30000, 1001)
AssumeBFF()
QTGMC(Preset="Medium", FPSDivisor=1)
LanczosResize(960,720)
AddBorders(160,0,160,0)
Prefetch(4)

Last changed by wwaag on 1/30/2019, 4:50 PM, changed a total of 1 times.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

wwaag wrote on 1/30/2019, 4:51 PM

@Musicvid

Stupid question--how did you enter the code block?

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

MikeLV wrote on 1/30/2019, 5:12 PM

I will give that a try. I notice a few things in your script are different than in the one musicvid provided.

  • You have PC.709. He wrote PC.601
    • Avisynth wiki says:
      Rec.601 should be used when your source is standard definition
      Rec.709 should be used when your source is DVD or HDTV

      The special-purpose matrices PC.601 and PC.709 keep the range unchanged, instead of converting between 0d-255d RGB and 16d-235d YUV, as is the normal practice.

      So what happens if it's both? SD and DVD
  • You have QTGMC preset as Medium, he had Faster

----------

Also, I read this in avisynth wiki:

LanczosResize is a sharper alternative to BicubicResize. It is NOT suited for low bitrate video; the various Bicubic flavours are much better for this.

Lanczos4Resize is a short hand for LanczosResize(taps=4). It produces sharper images than LanczosResize with the default taps=3, especially useful when upsizing a clip.

Since the video looks a little blurry, should I try Lanczos4Resize instead to see if it comes out sharper?

Here is the outcome with:

SetMemoryMax(1024)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
AVISource("C:\ProgramData\HappyOtterScripts\Sony Vegas Pro\RenderPlus\fs_6688.avi").killAudio()
ConvertToYV12(interlaced=true,matrix="PC.601")
AssumeFPS (30000, 1001)
AssumeBFF()
QTGMC(Preset="Faster", FPSDivisor=1)
Lanczos4Resize(960,720)
AddBorders(160,0,160,0)
Prefetch(4)

https://dax702.wistia.com/medias/09q2jqry9o

I don't know if I can even tell a difference between Lanczos and Lanczos4

wwaag wrote on 1/30/2019, 5:41 PM

@MikeLV

"You have PC.709. He wrote PC.601". I forgot to change it in the Avisynth Filter settings dialog. The default is PC.709 since most projects today are HD.

"So what happens if it's both? SD and DVD" Good question. To see if there is a color shift, use VideoScopes. There is an option to add the rendered file back to the timeline. Makes it easy to do such comparisons. Use whichever seems most pleasing to you.

"You have QTGMC preset as Medium, he had Faster". The slower, the better quality. Again, see which setting works best for you.

"Since the video looks a little blurry, should I try Lanczos4Resize instead to see if it comes out sharper?" Try it. It may or may not make a noticeable difference. It will also be a little blurry since you are stretching the frame size. You might try adding a little sharpening at the very end. That should make it appear a little less blurry.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

MikeLV wrote on 1/30/2019, 6:00 PM

So in the end, I will go with these two scripts. The fact that I'm making the video 16:9, does that mean anything should change in the encoder command line, or it can stay the same as it was when I was doing 4:3? I don't know what any of those things in the command line mean, looks way more complicated than the other script!

SetMemoryMax(1024)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
AVISource("C:\ProgramData\HappyOtterScripts\Sony Vegas Pro\RenderPlus\fs_6688.avi").killAudio()
ConvertToYV12(interlaced=true,matrix="PC.601")
AssumeFPS (30000, 1001)
AssumeBFF()
QTGMC(Preset="Fast", FPSDivisor=1)
LanczosResize(960,720)
AddBorders(160,0,160,0)
Prefetch(4)

and

avs2pipemod -y4mp <inAVS>  | ffmpeg -y -f yuv4mpegpipe -i -  -itsoffset 0.0444 -i <inTempWav> -map 0:0 -map 1:0  -c:v libx264  -pix_fmt yuv420p -crf 20 -preset veryfast -x264opts tff=0  -movflags +faststart  -c:a aac -b:a 192k  <outFile>.mp4|||ffmpeg -y -i <inTempVideo>  -itsoffset 0.0444 -i <inTempWav> -map 0:0 -map 1:0 -vcodec copy  -c:a aac -b:a 192k  <outfile>