VideoHelp Forum




+ Reply to Thread
Results 1 to 23 of 23
  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  
  16. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Originally Posted by Alwyn View Post
    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.
    Hi Alwyn, thanks for the tips.

    I tried my best to follow what you suggested, I'm unsure if I got it right.

    I made a new AVS file which reads as follows:

    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

    This AVS file is stored in C:\Videos\Video Software\Neil-Betamax

    I pasted the exact code into Command Prompt, but it reads like this...

    C:\Users\User>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

    I tried to delete User\User> in Command Prompt, but it won't allow me to delete User\User> when I try to make it just read as C:\FFmpeg (etc).
    When I type L, the cursor won't move left beyond User>, the furthest point I can type a command past is from C:\Users\User>_ - So I can't get it to read from C:\_ .

    The error I get in Command Prompt Reads in red as follows: (after a lot of coding prints in white, with ffmpeg version etc listed)

    Error opening input: No such file or directory
    Error opening input file C:\Video Software\Neil-Betamax\Silver.avs
    Error opening imput files: No such file or directory
    Quote Quote  
  17. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Hmm. When I open my command window, it shows

    Code:
    C:\Windows\System32
    Try Changing Directory to your ffmpeg folder by typing:

    cd C:\xxxxxxx (whereever your ffmpeg folder is).

    I have put a folder called ffmpeg on my C drive for the exercise so the code would be:

    Code:
    cd C:\ffmpeg
    That will then results in this:

    Code:
    C:\ffmpeg>
    on my command line. I can then run ffmpeg.exe without specifying it's absolute path. Hopefully that will get around the "users" folder issue.

    If you swap to your ffmpeg folder using that CD command, you can then just run the script as Cholla showed above, starting only with "ffmpeg.exe".

    Also have another look at at the start of post #14; where Lollo has put ffmep.exe to remove the need to put in the absolute full path.
    Quote Quote  
  18. @Neil-betamax:
    In case you didn't get any farther try the following:

    1) Unzip the attached combo.zip to your desktop. You should now see the folder icon 'Neil-betamax' on your desktop
    2) Open that folder in explorer (double-click on it). You will now see 2 files in the explorer window: encode.cmd and ffmpeg.exe
    3) Drag and drop your script Silver.avs (from wherever it is) onto the encode.cmd -> The encoding of your script will start automatically. Wait until it finishes.....
    4) The encoded file will be in the same folder where you had your Silver.avs
    Image Attached Files
    Quote Quote  
  19. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Originally Posted by Sharc View Post
    @Neil-betamax:
    In case you didn't get any farther try the following:

    1) Unzip the attached combo.zip to your desktop. You should now see the folder icon 'Neil-betamax' on your desktop
    2) Open that folder in explorer (double-click on it). You will now see 2 files in the explorer window: encode.cmd and ffmpeg.exe
    3) Drag and drop your script Silver.avs (from wherever it is) onto the encode.cmd -> The encoding of your script will start automatically. Wait until it finishes.....
    4) The encoded file will be in the same folder where you had your Silver.avs
    Hi,

    Thanks very much for taking the time to prepare this zip for me, & your instructions.

    I've just given it a try, here's what happened.

    I followed everything as you mentioned.

    Here's two screenshots of what's happening at this end. I'm hoping there might be something obvious to anyone more familiar with this process which can help identify where I'm going wrong.

    After I dragged & dropped the AVS file into encode file, screenshot 1 shows the result in CMD.

    When I pressed a key to continue, CMD closed down & nothing else happened.

    The second screenshot is what my AVS file looks like when I open it in text reader.

    Thanks everyone for chipping in, I can see I'm close to achieving this, it seems so.
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot 1 (drag n drop AVS into encode file).png
Views:	21
Size:	557.1 KB
ID:	87708  

    Click image for larger version

Name:	Screenshot 2 (The AVS Script I used to drag n drop into encode).png
Views:	21
Size:	895.7 KB
ID:	87709  

    Quote Quote  
  20. No, your second screenshot is not the .avs script, it's a commandline.
    You should just drag and drop the file Silver.avs onto the encode.cmd.

    (Post your silver.avs)
    Quote Quote  
  21. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Originally Posted by Sharc View Post
    No, your second screenshot is not the .avs script, it's a commandline.
    You should just drag and drop the file Silver.avs onto the encode.cmd.

    (Post your silver.avs)

    Thanks Sharc, & Thanks Lollo too! It works!

    I think I got confused somewhere along the lines, but now I can see the result I can go back and earn a greater understanding of how this process works in better detail.

    Very impressive. The silver, deinterlaced AVI file is 201GB, 57 minutes long. The end result is a brilliant, clear de-interlaced 1.53 GB MP4.

    This was a test using a Rip from a Superted VHS video. For the rest of my captures I'll repeat both processes, naming each file 'silver' in order to eliminate the need for editting any code.

    I've seen you actively involved in this forum a lot Sharc, & lollo too. I really, really appreciate your help, it's invaluable as I've taken a good 20 years of trial and error to get this far. So thank you again, & everyone else who has lent me a hand in this thread. It's very much appreciated, as I'm sure you all know. I try to offer advice on here from time to time but, in all honest I'm quiet a moderate in all kinds of areas as opposed to an expert in few.
    I try to chip in where I can though. My ultimate aim is to capture all my betamax & Sony Viewcam tapes, so I'm on a good path towards achieving this in the best possible way.

    Viva Video-Help Forum
    Quote Quote  
  22. Glad you got it working
    Quote Quote  
  23. Member
    Join Date
    Oct 2017
    Location
    Preston, UK
    Search Comp PM
    Thanks Sharc, its a great move!

    I think I'll take time to learn more about FFMPEG so I can adjust more things as I go.

    This one is probably for another thread, but I've run into another issue.

    The VHS is fine, but when I capture Betamax to AVI I often have to adjust the audio timeline manually in places where there has been an issue with the tape.
    When I was exporting AVI to MP4 using Davinci Resolve or any video editting program, I'd manually correct the audio by moving it back into place on the time line.

    What happens, is the audio goes out of sync on parts where the tape goes black & the image returns, for some reason it tends to only do this when I capture Betamax or DV Tapes.

    I think I opened a thread about it a few years ago, I'll go back to it. I'm hoping I can manually edit the audio of the uncompressed AVI capture file, without affecting the quality, keeping it uncompressed before I later de-interlace it with AVS Synth. I'm wondering if Davinci Resolve free version can do it, I'll have a play with it over the next few days.

    Great to get this far though, its by far the best way to achieve this
    Quote Quote  



Similar Threads

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