cogman
30th April 2021, 21:03
I'm currently working on this ( https://www.amazon.com/Sherlock-Season-Blu-ray-Benedict-Cumberbatch/dp/B004132I20 ) and can't seem to figure out the right incantation to get it deinterlaced.
What I've observed,
It looks like nearly every interlaced frame is duplicated one after the other (I've found 1 or 2 exceptions in ~30 second samples). Pulling in the source without forcing a CFR causes the deinterlace algorithm to go nuts. Motion seems to advance forward then backwards at weird intervals.
Forcing CFR seems to MOSTLY fix things, however, there is still some weird jank I've not figured out. It's almost as if very brief clips (not present in the source) will jump into the wrong place. I suspect that it's a problem with ffms2 seekmode and h.264? (testing that now).
Here is my current best attempt
from vapoursynth import core
import havsfunc as haf
clip = core.ffms2.Source(source='/input/S01E01.mkv', threads=1, fpsnum=30000, fpsden=1001)
clip = haf.QTGMC(clip, Preset='Fast', TFF=True, EZDenoise=0.5, Denoiser='KNLMeansCL', opencl=True)
clip.set_output()
And here is some FFProbe info.
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/60000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1920
height=1080
coded_width=1920
coded_height=1088
closed_captions=0
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=41
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=tt
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:BPS-eng=29451715
TAG:DURATION-eng=01:28:10.618666666
TAG:NUMBER_OF_FRAMES-eng=317120
TAG:NUMBER_OF_BYTES-eng=19477222333
TAG:SOURCE_ID-eng=001011
TAG:_STATISTICS_WRITING_APP-eng=MakeMKV v1.16.3 linux(x64-release)
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2021-04-21 01:46:32
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
What I've observed,
It looks like nearly every interlaced frame is duplicated one after the other (I've found 1 or 2 exceptions in ~30 second samples). Pulling in the source without forcing a CFR causes the deinterlace algorithm to go nuts. Motion seems to advance forward then backwards at weird intervals.
Forcing CFR seems to MOSTLY fix things, however, there is still some weird jank I've not figured out. It's almost as if very brief clips (not present in the source) will jump into the wrong place. I suspect that it's a problem with ffms2 seekmode and h.264? (testing that now).
Here is my current best attempt
from vapoursynth import core
import havsfunc as haf
clip = core.ffms2.Source(source='/input/S01E01.mkv', threads=1, fpsnum=30000, fpsden=1001)
clip = haf.QTGMC(clip, Preset='Fast', TFF=True, EZDenoise=0.5, Denoiser='KNLMeansCL', opencl=True)
clip.set_output()
And here is some FFProbe info.
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/60000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1920
height=1080
coded_width=1920
coded_height=1088
closed_captions=0
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=41
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=tt
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:BPS-eng=29451715
TAG:DURATION-eng=01:28:10.618666666
TAG:NUMBER_OF_FRAMES-eng=317120
TAG:NUMBER_OF_BYTES-eng=19477222333
TAG:SOURCE_ID-eng=001011
TAG:_STATISTICS_WRITING_APP-eng=MakeMKV v1.16.3 linux(x64-release)
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2021-04-21 01:46:32
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID