VideoHelp Forum




+ Reply to Thread
Results 1 to 15 of 15
  1. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    After many years of trial and error, someone on here taught me how to deinterlace my uncompressed AVIs using AviSynth. It's for the purpose of capturing VHS.

    It's the best result I've found so far.

    I want to compress to MP4 but I'm unsure how much quality I'm losing whilst trying different settings in Davinci Resolve, Handbrake & VidCoder.

    If there's a thread here, or maybe a process somebody could share using virtualdub or ffmpeg perhaps, I'd be really grateful.

    I'm hoping to keep the file size down, whilst retaining as much audio and video quality as possible. In Davinci Resolve they average around 20GB per file, (3 hours video, from a lossless AVI of about 600GB after deinterlacing). I've really tried hard using Davinci & it's the best I can achieve. I managed to do well with Handbrake, but without trial & error with as many combinations as I can attempt, it's a bit of a minefield as is ffmpeg too.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Since you have an AVS script to manipulate and frameserve your source, why don't you just encode it in vdub2?

    What trial and error are you referring to? Just pick the preset (medium or slow) and the CRF, 16 - 22 for x264
    Quote Quote  
  3. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Dave, don't forget the SAR...
    Quote Quote  
  4. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    If it's SD (720x576, 720x480), shoot for around an average bitrate of 6000kbps max. You can either set the bitrate or use CRF, which most people use, as Dave suggested.

    from a lossless AVI of about 600GB after deinterlacing
    I think you must have captured "uncompressed". "Compressed" Lossless with the usual codecs (HUFFYUV, UTVideo, Lagarith) is roughly 40GB per hour, doubled after double-rate deinterlacing.
    Quote Quote  
  5. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by Neil-Betamax View Post
    I want to compress to MP4 but I'm unsure how much quality I'm losing whilst trying different settings in Davinci Resolve, Handbrake & VidCoder.

    If there's a thread here, or maybe a process somebody could share using virtualdub or ffmpeg perhaps, I'd be really grateful.
    Once you have your final .avs script you can simply run a cmd line:

    Code:
    ffmpeg.exe -i <input>.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k <output>.mp4
    If after processing for whatever reason your source is a video file, use it as input
    Quote Quote  
  6. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Thanks for the help everyone, I've been away from home for a few days but just letting you all know I appreciate your help very much.
    I'll get onto trying out these suggestions when I return in a couple of days, thanks again!
    Quote Quote  
  7. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Thanks Lollo, & especially for helping me get this far with deinterlacing.

    Since I'm so new to coding in general, I lack most basic understanding.

    [/QUOTE]

    Once you have your final .avs script you can simply run a cmd line:

    Code:
    ffmpeg.exe -i <input>.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k <output>.mp4
    If after processing for whatever reason your source is a video file, use it as input[/QUOTE]

    Is this what I should do:

    1) Create a new .AVS file
    2) Type in the code you quoted above
    3) open and run in VirtualDub for the AVI to MP4 Converting process to start ?

    As I lack knowledge of the basics, I'm just a little unclear, eg, if the Deinterlaced AVI file was called 'Silver.AVI', would that make the above coding look like this in my .AVS file.. ?

    ffmpeg.exe -i <Silver>.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k <output>.mp4

    I'm sorry if it's too much to explain, I'm just unsure exactly which program I'd type this in, unless you mean Windows Command Prompt?
    Quote Quote  
  8. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    once you have your avisynth script (which deinterlace, denoise, etc.) you can use it as input to ffmpeg encoder to generate the final output file:

    Code:
    ffmpeg.exe -i Silver.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4
    If for any reason you want to generate the deinterlaced file as the first step, then you feed it to ffmpeg encoder:

    Code:
    ffmpeg.exe -i Silver.avi -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4
    Quote Quote  
  9. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Originally Posted by lollo View Post
    once you have your avisynth script (which deinterlace, denoise, etc.) you can use it as input to ffmpeg encoder to generate the final output file:

    Code:
    ffmpeg.exe -i Silver.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4
    If for any reason you want to generate the deinterlaced file as the first step, then you feed it to ffmpeg encoder:

    Code:
    ffmpeg.exe -i Silver.avi -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4

    Hello again,

    I'm almost there, I tried to research more about ffmpeg as for what I might not be understanding, in order to complete this step.

    Do I type this code into CMD prompt? Apologies, how ffmpeg works isn't too obvious to me.

    I'm guessing that the first part of the code would include the exact path where ffmpeg.exe is located, so would it be something like this:
    [ FFmpeg exe file (application) is kept in Local Disk (C in a folder called FFmpeg ]

    C:/ffmpeg.exe -i Silver.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4

    I followed a guide to install ffmpeg in CMD Prompt, I think its installed correctly. I just want to see if I'm doing this in the right way.
    Quote Quote  
  10. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by Neil-Betamax View Post
    [ FFmpeg exe file (application) is kept in Local Disk (C in a folder called FFmpeg ]
    Then it should be:

    Code:
    C:\FFmpeg\ffmpeg.exe -i Silver.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4
    Quote Quote  
  11. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    do I need to do anything with AviSynth before I use CMD prompt to type in this code?

    In the folder you made for me called Neil-Betamax, I have the file called de-interlace.avs which worked in virtual dub to create the deinterlaced AVI.

    The deinterlaced AVI file is called silver.AVI and is located in the folder, Neil-Betamax.

    So the location for it at present, is C:\Videos\Video Software\Neil-Betamax

    When I start to type in CMD Prompt, anything I type seems to need to begin with

    C:\Users\User>

    So it looks like this:

    C:\Users\User>FFmpeg\ffmpeg.exe -i Silver.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4


    I haven't touched AviSynth or made a different avs file since the one you made in the Neil-Betamax folder. I'm wondering if I'm understanding this right when you say 'once you have your avisynth script (which deinterlace, denoise, etc.) ' - this means I need to have already created another avs file in order for the ffmpeg code to work in CMD Prompt?
    Quote Quote  
  12. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    1- either you apply the Avisynth processing, obtaining the filtered output .avi file and then you compress with ffmpeg using as input the .avi file, or you do not do the first step and compress with ffmpeg using as input the .avs script

    2- when you open the command prompt, you should mode to the directory where the files and the scripts are located and call ffmpeg with its absolute path or you move where the ffmpeg.exe is located and call the input file or the input script with their absolute paths.

    In general you should get familiar with Windows commands and basic architecture
    Quote Quote  
  13. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Originally Posted by Lollo
    you should mode to the directory where the files and the scripts are located
    "mode"? "move"?

    Are you implying use the "cd" command?

    @Neil, if you end up with this in the command prompt window:

    C:\Users\User>FFmpeg\ffmpeg.exe -i Silver.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4

    Just use the keyboard L and R arrow keys to move along to the start of the command and delete, with the DEL or Backspace keys, the characters you don't want, in this case, all of this: "Users\User>".

    You'll then end up with the command in post #10 ie without the "users" stuff in it. The hit Enter to run it.

    If I'm reading it right, you'll need to put in the full path (use quotes) to your AVS file, not just "silver.avs", because it's not in the ffmpeg folder. So, with ffmpeg in it's folder on the C drive and silver.avs in the Neil folder, your command should be:

    C:\FFmpeg\ffmpeg.exe -i "C:\Videos\Video Software\Neil-Betamax\Silver.avs" -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4

    and Silver.mp4 will appear in your ffmpeg folder.

    You should just need to copy that command, then paste it into the command line you get in the cmd prompt window and hit Enter to run it. You shouldn't have to remove that "user" stuff.

    Not that I'm an expert, but see how that goes.
    Last edited by Alwyn; 15th Jun 2025 at 05:38. Reason: fixed typo: changed Silver.avi to Silver.mp4
    Quote Quote  
  14. Myself I have ffmpeg.exe in the "Environmental Variables" "Path".
    Like this: C:\Program Files\ffmpeg\bin
    This is the location of ffmpeg.exe on my computer.
    That way using the code you posted all I have to put in the command window is .
    Code:
    ffmpeg.exe -i "C:\Videos\Video Software\Neil-Betamax\Silver.avs" -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k Silver.mp4
    I usually do not add the .exe to ffmpeg in the code.

    I also do it this way so Windows does not need to use "Environmental Variables" "Path".
    In the command prompt for my OS :
    cd \Program Files\ffmpeg\bin Enter.

    For you cd \you'll need to put in the full path to your ffmpeg.exe .

    I prefer my ffmpeg folder uncluttered so I also put the full path for the output file.
    In your case C:\Videos\Video Software\Neil-Betamax\Silver.mp4
    Quote Quote  
  15. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Originally Posted by lollo View Post
    1- either you apply the Avisynth processing, obtaining the filtered output .avi file and then you compress with ffmpeg using as input the .avi file, or you do not do the first step and compress with ffmpeg using as input the .avs script

    2- when you open the command prompt, you should mode to the directory where the files and the scripts are located and call ffmpeg with its absolute path or you move where the ffmpeg.exe is located and call the input file or the input script with their absolute paths.

    In general you should get familiar with Windows commands and basic architecture
    Thanks Lollo, I appreciate your help. I've read back your reply many times & I'm still pretty lost as I lack a lot of basic understanding, whilst do I understand a small amount on how it works in general. I've done a little bit of coding in STOS for the Atari ST EG, I had to step back for a week till I can dedicate time to try to understand. I guess once I have my head around it, it will make life easier in the long run when it comes to other tasks.
    I'll take a good look at this today
    Quote Quote  



Similar Threads

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