VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 34
Thread
  1. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    In Avisynth+? When i use Sharpen, it makes the picture look better and a bit more detailed, but the side effect is it highlights all compression artifacts, macroblocks and mosquito noise, ect. Is there any script that just focuses on sharpening the image and not all the other junk?
    Quote Quote  
  2. Re: Is there a way to sharpen video without sharpening the artifacts?
    Not Really.
    Other sharpening algorithms (there are plenty to choose from) may achieve better results on your source however.

    An Edge sharpening method for instance would only attempt to sharpen detected edges.
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    I think i've found one that does the job. ASharp

    Adaptive thresholding to avoid noise enhancement.
    Block adaptive sharpening to avoid DCT block edges enhancement.
    Block based adaptive thresholding to avoid DCT block edges enhancement.
    But... i can't seem to get it to run with Avisynth+ looks like it was only designed for 32-bit versions of Avisynth.
    Quote Quote  
  4. Originally Posted by Master Tape View Post

    But... i can't seem to get it to run with Avisynth+ looks like it was only designed for 32-bit versions of Avisynth.

    You can run almost any x86 avs filter in x64 avs+ with mp_pipeline

    It's unlikely that you will avoid enhancing the noise with any single filter
    Quote Quote  
  5. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Master Tape View Post

    But... i can't seem to get it to run with Avisynth+ looks like it was only designed for 32-bit versions of Avisynth.

    You can run almost any x86 avs filter in x64 avs+ with mp_pipeline

    It's unlikely that you will avoid enhancing the noise with any single filter
    Can't get it to work. It says "MP_Pipeline: Can't find any splitter"

    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("QTGMC", 2)
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_1.d2v", CPU2="ooooxx", Info=3)
    AssumeTFF()
    AssumeFPS(25)
    QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true)
    Spline64Resize(960,720)
    Crop(0,0,-6,0)
    AddBorders(0,0,6,0)
    LoadPlugin("C:\Program Files\AviSynth+\plugins64+\MP_Pipeline.dll")
    SetMemoryMax(1)
    MP_Pipeline("""
    ### platform: win32
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\asharp.dll")
    """)
    Prefetch(5)
    Quote Quote  
  6. You need to specify win64 and win32 sections , each divided up by ### ###

    Because you're using CPU2= for mpeg2source, this requires the x86 version

    The entire script that passes through win32/win64 sections has to be enclosed within MP_Pipeline


    It would look like this

    Code:
    MP_Pipeline("""
    
    ### platform: win32
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_1.d2v", CPU2="ooooxx", Info=3)
    ### ###
    
    ### platform: win64
    AssumeTFF()
    AssumeFPS(25)
    QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true)
    Spline64Resize(960,720)
    Crop(0,0,-6,0)
    AddBorders(0,0,6,0)
    ### ###
    
    ### platform: win32
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\asharp.dll")
    asharp()
    ### ###
    """)
    The prefetch values probably need to be adjusted, because each process can use separate prefetch with thread chunking and branching. You can use avsmeter64 to play with it and see what works best. It's quite complex, the optimal value might not be simple as using one single prefetch value
    Quote Quote  
  7. There are many ways to sharpen a video without sharpening "artifacts". What you do depends on the type and severity of artifacts. In some cases you can reduce the artifacts before sharpening (DCT ringing and blocking, grain, etc.). In others you can limit sharpening only to certain types of features using Overlay() and a mask. You need to provide a sample.
    Quote Quote  
  8. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by poisondeathray View Post
    You need to specify win64 and win32 sections , each divided up by ### ###

    Because you're using CPU2= for mpeg2source, this requires the x86 version

    The entire script that passes through win32/win64 sections has to be enclosed within MP_Pipeline


    It would look like this

    Code:
    MP_Pipeline("""
    
    ### platform: win32
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_1.d2v", CPU2="ooooxx", Info=3)
    ### ###
    
    ### platform: win64
    AssumeTFF()
    AssumeFPS(25)
    QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true)
    Spline64Resize(960,720)
    Crop(0,0,-6,0)
    AddBorders(0,0,6,0)
    ### ###
    
    ### platform: win32
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\asharp.dll")
    asharp()
    ### ###
    """)
    The prefetch values probably need to be adjusted, because each process can use separate prefetch with thread chunking and branching. You can use avsmeter64 to play with it and see what works best. It's quite complex, the optimal value might not be simple as using one single prefetch value
    Thanks alot it's loading fine now. Though after having used it, it's highlighting the noise too much, noise that didn't look too noticeable before sharpening.

    Originally Posted by jagabo View Post
    There are many ways to sharpen a video without sharpening "artifacts". What you do depends on the type and severity of artifacts. In some cases you can reduce the artifacts before sharpening (DCT ringing and blocking, grain, etc.). In others you can limit sharpening only to certain types of features using Overlay() and a mask. You need to provide a sample.
    Yes this sounds like the best way to do it. Reduce the artifacts before applying Sharpen. But maybe a subtle less is more approach to improve the source without over-doing it.

    I want to try using EzNoise with QTGMC, but i'm getting another script error "There is no function named 'sneo_FFT3D"
    Quote Quote  
  9. Originally Posted by Master Tape View Post
    I want to try using EzNoise with QTGMC, but i'm getting another script error "There is no function named 'sneo_FFT3D"
    You need neoFFT3D and Zs_RF_Shared.avsi

    https://forum.doom9.org/showthread.php?t=181294
    https://forum.doom9.org/showthread.php?t=174121
    Quote Quote  
  10. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Master Tape View Post
    I want to try using EzNoise with QTGMC, but i'm getting another script error "There is no function named 'sneo_FFT3D"
    You need neoFFT3D and Zs_RF_Shared.avsi

    https://forum.doom9.org/showthread.php?t=181294
    https://forum.doom9.org/showthread.php?t=174121
    Thanks poison. Still i'm not pleased with the result from EzDenoise, as Sharpening still highlights all the noise. However think i've finally found a sharpener that sharpens without sharpening all the noise aswell,

    UnsharpMask(strength=32, radius=3, threshold=8)

    Though i dialed down the strength a bit.

    One more issue with the video i'm having is relating to the trims. There's a small segment in which a CGI source shimmers, and i apply TFM to it, but the trims just don't add up. I search through the video and make a note of where i want the trims.. add them then when i return(vid2) it goes to somewhere else in the video, like 4 minutes after from where i want it applied. And the shimmer remains as it hasn't been applied to the correct frames.

    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("QTGMC", 2)
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_1.d2v", CPU2="ooooxx", Info=3)
    AssumeTFF()
    AssumeFPS(25)
    vid1 = trim(0,12310).AssumeTFF().AssumeFPS(25).QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid2 = trim(12311,12577).AssumeTFF().AssumeFPS(25).TFM(pp=0).ChangeFPS(50).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid3 = trim(12147,32820).AssumeTFF().AssumeFPS(25).QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid1 ++ vid2 ++ vid3
    Prefetch(5)
    Quote Quote  
  11. Originally Posted by Master Tape View Post
    One more issue with the video i'm having is relating to the trims. There's a small segment in which a CGI source shimmers, and i apply TFM to it, but the trims just don't add up. I search through the video and make a note of where i want the trims.. add them then when i return(vid2) it goes to somewhere else in the video, like 4 minutes after from where i want it applied. And the shimmer remains as it hasn't been applied to the correct frames.

    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("QTGMC", 2)
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_1.d2v", CPU2="ooooxx", Info=3)
    AssumeTFF()
    AssumeFPS(25)
    vid1 = trim(0,12310).AssumeTFF().AssumeFPS(25).QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid2 = trim(12311,12577).AssumeTFF().AssumeFPS(25).TFM(pp=0).ChangeFPS(50).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid3 = trim(12147,32820).AssumeTFF().AssumeFPS(25).QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid1 ++ vid2 ++ vid3
    Prefetch(5)

    The trims are applied to the original 25fps frame numbers. Not the 50fps frame numbers. Is that what you wanted ? If not, then adjust the trims
    Quote Quote  
  12. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Master Tape View Post
    One more issue with the video i'm having is relating to the trims. There's a small segment in which a CGI source shimmers, and i apply TFM to it, but the trims just don't add up. I search through the video and make a note of where i want the trims.. add them then when i return(vid2) it goes to somewhere else in the video, like 4 minutes after from where i want it applied. And the shimmer remains as it hasn't been applied to the correct frames.

    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("QTGMC", 2)
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_1.d2v", CPU2="ooooxx", Info=3)
    AssumeTFF()
    AssumeFPS(25)
    vid1 = trim(0,12310).AssumeTFF().AssumeFPS(25).QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid2 = trim(12311,12577).AssumeTFF().AssumeFPS(25).TFM(pp=0).ChangeFPS(50).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid3 = trim(12147,32820).AssumeTFF().AssumeFPS(25).QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true).Crop(0,0,-6,-4).UnsharpMask(strength=32, radius=3, threshold=8).Spline64Resize(960,720)
    vid1 ++ vid2 ++ vid3
    Prefetch(5)

    The trims are applied to the original 25fps frame numbers. Not the 50fps frame numbers. Is that what you wanted ? If not, then adjust the trims
    Thanks, after much trial and error i got there in the end.

    I've also since applied MosquitoNR and that seems to have helped a bit with the MPEG noise. But FFMpeg refuses to render with it in the line. Only when i remove it, it then renders fine.
    Quote Quote  
  13. Originally Posted by Master Tape View Post
    But FFMpeg refuses to render with it in the line. Only when i remove it, it then renders fine.
    64bit vs 32bit? Multithreading issue?

    Lots of others: http://avisynth.nl/index.php/External_filters#Deringing_.26_Mosquito_Noise
    Quote Quote  
  14. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by Master Tape View Post
    But FFMpeg refuses to render with it in the line. Only when i remove it, it then renders fine.
    64bit vs 32bit? Multithreading issue?

    Lots of others: http://avisynth.nl/index.php/External_filters#Deringing_.26_Mosquito_Noise
    It seemed so, as using the 32-bit plugin and loading it via pipeline sorted it.

    Also when you are loading from the index file, how do you load the audio from the file aswell? As don't want to remux it afterwards if i want to trim something frame accurately.
    Quote Quote  
  15. The index for mpeg2source is only for video. Use an audio source filter with AudioDub(video, audio) . There are examples in the documentation

    You can use other audio source filters such as FFAudioSource, or LWLibavAudioSource as well

    If you are editing sections (e.g. cutting segments out, extending segments, etc..), you need to apply trims to audio as well, otherwise you will go out of sync
    Quote Quote  
  16. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Hmm after i render, ffmpeg compresses the sound to only 128kbps, when the original audio is 384kbps. Is there a way to directly transcode the original audio but have AvsPmod trim it with the video?
    Quote Quote  
  17. You can set the audio bitrate in ffmpeg e.g. -b:a 384k

    If you use an avs script, it's (frame)serving uncompressed audio and video, so you are re-encoding both

    If you're not doing edits that change the duration, you can keep the original audio (stream copy)
    Quote Quote  
  18. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    For some reason i'm getting a maximum of 360kbps, but it's not too much of a difference so can live with it.

    I'll shift the -192ms sound delay in avidemux, since i think you can only offset the sound in ffmpeg when both video and audio are separate.
    Quote Quote  
  19. What type of audio ? AAC ? Stereo ? 360kbps is a lot for stereo AAC

    You can delay audio in the script too
    http://avisynth.nl/index.php/DelayAudio

    When you use DGIndex, usually the delay value is written into the name of the demuxed audio

    You can preview the script for sync in mpchc, just comment out the slow filters temporarily
    Quote Quote  
  20. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    It is MP2 audio, from recordable DVDs.

    Thanks, didn't know there was a script that could do that. Will come in useful.

    Whilst everything is working fine normally, when i render with MP_Pipeline on, i'm getting no audio. And applying the trims to audio and video didn't help. I only need to apply the trims once as always, when not using MP_Pipeline.

    MP_Pipeline("""

    ### platform: win64
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("QTGMC", 2)
    video = MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_2.d2v", CPU2="ooooxx", Info=3)
    audio = FFAudioSource("F:\A Video Files\DVD Rips\VTS_01_2 Tc0 L2 2ch 48 384 DELAY -192ms.mp2")
    AudioDub(video, audio)
    DelayAudio(-0.192)

    ### ###
    ### platform: win32
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\MosquitoNR.dll")
    MosquitoNR()
    ### ###
    ### platform: win64
    AssumeTFF()
    AssumeFPS(25)
    QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true)
    Crop(0,0,-6,-4)
    UnsharpMask(strength=32, radius=3, threshold=8)
    Spline64Resize(960,720)
    Trim(15498,34887)
    Prefetch(5)
    ### ###
    """)
    Quote Quote  
  21. Audio was not supported in the original mp_pipeline, it probably still isn't in the newer version

    Bring the audio and audiodub outside of mp_pipeline

    something like this
    Code:
    MP_Pipeline("""
    .
    .
    .
    """) 
    
    vid = last
    
    aud = FFAudioSource("F:\A Video Files\DVD Rips\VTS_01_2 Tc0 L2 2ch 48 384 DELAY -192ms.mp2")
    
    AudioDub(video, audio)
    DelayAudio(-0.192)
    Quote Quote  
  22. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    MP_Pipleline: Unable to create slave process. Message: Script error: Script error: Invalid arguements to function 'MPP_PrepareDownstreamClip'.
    Quote Quote  
  23. Code:
    MP_Pipeline("""
    
    ### platform: win64
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("QTGMC", 2)
    MPEG2Source("F:\A Video Files\DVD Rips\VTS_01_2.d2v", CPU2="ooooxx", Info=3)
    
    ### ###
    ### platform: win32
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\MosquitoNR.dll")
    MosquitoNR()
    ### ###
    ### platform: win64
    AssumeTFF()
    AssumeFPS(25)
    QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, Lossless=2, TR2=2, EdiThreads=2, border=true)
    Crop(0,0,-6,-4)
    UnsharpMask(strength=32, radius=3, threshold=8)
    Spline64Resize(960,720)
    Trim(15498,34887)
    Prefetch(5)
    ### ###
    """) 
    
    vid = last
    
    aud = FFAudioSource("F:\A Video Files\DVD Rips\VTS_01_2 Tc0 L2 2ch 48 384 DELAY -192ms.mp2")
    
    AudioDub(vid, aud)
    DelayAudio(-0.192)

    I don't know if that's ideal for multithreading. mp_pipeline has it's own branch threading and chunking. It takes a bit of testing to get the ideal values.
    Quote Quote  
  24. Note that the 64 bit version of Mpeg2Source() doesn't implement the DCT deblocking and deringing filters. Try switching to the 32 bit version and you may not need MosquitoNR().
    Quote Quote  
  25. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Originally Posted by jagabo View Post
    Note that the 64 bit version of Mpeg2Source() doesn't implement the DCT deblocking and deringing filters. Try switching to the 32 bit version and you may not need MosquitoNR().
    Ohright i didn't realise. I can't preview it right now due to the error blocking it.

    Image
    [Attachment 54710 - Click to enlarge]


    Also it wasn't mosquito noise perse i was trying to eliminate, but dot crawl, since i didn't know what they were exactly, till i Googled.
    Last edited by Master Tape; 1st Sep 2020 at 18:17.
    Quote Quote  
  26. Set the MPEG2Source() section to 32bit to use the 32bit version

    ### platform: win32
    Quote Quote  
  27. DCT deblocking won't help with dot crawl artifacts. Here's how you can use it with mp_pipeline though:

    Code:
    MP_Pipeline(""" 
    ### platform: win32 
    Mpeg2Source("filename.d2v", CPU2="ooooxx", Info=3) 
    ### ### 
    """) 
    
    # 64 bit stuff
    Quote Quote  
  28. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    Solved the problem. I had to remove the "video =" reference next to MPEG2Source
    Quote Quote  
  29. Member
    Join Date
    Aug 2013
    Location
    Scotland
    Search PM
    How do you apply trims within MP_Pipeline? Seems like you have to do it a different way as just getting errors when i return(vid1) (vid2) ect. And with AudioDub() being outisde of it, makes things more confusing.
    Quote Quote  



Similar Threads