VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab Passkey and copy Blu-ray and DVDs! :)
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    I've been ripping some DVDs lately and would like to know if there's a way of removing the compression artefacts that come with the format, in AviSynth or such?

    This particular animated DVD for example, exhibits some horrid artefacts in a few frames.


    Image
    [Attachment 45973 - Click to enlarge]


    Image
    [Attachment 45974 - Click to enlarge]
    Image Attached Files
    Quote Quote  
  2. Search for mosquito noise and deblocking - for example http://avisynth.nl/index.php/Categoryeringing_%26_Mosquito_Noise - cartoons should be relatively easy to dering and to deblock - some wavelet noise reduction may works nicely, NLE should also improve perceived quality. Perhaps gradfun will work for you.
    Quote Quote  
  3. Start by using DgDecode's Mpeg2Source() to open the video using its de-ringing option. That will reduce the DCT ringing artifacts substantially. Don't use its deblocking filters as they are too strong and will blur some of the details. For deblocking use some thing like deblock_qed().

    the remaining DCT ringing can be greatly reduced with a filter like Deen() or TNLMeans().

    Code:
    Mpeg2Source("2DTV_track1_eng.d2v", CPU2="ooooxx", Info=3) 
    deblock_qed()
    TNLMeans(Ax=4, Ay=4, Az=0, h=4.0)
    Click image for larger version

