VideoHelp Forum
+ Reply to Thread
Page 1 of 4
1 2 3 ... LastLast
Results 1 to 30 of 111
Thread
  1. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    To Moderator: I'm not exactly sure how to go about posting this particular thread/question, or if this is appropriate procedure. It's a related concern to my other post only because I've been steered down a solid, very good path that I did not even first consider (i.e. using Avisynth). I've crossed over to the dark side and am interested in using Avisynth. My original thread is still active in the restoration subforum about "proper deinterlace"), but I figured this particular topic about Avisynth plugin can also be seen as a "new" issue that I'm having that might work well in its own separate thread.

    Lock, move or merge, or leave active. Appreciative of any advice.



    Thread concern: I've copied the .dll file and .avsi file directly into my Avisynth folder, but I'm not even able to get AVSPmod to recognize the filter. There must be something that I'm doing incorrectly. Pictures below.

    I have Avisynth 2.6 installed.
    Click image for larger version

Name:	Avisynth seta.jpg
Views:	303
Size:	66.5 KB
ID:	45382


    Originally Posted by manono View Post
    Originally Posted by strawberryshortcake View Post
    Youtube tutorial is few and far between for beginners when it comes to Avisynth.
    You might be better off reading the introductory pages at the AviSynth site:

    http://avisynth.nl/index.php/Main_Page
    I've browsed through some of the pages in the above link, but things still remain a very hazy. I've search the internet, various message boards, I've done the copy and paste .dll file .avsi file into the avisynth plugin folder, but it still doesn't seem to work.

    The Hysteria plugin is what I'm after, so that I may specifically darken the lines of cartoons/animations.

    http://avisynth.nl/index.php/Hysteria
    http://www.aquilinestudios.org/scripts/Hysteria-20100911.avsi
    -It says required plugins: MaskTools 2.0 (MT_MaskTools)
    -I believe I have "installed" it correct by copying and pasting the .dll file into my avisynth folder.

    https://github.com/pinterf/masktools/releases/

    Example of what the Hysteria filter/plugin is suppose to do:
    http://www.aquilinestudios.org/compare/hysteria.html



    The drop down tab in AVSPmod doesn't bring up "Hysteria" instead it bring up "Hysteresis" and I don't believe those two are the same. The command/script/or whatever it's called is:

    Code:
    Hysteria()
    specific example (can be seen here: http://www.aquilinestudios.org/compare/hysteria.html
    Code:
    Hysteria(strength=3.0,luma_cap=225)


    Click image for larger version

Name:	avisynth hysteria c.jpg
Views:	478
Size:	80.1 KB
ID:	45378


    The following "plugins" are in the AviSynth plugin folder (or are these referred to as something else, a different term). I have two AviSynth folders (AviSynth and AviSynth 2.5), so I figured I'll just put the Hysteria and masktools2.dll into both locations.

    Hysteria-20100911 (AviSynth + Autoload Script)
    masktools2.dll
    mt_masktools.dll
    mvtools2.dll

    Click image for larger version

Name:	avisynth hysteria a.jpg
Views:	672
Size:	316.9 KB
ID:	45379

    Click image for larger version

Name:	avisynth hysteria b.jpg
Views:	305
Size:	176.4 KB
ID:	45380




    Click image for larger version

Name:	avisynth hysteria d.jpg
Views:	306
Size:	185.5 KB
ID:	45381
    Last edited by strawberryshortcake; 25th Apr 2018 at 02:04.
    Quote Quote  
  2. I don't know about Avspmod but what happens if you manually write "Hysteria()" into your script? The drop-down is just a helper.

    If it cannot load some plugins or redistributable might be missing (like MS VC++ 2017 redist (32 bit)). Often you can debug such problems using avsmeter -avsinfo
    Quote Quote  
  3. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by sneaker View Post
    I don't know about Avspmod but what happens if you manually write "Hysteria()" into your script? The drop-down is just a helper.

    If it cannot load some plugins or redistributable might be missing (like MS VC++ 2017 redist (32 bit)). Often you can debug such problems using avsmeter -avsinfo
    Not exactly sure how to decipher it, but I get the following message in red letters in AVSPmod (#1 this is the original AVSPmod that I downloaded).

    Hysteria: YV12 input only
    (Hysteria-20100911.avsi, line 78)
    (New File, line 2)

    Click image for larger version

Name:	avisynth hysteria e.jpg
Views:	339
Size:	120.0 KB
ID:	45384



    I still want to know how to address or add in plugins (for future reference), but I decided to just go with the available installation pack for the time being found in the link below (animevideomusic.org) It worked, now I can do the hysteria thing; opening the AVSPmod that was packaged with the AMVpack worked. The drop down suggested menu tab shows "Hysteria".

    When I did install the AMVpack (double click on it), it did prompt me to install some type of Microsoft Redistribution thing or whatever it's called like you pointed out. I still have the AVSPmod (original #1) that still doesn't have the drop down suggestion for hysteria, it's still hysteresis, but with the new AVSPmod (#2) that was packaged with the AMVpack it does work with hysteria ()



    However, this doesn't really "teach me to fish" so to speak ; it's simply giving me the fish. Not going to know exactly how to properly "install" plugins.

    AMVpack 64bit version.
    https://www.animemusicvideos.org/forum/viewtopic.php?f=11&t=121948

    AMVpack is an installer package for all the tools commonly used for handling and preparing footage for use in making AMVs. This is similar to AMVapp but is more up to date and will have an expiration date so that old versions will not run. I plan to keep this as up to date as possible and will try to have one release a year to help maintain the latest usable versions of any particular item in the package.

    Download: Windows (x86/x64) / macOS / Sources
    NOTE: THIS PACKAGE EXPIRES AND WILL NOT INSTALL AFTER DECEMBER 31, 2018!



    I also don't quite understand the paragraph statements. It's set to expire, so does that mean after December 31, 2018, the program will stop working?
    Quote Quote  
  4. The error message indicates Hysteria is installed but the video needs to be YV12, not whatever DirectShowSource() output. Add ConvvertToYV12(interlaced=true) between the two lines.
    Quote Quote  
  5. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    The error message indicates Hysteria is installed but the video needs to be YV12, not whatever DirectShowSource() output. Add ConvvertToYV12(interlaced=true) between the two lines.

    Script error: there is no function named "ConvvertToYV12" (New File, line 2)
    Image
    [Attachment 45391 - Click to enlarge]



    Then I thought maybe I should take out the extra "v" inside "ConvvertToYV12," but then I get another strange error.
    Image
    [Attachment 45390 - Click to enlarge]
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    AvsPmod crashed. Why don't you forget it for now, edit your scripts in Notepad and test them in Virtualdub2
    Quote Quote  
  7. Originally Posted by strawberryshortcake View Post
    Script error: there is no function named "ConvvertToYV12" (New File, line 2)
    Image
    [Attachment 45391 - Click to enlarge]
    Oops. I typed too many v's.

    Originally Posted by strawberryshortcake View Post
    Then I thought maybe I should take out the extra "v" inside "ConvvertToYV12," but then I get another strange error.
    Image
    [Attachment 45390 - Click to enlarge]
    That's is the correct solution. I don't know why the program crashed. Possibly a version incompatibility problem between masktools 2.0 and Hysteria?

    I tried it here with both 32 bit AviSynth (and 32 bit VirtualDub) and 64 bit AviSynth+ (and 64 bit VirtualDub). Both had no problems with an animated DVD source.
    Last edited by jagabo; 25th Apr 2018 at 18:01.
    Quote Quote  
  8. That type of error usually means plugin autoload issue . Look at some of your old plugins , clean out the ones you don't need (just put them into a different folder). You have 2 versions of masktools. Put mt_masktools into a different folder .
    Quote Quote  
  9. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by davexnet View Post
    AvsPmod crashed. Why don't you forget it for now, edit your scripts in Notepad and test them in Virtualdub2
    I'm still a complete novice to the world of avisynth. It's been less than a day of cumulative hours. The script and even the very first script is mostly a copy and paste job from seasoned veterans. I figured having the drop down menu in AvsPmod would be a good starting point; a guidance down the correct path of sort.


    Originally Posted by jagabo View Post
    That's is the correct solution. I don't know why the program crashed. Possibly a version incompatibility problem between masktools 2.0 and Hysteria?

    I tried it here with both 32 bit AviSynth (and 32 bit VirtualDub) and 64 bit AviSynth+ (and 64 bit VirtualDub). Both had no problems with an animated DVD source.
    I think it does boil down to a compatibility issue. I did exactly what poisondeathray suggested, moved "mt_masktools " to a different location and now your suggestion to insert ConvvertToYV12(interlaced=true), after hitting F5 works. No errors returned.


    Originally Posted by poisondeathray View Post
    That type of error usually means plugin autoload issue . Look at some of your old plugins , clean out the ones you don't need (just put them into a different folder). You have 2 versions of masktools. Put mt_masktools into a different folder .

    Did exactly what you suggested there, moved mt_masktools outside of the plugin folder and now F5 to refresh/preview works.

    What I still don't understand is why the dropdown suggestion menu in AVSPmod (#1) still doesn't show Hysteria as one of the selectable choices. I figured as newbie to the world of AVSPmod/Avisynth, if the code word is available within the drop down menu, gets its own color and bolded when selected, then the plugin was correctly installed. I did type the following, press F5 and did see changes to the video image. So it works, but just wondering why the world Hysteria is not one of the available option in the drop down menu in AVSPmod (#1)

    Code:
    Hysteria(strength=9, usemask=true, lowthresh=6, highthresh=20, luma_cap=191, maxchg=255, minchg=0, showmask=false)
    Yes, i have a working AVSPmod (#2) (that came packaged with AMVpack) that actually shows the drop down "Hysteria" function/feature/code or whatever it's called. It's bold and in blue letters while Hysteria typed in AVSPmod (#1) is black and the font is thin.

    Figure 1: Shows mt_masktools moved out of the plugin folder, and this did the trick.
    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe c.png
Views:	479
Size:	207.7 KB
ID:	45399

    Figure 2: Show masktools2.dll in the plugin folder along with hysteria
    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe b.png
Views:	229
Size:	1.20 MB
ID:	45402

    Figure 3: Even though pressing F5 to preview works with the Hysteria code, I'm just wondering why "Hysteria" is not part of the suggested drop down menu.
    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe d.png
Views:	302
Size:	1.48 MB
ID:	45400

    Figure 4: This was the error situation when I still had mt_masktools within the plugin folder of avisynth. Something was in conflicted.
    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe a.png
Views:	476
Size:	1.47 MB
ID:	45403



    AVSPmod (#2) Has the Hysteria drop down menu and all the settings shown, Hysteria font is colored, and bold
    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe e.png
Views:	4129
Size:	293.1 KB
ID:	45398

    AVSPmod (#1) Doesn't have the hysteria drop down menu, letters font is thin black.
    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe f.png
Views:	4097
Size:	354.2 KB
ID:	45401



    Question remains: I'm guessing I "installed" the .dll file sort of correctly (by copying and pasting it directly into avisynth plugins folder? And is this basically the way to do it with all plugins? Just copy and past the .dll file into the Avisynth plugins folder.

    And the same goes for something like this (random google search) .... just copy and past the .dll into the avisynth plugin folder.
    http://avisynth.nl/index.php/Toon_v0.82
    Quote Quote  
  10. "dll hell" is an avisynth rite of passage . Nobody "levels up" until they waste hours cleaning up dll's

    Originally Posted by strawberryshortcake View Post
    What I still don't understand is why the dropdown suggestion menu in AVSPmod (#1) still doesn't show Hysteria as one of the selectable choices. I figured as newbie to the world of AVSPmod/Avisynth, if the code word is available within the drop down menu, gets its own color and bolded when selected, then the plugin was correctly installed. I did type the following, press F5 and did see changes to the video image. So it works, but just wondering why the world Hysteria is not one of the available option in the drop down menu in AVSPmod (#1)

    Code:
    Hysteria(strength=9, usemask=true, lowthresh=6, highthresh=20, luma_cap=191, maxchg=255, minchg=0, showmask=false)
    Yes, i have a working AVSPmod (#2) (that came packaged with AMVpack) that actually shows the drop down "Hysteria" function/feature/code or whatever it's called. It's bold and in blue letters while Hysteria typed in AVSPmod (#1) is black and the font is thin.

    AVSPmod (#2) Has the Hysteria drop down menu and all the settings shown, Hysteria font is colored, and bold
    Image
    [Attachment 45398 - Click to enlarge]


    AVSPmod (#1) Doesn't have the hysteria drop down menu, letters font is thin black.
    Image
    [Attachment 45401 - Click to enlarge]

    Not sure what you mean ?

    Do you mean autofill / autocomplete ? It has to be either an autoloaded.dll or .avsi at runtime to load when you start avspmod . There are options to enable/disable. options=>program settings=> auto complete . It might be disabled partially in the one that doesn't work

    Name:  avspmod_autocomplete.jpg
Views: 7682
Size:  4.2 KB

    Click image for larger version

Name:	avspmod_autocomplete2.jpg
Views:	4007
Size:	17.6 KB
ID:	45405
    Quote Quote  
  11. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    "dll hell" is an avisynth rite of passage . Nobody "levels up" until they waste hours cleaning up dll's

    Originally Posted by strawberryshortcake View Post
    What I still don't understand is why the dropdown suggestion menu in AVSPmod (#1) still doesn't show Hysteria as one of the selectable choices. I figured as newbie to the world of AVSPmod/Avisynth, if the code word is available within the drop down menu, gets its own color and bolded when selected, then the plugin was correctly installed. I did type the following, press F5 and did see changes to the video image. So it works, but just wondering why the world Hysteria is not one of the available option in the drop down menu in AVSPmod (#1)

    Code:
    Hysteria(strength=9, usemask=true, lowthresh=6, highthresh=20, luma_cap=191, maxchg=255, minchg=0, showmask=false)

    Yes, i have a working AVSPmod (#2) (that came packaged with AMVpack) that actually shows the drop down "Hysteria" function/feature/code or whatever it's called. It's bold and in blue letters while Hysteria typed in AVSPmod (#1) is black and the font is thin.

    AVSPmod (#2) Has the Hysteria drop down menu and all the settings shown, Hysteria font is colored, and bold
    Image
    [Attachment 45398 - Click to enlarge]


    AVSPmod (#1) Doesn't have the hysteria drop down menu, letters font is thin black.
    Image
    [Attachment 45401 - Click to enlarge]

    Not sure what you mean ?

    Do you mean autofill / autocomplete ? It has to be either an autoloaded.dll or .avsi at runtime to load when you start avspmod . There are options to enable/disable. options=>program settings=> auto complete . It might be disabled partially in the one that doesn't work

    Image
    [Attachment 45404 - Click to enlarge]


    Image
    [Attachment 45405 - Click to enlarge]

    Yep, autofill and autocomplete is exactly what I meant. The AVSPmod (#1) won't autofill Hysteria. Options==> program settings==> but didn't see auto complete button. The only place with autocomplete was .... None of the other tabs had autocomplete

    Click image for larger version

Name:	Avisynth HYSTERIA fixmaybe g.png
Views:	248
Size:	482.8 KB
ID:	45406
    Quote Quote  
  12. It's probably just an older version. Just download the newest version. Maybe it's even newer than your #2

    The problem with downloading prepackaged collections is some plugins, dlls, avs's are outdated, but some might not be. It's a surefire way to enter "DLL HELL" hahaha

    It's tough organizing the plugins directory. Some people use LoadPlugin() for everything . Autoload slows avisynth initialization. The more junk you have in the directory, the slower it is to startup. I only keep the plugins directly autoload with a few things that I use often. The others are in subdirectories and don't autoload. Each directory is labelled so I know which versions are using on this particular install
    Quote Quote  
  13. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    It's probably just an older version. Just download the newest version. Maybe it's even newer than your #2

    The problem with downloading prepackaged collections is some plugins, dlls, avs's are outdated, but some might not be. It's a surefire way to enter "DLL HELL" hahaha

    It's tough organizing the plugins directory. Some people use LoadPlugin() for everything . Autoload slows avisynth initialization. The more junk you have in the directory, the slower it is to startup. I only keep the plugins directly autoload with a few things that I use often. The others are in subdirectories and don't autoload. Each directory is labelled so I know which versions are using on this particular install

    I'll look into that this weekend. But in the meantime, do you know how I would go about batch converting multiple TV episodes using the following script or any script for that matter creating in AVSPmod Will&GraceScriptEDITPERYOUTUBEinstructions.avs


    I've been using a .bat file to convert everything within a follder. Makes things easier, videos to be converted in one folder, double click on .bat file and done.

    Code:
    if not exist NewlyConvertedFilesDenoise md NewlyConvertedFilesDenoise
    for %%a in ("*.mkv") do ffmpeg -re -y -i "%%a" -c:v libx264 -preset veryslow -tune film -crf 24 -vf hqdn3d -c:a ac3 -ac 2 -b:a 128k "NewlyConvertedFilesDenoise\%%~na.mp4"
    pause


    Conversion.bat, I tried sticking the .avs file anywhere, and doesn't seem to work. Theoretically it should right?
    ===========================================
    if not exist NewlyConvertedFilesDenoise md NewlyConvertedFilesDenoise
    for %%a in ("*.mkv") do ffmpeg -i Will&GraceScriptEDITPERYOUTUBEinstructions.avs
    -re -y -i "%%a" -c:v libx264 -preset veryslow -tune film -crf 24 -vf hqdn3d -c:a ac3 -ac 2 -b:a 128k "NewlyConvertedFilesDenoise\%%~na.mp4"
    pause
    ===========================================

    if not exist NewlyConvertedFilesDenoise md NewlyConvertedFilesDenoise
    for %%a in ("*.mkv") do ffmpeg -re -y -i "%%a" -i Will&GraceScriptEDITPERYOUTUBEinstructions.avs
    -c:v libx264 -preset veryslow -tune film -crf 24 -vf hqdn3d -c:a ac3 -ac 2 -b:a 128k "NewlyConvertedFilesDenoise\%%~na.mp4"
    pause
    ===========================================
    Quote Quote  
  14. Each script reference a single video. So you would need a script for each episode. There are various avs batch scripters.

    It would be *.avs as the input, not *.mkv. Because the avs is the actual direct input. You would need to include audio in the avs since you're encoding audio. I would use AAC instead of AC3 at 128kbps
    Code:
    for %%a in ("*.avs") do ffmpeg -i "%%a" -re -y -c:v libx264 -preset veryslow -tune film -crf 24 -vf hqdn3d -c:a ac3 -ac 2 -b:a 128k "NewlyConvertedFilesDenoise\%%~na.mp4"
    
    pause
    Quote Quote  
  15. If it helps, I have a batch file that builds an AviSynth script given a filename:

    Code:
    "G:\Program Files\DgIndex\DGIndex.exe" -i "%~1" -o "%~dpn1" -fo 0 -om 2 -exit
    echo Mpeg2Source("%~dpn1.d2v", CPU2="ooooxx", Info=3) >> "%~1.avs"
    echo TFM(d2v="%~d1%~p1%~n1.d2v") >> "%~1.avs"
    echo TDecimate() >> "%~1.avs"
    You have to change the path on the first line to where DgIndex is located on your computer. This batch file is in my SendTo folder so I can right click on a video then select Send To -> AVS_Mpeg2Source.bat. Or you can drag/drop a file onto it. You should be able to see how to add other options to the resulting script if necessary.

    DgIndex doesn't work well for MPEG 2 video in MKV files. If your sources are MKV (from MakeMKV?) it may be necessary to demux the video first.
    Quote Quote  
  16. And for the ffmpeg command you need to add -vf setsar as in the other thread to signal aspect ratio. Because .avs scripts do not pass that info, but ffmpeg can read AR directly on most types of video files. The value will change between 4:3 and 16:9 sources. You would add it in the same linear chain of filters

    so if you were using hqdn3d, just add it on
    Code:
    -vf hqdn3d, setsar=sar=8/9
    Another way would be to use the denoising filters in the script. Most people would do it that way because you can "see" the preview in avspmod, and you have more variety to choose from. Also many ffmpeg filters are single threaded . Eventually you will probably want to migrate to avisynth+ MT because it's faster
    Quote Quote  
  17. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Per Poisondeathray request.

    Uploading an undemuxed (original VOB cut sample) of Will and Grace
    Last edited by strawberryshortcake; 27th Apr 2018 at 23:22.
    Quote Quote  
  18. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    EDIT:
    Originally Posted by jagabo View Post
    If it helps, I have a batch file that builds an AviSynth script given a filename:

    Code:
    "G:\Program Files\DgIndex\DGIndex.exe" -i "%~1" -o "%~dpn1" -fo 0 -om 2 -exit
    echo Mpeg2Source("%~dpn1.d2v", CPU2="ooooxx", Info=3) >> "%~1.avs"
    echo TFM(d2v="%~d1%~p1%~n1.d2v") >> "%~1.avs"
    echo TDecimate() >> "%~1.avs"
    You have to change the path on the first line to where DgIndex is located on your computer. This batch file is in my SendTo folder so I can right click on a video then select Send To -> AVS_Mpeg2Source.bat. Or you can drag/drop a file onto it. You should be able to see how to add other options to the resulting script if necessary.

    DgIndex doesn't work well for MPEG 2 video in MKV files. If your sources are MKV (from MakeMKV?) it may be necessary to demux the video first.

    I tried it out, and it works, but I was hoping for a "real" batching process for all 200 plus TV episodes in my folder. I tried sending the entire folder to the .bat file and also tried dragging the entire folder onto the .bat file but that didn't work. It only converts one file at a time, and when done it stops. It doesn't start converting the second or subsequent files. Is it suppose to only do one file at a time? Meaning I have to drag one file to it, let it finish, then drag a second file, let it finished, and repeat the process until all 200 plus TV episodes are done? I was hoping that I could select all VOB files or all .mp4 files and drop it onto the .bat file.




    I found this thread and it basically has sort of does what I want. I'm still testing it out, but I can't seem to get multiple .avs (created directly using a .vob file) to merge with multiple .ac3 files. If I recall correctly, if I created multiple .avs files using multiple .mp4 files, then it works.... I think.


    https://forum.videohelp.com/threads/381345-(Help-Needed-with-ffmpeg)-how-do-i-batch-me...to-video-files


    Originally Posted by raffriff42 View Post
    Batch script to extract/split audio and video
    Code:
    @echo off
    :: set paths (no quotes)
    set ffmpeg=C:\Program Files (x86)\ffmpeg\bin\ffmpeg.exe
    set outfolder=D:\VideoProjects\work\_temp\split
    
    @echo.
    @echo on
    for %%f in (*.mp4) do "%ffmpeg%" -y ^
      -hide_banner ^
      -i "%%~dpnxf" -c:v copy -an ^
      "%outfolder%\%%~nf-xtract.m4v"
    @echo off
    if errorlevel 1 pause
    @echo.
    @echo on
    for %%f in (*.mp4) do "%ffmpeg%" -y ^
      -hide_banner ^
      -i "%%~dpnxf" -vn -c:a copy ^
      "%outfolder%\%%~nf-xtract.m4a"
    @echo off
    if errorlevel 1 pause 
    @echo.
    Batch script to merge/mux audio and video
    Code:
    @echo off
    :: set paths (no quotes)
    set ffmpeg=C:\Program Files (x86)\ffmpeg\bin\ffmpeg.exe
    set outfolder=D:\VideoProjects\work\_temp\joined
    
    @echo.
    @echo on
    for %%f in (*.m4v) do "%ffmpeg%" -y ^
      -hide_banner ^
      -i "%%~dpnxf"  -i "%%~dpnf.m4a" ^
      -c:v copy -c:a copy ^
      -map 0:0 -map 1:0 -shortest ^
      "%outfolder%\%%~nf-remux.mp4"
    @echo off
    if errorlevel 1 pause
    @echo.
    Change to ffmpeg path to the actual path on your computer.
    Change outfolder to wherever you want.
    Change the file extensions as needed.

    Delete the -y if you want to get a warning before a file is overwritten.
    I assumed output is to a temp folder and you don't care about that.
    Last edited by strawberryshortcake; 27th Apr 2018 at 23:32.
    Quote Quote  
  19. You would combine poisondeathray's ffmpeg/for loop with my batch builder to process each mkv file.
    Quote Quote  
  20. Thanks for the VOB sample. Sorry, but can you cut a longer sample, say 2 min starting from the beginning?



    Background info - this is for debugging ffmpeg IVTC.

    The workaround is to use dejudder for mixed ntsc streams

    eg.
    Code:
    -vf "dejudder,fps=30000/1001,fieldmatch=combmatch=full,yadif=deint=interlaced,decimate,setsar=sar=8/9"
    And it works better to eliminate the catastrophic failure from before, and is probably usable now

    But but still not as good as avisynth. 2 issues remain -

    1) which I remuxed the elementary video and audio from the other thread, it started dropping wrong frames again. So I wanted to check a native stream as-is in case ffmpeg was picking up some weirdness from timestamps. It doesn't seem as adaptive as TIVTC, and more prone to issues

    2) the threshold for combing in fieldmatch is off. It's not as clean as avisynth TIVTC. It either deinterlaces too much (aliasing artifacts, resolution loss) , or too little (missing some combed frames) despite adjusting the cthresh value incrementally. But cthresh does work (you can see a difference from lower to higher values) , it's just that it's off there is no value that makes it as clean as avisynth's default "9" .

    The bottom line is avisynth TIVTC and vapoursynth VIVTC can do it , and cleaner. So why can't ffmpeg do it ? Much of the code is ported from TIVTC and VIVTC.

    For the IVTC part, and I alluded to this earlier, one difference is the indexing. DGIndex / dgdecode is super consistent for DVD/mpeg2 source. If you use other source filters, even indexed ones like ffms2 instead, then avisynth becomes less reliable as well.

    For the marked as combed / comb detection part - not sure. It's passing which frames are combed to yadif. But there is no value that makes it as good as avisynth... I would haev expected matching values for everything should have given identical results... that' s not the case


    I'm trying to look at dozens of examples from the past where ffmpeg IVTC has issues in more detail and eventually put together a bug report for the dev's .
    Quote Quote  
  21. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Thanks for the VOB sample. Sorry, but can you cut a longer sample, say 2 min starting from the beginning?

    I'm trying to look at dozens of examples from the past where ffmpeg IVTC has issues in more detail and eventually put together a bug report for the dev's .

    Decided to upload 4 different tv episode 2 minute clips in case it helps.
    Quote Quote  
  22. yes it does help, thanks for samples

    I'm going to go through them (and a bunch of others) and try to figure out why ffmpeg isn't getting as clean results. It still has a few too many duplicates on some streams, even with the dejudder workaround, and the cthresh isn't working as well as it should be

    ffmpeg IVTC is still too inconsistent right now IMO, but hopefully we can help improve it . It would be nice to not have to create avs or vpy scripts one day for a IVTC only
    Quote Quote  
  23. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    yes it does help, thanks for samples

    I'm going to go through them (and a bunch of others) and try to figure out why ffmpeg isn't getting as clean results. It still has a few too many duplicates on some streams, even with the dejudder workaround, and the cthresh isn't working as well as it should be

    ffmpeg IVTC is still too inconsistent right now IMO, but hopefully we can help improve it . It would be nice to not have to create avs or vpy scripts one day for a IVTC only
    I'll get some more 2 minutes samples including some animation stuff as well.
    Quote Quote  
  24. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    I guess the edit button doesn't allow attachments.

    Here's a few more ... Animations this time.
    Quote Quote  
  25. Member
    Join Date
    May 2016
    Location
    United States
    Search Comp PM
    Just in case, the more the merrier.

    Four total, 3 live, 1 animation.
    Quote Quote  
  26. Member
    Join Date
    Apr 2018
    Location
    Croatia
    Search Comp PM
    Just give parameters for vapoursynth filters that make IVTC work as intended. Than I will compare with lavfi.
    Quote Quote  
  27. Here's a simple batch file combining my earlier AVS_Mpeg2Source.bat and ffmpeg to encode/mux all VOB files in a folder:

    Code:
    for %%a in ("*.VOB") do (
        AVS_Mpeg2Source "%%a"
        del audiofile.ac3
        ren "%%~na*.ac3" audiofile.ac3
        "g:\program files\ffmpeg\bin\ffmpeg.exe" -i "%%a.AVS" -i audiofile.ac3 -y -c:v libx264 -preset veryfast -tune film -crf 24 -vf hqdn3d -c:a copy "NewlyConvertedFilesDenoise\%%~na.mp4"
        del audiofile.AC3
        del "%%a.AVS"
        del "%%~na.d2v"
        del "%%~na.d2v.bad"
        del "%%~na.fix.txt"
    )
    This first calls AVS_Mpeg2Source.bat to build the d2v, ac3, and AVS. Dgindex appends the channel info and audio delay to the filename so the name is unpredictable. So I rename the audio file "audiofile.ac3" before calling ffmpeg. ffmpeg encodes the video via the AVS script and muxes the original audio. After encoding audiofile.AC3 and the other temp files are deleted.
    Last edited by jagabo; 28th Apr 2018 at 16:23. Reason: added "-c:a copy" to ffmpeg command line to copy audio instead of encoding to aac
    Quote Quote  
  28. Originally Posted by richardpl View Post
    Just give parameters for vapoursynth filters that make IVTC work as intended. Than I will compare with lavfi.
    Thanks for your input.

    In case others were not aware, richardpl is a ffmpeg developer



    Just so we are on the same page, lets start with the same sample first.
    "Will & Grace S1 D1 Ep2 - A New Lease on Life NEXTEST.demuxed.m2v" from post 34 in the other thread
    https://forum.videohelp.com/threads/388818-What-is-the-proper-way-to-deinterlace-Sourc...e2#post2518254


    1) avisynth output should be compared. Because it's the "gold standard", and everything was derived from TIVTC (Tritical, Kevin Stone).

    2) It still gives better results than VIVTC; even in default mode TIVTC will sometimes find a match where VIVTC using the same settings will not - this results in more frames which are deinterlaced (artifacts, lower resolution)

    3) But VIVTC still gives better results than ffmpeg, using same settings

    4) For avisynth , to view the field match only, I would disable PP modes in TFM(PP=0), so you can "see" the combing. You can replace the comb fall back with better deinterlacers, like QTGMC for Clip2. This can be done in vapoursynth too with functools. But a standard/automatic IVTC in avisynth would just be TFM().TDecimate(). That's it. But I think (I know) a critical difference in the consistency is the d2v. If you replace that source filter with something else, avs becomes less reliable too

    5) For vapoursynth, you would use d2vsource too. You can use what is suggested in the docs for VIVTC
    http://www.vapoursynth.com/doc/plugins/vivtc.html , but some people use TDeintMod for the comb detection. Nnedi3/eedi3 or QTGMC are usually used for the combing fallback . Let me know if you want any variations posted

    eg. vapoursynth default IVTC
    Code:
    input_clip = core.d2v.Source(r'PATH\Will & Grace S1 D1 Ep2 - A New Lease on Life NEXTEST.demuxed.d2v')
    
    def postprocess(n, f, clip, deinterlaced):
       if f.props['_Combed'] > 0:
          return deinterlaced
       else:
          return clip
    
    matched_clip = core.vivtc.VFM(input_clip, 1, cthresh=9)
    deinterlaced_clip = core.eedi3.eedi3(matched_clip, field=1)
    postprocessed_clip = core.std.FrameEval(matched_clip, functools.partial(postprocess, clip=matched_clip, deinterlaced=deinterlaced_clip), prop_src=matched_clip)
    decimated_clip = core.vivtc.VDecimate(postprocessed_clip)
    decimated_clip.set_output()
    For example, frames 252, 435 are combed in vapoursynth (later deinterlaced if you used functools pp, with eedi3 in that example above). But in avisynth they are full resolution, not deinterlaced because a match is found.

    6) Using ffmpeg default IVTC settings (including the dejudder workaround), many frames are deinterlaced. For example the entire sequence when will is walking in around 4-5sec is deinterlace. You can see the aliasing in brick wall in the background. cthresh can be adjusted and perhaps the default settings in ffmpeg should be because too many frames are deinterlaced

    Despite deinterlacing too many "good" frames, it misses combed frames(!) . Right around the scene change , eg. 252 remains is combed . And some duplicates remain eg. 374/375, 434/435, 584/585

    (Note the framecounts and frame numbering are slightly different - it partially has to do with how decoders handle open gop and leading B-frames) , but the description of the issues is accurate

    In general, TIVTC is not "perfect" in auto mode either (sometimes there is no perfect solution with cadence breaks), but it's clearly better than the others

    7) Why does ffmpeg mess up again (in terms of frame drops, despite dejudder) when video is remuxed with audio into a mpeg-ps? ImagoMPEG muxer was used, and this is DVD compliant. Attached "ImagoMPEG-Muxer.mpg"
    Image Attached Files
    Quote Quote  
  29. Originally Posted by jagabo View Post
    Here's a simple batch file combining my earlier AVS_Mpeg2Source.bat and ffmpeg to encode/mux all VOB files in a folder:

    Code:
    for %%a in ("*.VOB") do (
        AVS_Mpeg2Source "%%a"
        del audiofile.ac3
        ren "%%~na*.ac3" audiofile.ac3
        "g:\program files\ffmpeg\bin\ffmpeg.exe" -i "%%a.AVS" -i audiofile.ac3 -y -c:v libx264 -preset veryfast -tune film -crf 24 -vf hqdn3d "NewlyConvertedFilesDenoise\%%~na.mp4"
        del audiofile.AC3
        del "%%a.AVS"
        del "%%~na.d2v"
        del "%%~na.d2v.bad"
        del "%%~na.fix.txt"
    )
    This first calls AVS_Mpeg2Source.bat to build the d2v, ac3, and AVS. Dgindex appends the channel info and audio delay to the filename so the name is unpredictable. So I rename the audio file "audiofile.ac3" before calling ffmpeg. ffmpeg encodes the video via the AVS script and muxes the original audio. After encoding audiofile.AC3 and the other temp files are deleted.


    How would you account for the audio delay value ?
    Quote Quote  
  30. Originally Posted by poisondeathray View Post
    Originally Posted by jagabo View Post
    Here's a simple batch file combining my earlier AVS_Mpeg2Source.bat and ffmpeg to encode/mux all VOB files in a folder:

    Code:
    for %%a in ("*.VOB") do (
        AVS_Mpeg2Source "%%a"
        del audiofile.ac3
        ren "%%~na*.ac3" audiofile.ac3
        "g:\program files\ffmpeg\bin\ffmpeg.exe" -i "%%a.AVS" -i audiofile.ac3 -y -c:v libx264 -preset veryfast -tune film -crf 24 -vf hqdn3d "NewlyConvertedFilesDenoise\%%~na.mp4"
        del audiofile.AC3
        del "%%a.AVS"
        del "%%~na.d2v"
        del "%%~na.d2v.bad"
        del "%%~na.fix.txt"
    )
    This first calls AVS_Mpeg2Source.bat to build the d2v, ac3, and AVS. Dgindex appends the channel info and audio delay to the filename so the name is unpredictable. So I rename the audio file "audiofile.ac3" before calling ffmpeg. ffmpeg encodes the video via the AVS script and muxes the original audio. After encoding audiofile.AC3 and the other temp files are deleted.


    How would you account for the audio delay value ?
    I forgot to mention that. It doesn't. Which will be a problem with some videos. If you use ffmpeg to remux the audio from the original VOB will it account for any audio delay? If so, the script can be modified to do that.
    Quote Quote  



Similar Threads

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