This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

mpeg2 mkv to x264 mp4 always heavy artifacts
#11
Somehow, when I switch Config>containers>FFmpeg instead of MP4Box, everything is excellent! Everything plays nicely, fluent, deinterlaced, no artifacts. Are there any downsides using ffmpeg instead of MP4BOX?
Reply
#12
Some programs have problems with mp4box others with ffmpeg muxes mp4/mov files.
Since most programs handle mp4box better, Hybrid by default uses mp4box.

Cu Selur
Reply
#13
Here's a script I would use as a base:
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("I:/Hybrid/64bit/vsfilters/Support/libfftw3-3.dll")
Dllref = ctypes.windll.LoadLibrary("I:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DebandFilter/Flash3kDeband/flash3kyuu_deband.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/vcmod.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/EEDI3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/temporalsoften.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import mvsfunc
import muvsfunc
import G41Fun
import lostfunc
import havsfunc
# source: 'C:\Users\Selur\Desktop\1.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
# Loading C:\Users\Selur\Desktop\1.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/1.mkv", format="YUV420P8", cache=0, fpsnum=25, prefer_hw=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# setting field order to what QTGMC should assume (top field first)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
# Deinterlacing using QTGMC
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 50
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
# adjusting frame count and rate with sRestore
clip = havsfunc.srestore(source=clip, frate=23.976, omode=6, speed=9, thresh=16, mode=2)
clip = clip = lostfunc.DeSpot(o=clip)
# applying deblocking using DeBlock QED
clip = clip = havsfunc.Deblock_QED(clip)
# denoising using mClean
clip = clip = G41Fun.mClean(clip=clip)
# contrast sharpening using CAS
clip = core.cas.CAS(clip=clip, sharpness=0.800)
# adjusting output color from: YUV420P16 to YUV420P8 for x264Model (i420@8)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# Output
clip.set_output()
I attached the filter settings.
Not sure whether the original was PAL or NTSC, so I used sRestore to go for NTSC instead of PAL.
Also note that there are probably way better filtering settings, but this is what I would start with. Smile

Cu Selur
Reply
#14
(28.01.2021, 17:20)Selur Wrote: Here's a script I would use as a base:
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("I:/Hybrid/64bit/vsfilters/Support/libfftw3-3.dll")
Dllref = ctypes.windll.LoadLibrary("I:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DebandFilter/Flash3kDeband/flash3kyuu_deband.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/vcmod.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/EEDI3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/temporalsoften.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import mvsfunc
import muvsfunc
import G41Fun
import lostfunc
import havsfunc
# source: 'C:\Users\Selur\Desktop\1.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
# Loading C:\Users\Selur\Desktop\1.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/1.mkv", format="YUV420P8", cache=0, fpsnum=25, prefer_hw=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# setting field order to what QTGMC should assume (top field first)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
# Deinterlacing using QTGMC
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 50
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
# adjusting frame count and rate with sRestore
clip = havsfunc.srestore(source=clip, frate=23.976, omode=6, speed=9, thresh=16, mode=2)
clip = clip = lostfunc.DeSpot(o=clip)
# applying deblocking using DeBlock QED
clip = clip = havsfunc.Deblock_QED(clip)
# denoising using mClean
clip = clip = G41Fun.mClean(clip=clip)
# contrast sharpening using CAS
clip = core.cas.CAS(clip=clip, sharpness=0.800)
# adjusting output color from: YUV420P16 to YUV420P8 for x264Model (i420@8)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# Output
clip.set_output()
I attached the filter settings.
Not sure whether the original was PAL or NTSC, so I used sRestore to go for NTSC instead of PAL.
Also note that there are probably way better filtering settings, but this is what I would start with. Smile

Cu Selur
Cu Selur, thank you very much for your hard work! I have managed to solve the artifacting issue! It was problem in my computer, MPC-HC told me I was missing some codecs, I was not using MPC-HC before, I was using VLC which didn't told me anything. I was blaming the program and it was my PC.
So the last problem I have, Hybrid doesn't load audio tracks when ripping DVDs. It is not a major issue as I can rip DVDs with makemkv and than load it into Hybrid.
I have also installed Hybrid to dad's PC and there also does not load audio track.
If you would like to take a look on this issue, I have uploaded whole DVD image:
https://www.uschovna.cz/en/zasilka/HNBZGU2RXG35I8VA-A7I
I have also one question bothering me, I would like to know, which codec would you prefer, if you would have to choose between VP9 or h264.

Anyway, thank you very much for spending time and answering my noob questions. Hybrid is now my new primary encoding software.
Filip
Reply
#15
Will look at the dvd later.
I would always use H.264 over VP9.

Cu Selur
Reply
#16
Also Selur why, when I load file into Hybrid, Pixel aspect ratio is not 1X1 but sometimes 2000x1000 or 16x15

   

Hybrid tells me default is 1:1 so why it always resets ? In my MKV file, it is 16x15 when I leave it and reencode it, the final video is 5:4 and not original 4:3.
I was trying to find answers on internet but couldn't find any.
Reply
#17
Quote:Also Selur why, when I load file into Hybrid, Pixel aspect ratio is not 1X1 but sometimes 2000x1000 or 16x15
Input pixel aspect ratio, shows the pixel aspect ration of the source that was imported.
This aspect ration is read from the headers of the file using media info.

Quote:when I leave it and reencode it, the final video is 5:4 and not original 4:3.
You are mixing Pixel Aspect Ratio with Display Aspect Ratio.
-> if you don't know the difference you should read up on that.
[INFO] About pixel aspect ratios,.. + Wikis in you language about pixel aspect ratio etc.
When feeding Hybrid with anamorphic content the pixel aspect ratio is not 1:1 (true for most DVD from the last 10+ years)

If you want square pixel (1:1) output, enable 'Convert output to PAR' and set it to 'Square Pixel (1:1)', this way Hybrid will enable resizing to archive 1:1 PAR while maintaining not causing stretched or squeezed heads. Smile

Cu Selur
Reply
#18
Okay, I loaded the the DVD into Hybrid and I can confirm that Hybrid ignores the audio since mplayer reports:
Quote:ds_fill_buffer: EOF reached (stream: audio)
MPEG: No audio stream found -> no sound.
I'll try to find a workaround for this.

Cu Selur
Reply
#19
Think I found a workaround.
-> will send you a link to a new dev version in ~15min.

Cu Selur
Reply
#20
(29.01.2021, 21:06)Selur Wrote: Think I found a workaround.
-> will send you a link to a new dev version in ~15min.

Cu Selur

Thank you very much Cu Selur, this is all I needed to know.

edit: I confirm DVD audio extraction is working
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)