Name:	clenaed.png
Views:	84
Size:	590.6 KB
ID:	45976
    Quote Quote  
  4. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Cheers fellas! Getting a much better picture now Regarding deblock_qed(), tried so many times, but can't seem to get it to load. The avsi file is in the Plugins folder but keep getting the following error..



    And doing Import("C:\Program Files (x86)\AviSynth\plugins\Deblock_QED_MT2Mod.avsi") doesn't work either..



    Also had to resize to 1024x576 widescreen as it was anamorphic 720x756, so loaded in AvsPmod in the wrong ratio! There's also an annoying dancing line at the bottom of the screen, particularly near the start, and the outputted video has no sound.
    Image Attached Files
    Quote Quote  
  5. Note the other filters required by deblock_qed(): http://avisynth.nl/index.php/Deblock_QED#Requirements
    Quote Quote  
  6. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Have installed the missing DCTfilter but still getting the same error, despite the dll being in the Plugin folder.

    Do i have to remux the seperate m2v and ac3 files from the disc in order to restore the audio?

    It's also strange you have to keep the DVD in the drive when loading the d2v file.

    Code:
    SetMTMode(5, 4)
    Mpeg2Source("C:\Users\Desktop\VTS_01_3.d2v",CPU2="ooooxx", Info=3)
    TNLMeans(Ax=4, Ay=4, Az=0, h=4.0)
    Deblock_QED()
    SetMemoryMax(1000)
    #Return Info() 
    SetMTMode(2)
    AssumeTFF()
    QTGMC( Preset="Medium", SourceMatch=3, Lossless=2, EdiThreads=2)
    Trim(42560,44000)
    Spline36Resize(1024,576)
    Crop(14,0,-8,0)
    AddBorders(14,0,8,0)
    Last edited by Master Tape; 4th Jul 2018 at 15:15.
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Best thing to do is to copy the video_ts folder from the optical drive to the hard disk and access it from there.
    The d2v is just an index to the data, not the data itself (didn't you notice how small the d2v is relative to the original data?)
    Quote Quote  
  8. Originally Posted by Master Tape View Post
    Have installed the missing DCTfilter but still getting the same error, despite the dll being in the Plugin folder.
    I have dctfilter.dll in AviSynth's plugins folder. Make sure it's the right "bitness". Try loading it manually in the script and see if you get an error.

    Originally Posted by Master Tape View Post
    Do i have to remux the seperate m2v and ac3 files from the disc in order to restore the audio?
    Yes. Or you could import the audio into your AviSynth script with NicAudio.

    Originally Posted by Master Tape View Post
    It's also strange you have to keep the DVD in the drive when loading the d2v file.
    The d2v file is just an index file. It doesn't include the video. So the source video has to remain where it is. Rip to your hard drive first if you don't want the DVD spinning all day.

    Originally Posted by Master Tape View Post
    Code:
    SetMTMode(5, 4)
    Mpeg2Source("C:\Users\Desktop\VTS_01_3.d2v",CPU2="ooooxx", Info=3)
    TNLMeans(Ax=4, Ay=4, Az=0, h=4.0)
    Deblock_QED()
    SetMemoryMax(1000)
    #Return Info() 
    SetMTMode(2)
    AssumeTFF()
    QTGMC( Preset="Medium", SourceMatch=3, Lossless=2, EdiThreads=2)
    Trim(42560,44000)
    Spline36Resize(1024,576)
    Crop(14,0,-8,0)
    AddBorders(14,0,8,0)
    I would deblock before tnlmeans. You might want to set Az=2 or so in tnlmeans for some temporal noise reduction. If you find tnlmeans too slow try using deen instead. I don't think it will work quite as well but it may be good enough for you. Or, if you have a supported GPU, use nlmeanscl. Why qtgmc? Do other parts of the video show comb artifacts? Personally, I'd leave the video at 720x576 (or crop to 704x576) and use SAR flags to set the resolution.
    Quote Quote  
  9. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by davexnet View Post
    Best thing to do is to copy the video_ts folder from the optical drive to the hard disk and access it from there.
    The d2v is just an index to the data, not the data itself (didn't you notice how small the d2v is relative to the original data?)
    I tried that but keep getting the error "MPEG2Source: Could not open one of the input files"

    Originally Posted by jagabo View Post
    The d2v file is just an index file. It doesn't include the video. So the source video has to remain where it is. Rip to your hard drive first if you don't want the DVD spinning all day.
    I demuxed the DVD in DGIndex to extract the m2v (video) and ac3 (audio) files. It also created a d2v file, so i don't know why it wants the original DVD still.

    Originally Posted by jagabo View Post
    I have dctfilter.dll in AviSynth's plugins folder. Make sure it's the right "bitness". Try loading it manually in the script and see if you get an error.
    Hurray it finally works.. had copied and pasted the wrong dctfilter, there were several of them (no clue why) and had to figure out the one i just downloaded among the mess that is my downloads folder..

    Originally Posted by jagabo View Post
    Yes. Or you could import the audio into your AviSynth script with NicAudio.
    I'm having problems getting NicAudio to work. What's the best program for muxing the m2v and ac3 files together?

    Originally Posted by jagabo View Post
    I would deblock before tnlmeans. You might want to set Az=2 or so in tnlmeans for some temporal noise reduction. If you find tnlmeans too slow try using deen instead. I don't think it will work quite as well but it may be good enough for you. Or, if you have a supported GPU, use nlmeanscl. Why qtgmc? Do other parts of the video show comb artifacts? Personally, I'd leave the video at 720x576 (or crop to 704x576) and use SAR flags to set the resolution.
    Skimming through, i don't seem to notice any comb artifacts with this particular source but don't you always have to deinterlace for online distribution? as i do plan to upload some clips. I think it's QTGMC that's causing the flickering line at the bottom of the video (or exaggerating it more)

    Would it be wise to add a sharpening filter to counteract the somewhat softer picture, or just leave it as is?
    Quote Quote  
  10. Originally Posted by Master Tape View Post
    I demuxed the DVD in DGIndex to extract the m2v (video) and ac3 (audio) files. It also created a d2v file, so i don't know why it wants the original DVD still.
    If you did that with "Save Project and Demux Video" the d2v file still references the DVD, not the demuxed m2v. If you want to use the demuxed m2v you have to run DgIndex on the m2v file and produce a new index.

    Originally Posted by Master Tape View Post
    What's the best program for muxing the m2v and ac3 files together?
    I use MkvToolNix because I usually create MKV files.

    Originally Posted by Master Tape View Post
    Skimming through, i don't seem to notice any comb artifacts with this particular source but don't you always have to deinterlace for online distribution? as i do plan to upload some clips.
    Your source is encoded interlaced but the content of the frames is progressive. You can just treat it as progressive and encode it progressive.

    Originally Posted by Master Tape View Post
    I think it's QTGMC that's causing the flickering line at the bottom of the video (or exaggerating it more)
    Yes. QTGMC() can be confused by very thin horizontal lines.

    Originally Posted by Master Tape View Post
    Would it be wise to add a sharpening filter to counteract the somewhat softer picture, or just leave it as is?
    If you want. Sharpen(), aWarpSharp2(), FastLineDarkenMod(), Hysteria(), etc. Be aware that sharpening tends to increase noise (including DCT ringing) and create/exacerbate oversharpening halos.
    Quote Quote  
  11. Member
    Join Date
    Aug 2017
    Location
    United States
    Search PM
    Originally Posted by Master Tape View Post
    I think it's QTGMC that's causing the flickering line at the bottom of the video (or exaggerating it more)
    Use the "border=true" parameter in QTGMC to stop that flickering bottom line.
    Quote Quote  
  12. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by jagabo View Post
    If you did that with "Save Project and Demux Video" the d2v file still references the DVD, not the demuxed m2v. If you want to use the demuxed m2v you have to run DgIndex on the m2v file and produce a new index.
    Have done so now, but AviSynth really doesn't want to play nice "MPEGSource: Could not open one of the input files"

    Originally Posted by jagabo View Post
    I use MkvToolNix because I usually create MKV files.
    Worked like a charm. Though how do i extract a d2v file from the mkv?

    Originally Posted by jagabo View Post
    Your source is encoded interlaced but the content of the frames is progressive. You can just treat it as progressive and encode it progressive.
    How do i tell AviSynth it's a progressive source without having to deinterlace?

    Also i've just noticed there is one part in the video that exhibits comb artifacts, only when the end credits roll, but i guess this isnt part of the same source as the cartoons are in a window box next to them and don't show any signs of it.

    Originally Posted by jagabo View Post
    If you want. Sharpen(), aWarpSharp2(), FastLineDarkenMod(), Hysteria(), etc. Be aware that sharpening tends to increase noise (including DCT ringing) and create/exacerbate oversharpening halos.
    Yeah i don't want to overdo it with the sharpening, just a tiny bit to restore some that has been lost. Doesn't Spline64Resize apply a bit of sharpening too?
    Last edited by Master Tape; 5th Jul 2018 at 17:03.
    Quote Quote  
  13. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by SaurusX View Post
    Originally Posted by Master Tape View Post
    I think it's QTGMC that's causing the flickering line at the bottom of the video (or exaggerating it more)
    Use the "border=true" parameter in QTGMC to stop that flickering bottom line.
    Cheers, will come in useful if that problem crops up again.
    Quote Quote  
  14. Originally Posted by Master Tape View Post
    Originally Posted by jagabo View Post
    If you did that with "Save Project and Demux Video" the d2v file still references the DVD, not the demuxed m2v. If you want to use the demuxed m2v you have to run DgIndex on the m2v file and produce a new index.
    Have done so now, but AviSynth really doesn't want to play nice "MPEGSource: Could not open one of the input files"

    Originally Posted by jagabo View Post
    I use MkvToolNix because I usually create MKV files.
    Worked like a charm. Though how do i extract a d2v file from the mkv?
    I'm not sure what you're doing here. I recommend you copy the contents of the DVD to your hard drive, then use DgIndex to build a d2v file from that copy, finally use Mpeg2Source to open that d2v file. Once you are done cleaning and encoding your new video mux with the AC3 audio.

    Or, if you don't have enough hard drive space to copy the entire DVD to your hard drive (or can't for some other reason): use DgIndex to open your VOB files directly from the DVD, mark the episode you want, then "Save Project and Demux Video". Then discard the d2v file and run DgIndex again, open the m2v file created by the first step, and "Save Project" to create a new d2v file. Finally open that d2v file with Mpeg2Source() to do your cleaning and encoding.

    Originally Posted by Master Tape View Post
    How do i tell AviSynth it's a progressive source without having to deinterlace?
    You don't have to do anything. AviSynth doesn't really even know if your video is progressive or interlaced. Just skip the QTGMC step.

    Originally Posted by Master Tape View Post
    Also i've just noticed there is one part in the video that exhibits comb artifacts, only when the end credits roll, but i guess this isnt part of the same source as the cartoons are in a window box next to them and don't show any signs of it.
    What you're seeing is common with broadcast video. Stuff overlaid by the broadcaster may not match the main program. If you really want to get rid of the combing in those sections use QTGMC().SelectEven() just on those sections (SelectEven() to restore the 25 fps frame rate).

    Originally Posted by Master Tape View Post
    Doesn't Spline64Resize apply a bit of sharpening too?
    Yes, many of the resizers sharpen: Bicubic, Lanczos, Spline16/36/64, etc.
    Quote Quote  
  15. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by jagabo View Post
    I'm not sure what you're doing here. I recommend you copy the contents of the DVD to your hard drive, then use DgIndex to build a d2v file from that copy, finally use Mpeg2Source to open that d2v file. Once you are done cleaning and encoding your new video mux with the AC3 audio.

    Or, if you don't have enough hard drive space to copy the entire DVD to your hard drive (or can't for some other reason): use DgIndex to open your VOB files directly from the DVD, mark the episode you want, then "Save Project and Demux Video". Then discard the d2v file and run DgIndex again, open the m2v file created by the first step, and "Save Project" to create a new d2v file. Finally open that d2v file with Mpeg2Source() to do your cleaning and encoding.
    Ah that's where i went wrong.. i assumed 'Save Project' was just saving it for later, can finally take the DVD out of my drive now lol. I'm not encoding the entire DVD in this instance, just specific clips, so not sure how to mux the 25 minute audio file to a 1 minute clip?

    Have dragged just the VOB were the special features section is stored, so working with that.

    Originally Posted by jagabo View Post
    What you're seeing is common with broadcast video. Stuff overlaid by the broadcaster may not match the main program. If you really want to get rid of the combing in those sections use QTGMC().SelectEven() just on those sections (SelectEven() to restore the 25 fps frame rate).
    So would i have to render those parts seperate then later join them up in ffmpeg? Just incase this situation pops up again in future.
    Quote Quote  
  16. To remove noise and other artefacts in animations I just use MDegrain2+HQDN3D

    Code:
    Loadplugin("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\mvtools\mvtools2.dll")
    super=MSuper(video,pel=2)
    fv1=MAnalyse(super,isb=false,delta=1,overlap=4)
    bv1=MAnalyse(super,isb=true,delta=1,overlap=4)
    fv2=MAnalyse(super,isb=false,delta=2,overlap=4)
    bv2=MAnalyse(super,isb=true,delta=2,overlap=4)
    video=MDegrain2(video,super,bv1,fv1,bv2,fv2,thSAD=400)
    LoadPlugin("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\hqdn3d\hqdn3d.dll")
    LoadPlugin("C:\Users\Dave\Documents\Delphi_Projects\RipBot264\_Compiled\Tools\AviSynth plugins\flash3kyuu_deband\flash3kyuu_deband.dll")
    video=hqdn3d(video,6,0,0,0).f3kdb
    Example before and after


    Last edited by Atak_Snajpera; 6th Jul 2018 at 08:48.
    Quote Quote  
  17. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    One more thing, how do you get rid of this annoying artifact, seen at the beginning of these two clips, when it usually pans into something, like these buildings for example?
    Image Attached Files
    Quote Quote  
  18. QTGMC cleans that up a bit:

    Code:
    TurnRight().QTGMC(InputType=3).TurnLeft().QTGMC(InputType=3)
    The first one cleans vertical lines, the second horizontal lines. before and after:
    Image Attached Files
    Last edited by jagabo; 18th Jul 2018 at 19:59.
    Quote Quote  
  19. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Thanks, that's great! It's amazing what all these different filters can do/clean up. A big thank you for all your help on this jagabo, without would not have been possible
    Quote Quote  
  20. Be aware that two consecutive QTGMC calls will be very slow.
    Quote Quote  



Similar Threads