Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st December 2018, 22:49   #1  |  Link
Mawazi
Registered User
 
Join Date: Dec 2007
Posts: 20
Inconsistent behavior of script in Avspmod vs ffmpeg

I'm having a frustrating issue.

I have two scripts for converting Doctor Who back to 25fps from the 1080i60 contained on the Blu-rays.

The first script just runs QTGMC which gives me 1080p60, but with duplicates. I put this through ffmpeg using hevc lossless.

Then the second script loads that lossless mkv file and puts it through srestore.

This seems to mostly work. However, viewing that second script in Avspmod, everything looks very smooth frame to frame. When I encode that same script using ffmpeg, there are issues. A repeated frame, then skipping the following unique frame. This mainly happens in scenes with little motion, like two vehicles moving towards each other on a road, filmed from a long distance.

Is there any known reason for this inconsistency?

Thanks.
Mawazi is offline   Reply With Quote
Old 21st December 2018, 23:03   #2  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 183
I would first determine what the source actually contains.

If the original was recorded 25p and sped down to 24p and telecined to 60i you should use an inverse telecine operation, not QTGMC, and optionally a speed up if you want to get the original 25p speed back.
But if the original was 50i and now it is 60i there could be all kind of things that have happened. In that case you have to scan frame by frame and see if you can detect a pattern to determine the best approach to take.

Last edited by Cary Knoop; 21st December 2018 at 23:11.
Cary Knoop is online now   Reply With Quote
Old 21st December 2018, 23:09   #3  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,810
Could ffmpeg be accessing frames out of order for some reason? That will stuff srestore up.

PS Which blu-rays are these?
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 21st December 2018, 23:22   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,920
As usual, post your script(s)

What format was the ffmpeg output, and how are you checking it? How do you know it's not a decoding/playback issue of the ffmpeg output ?

Post your ffmpeg commandline . Double check your framerates. "1080p60" isn't really 60.0 fps . A discrepancy between avs framerate and -r entered for ffmpeg can cause these sorts of issues too

Another possible culprit might be the source filters used

Was it I-frame HEVC lossless after the 1st step ? Any reason for using HEVC ?
poisondeathray is offline   Reply With Quote
Old 22nd December 2018, 23:32   #5  |  Link
Mawazi
Registered User
 
Join Date: Dec 2007
Posts: 20
Thank you everyone for your responses.

Indeed, it ended up that I was overthinking it (or, at least, wrongly thinking it) using QTGMC and srestore.

I found that tfm(mode=5) and tdecimate(cycle=6) did the job just fine.

Sorry for wasting everyone's time.

Here's my final (famous last words) script:

Code:
FFmpegSource2("DOCTOR_WHO_SERIES_6_SPECIAL_EDITION_BOXSET_DISC_2.Title801.mkv", atrack=-1)
tfm(mode=5,pp=0)
tdecimate(cycle=6)
before=last
removegrain(mode=17)
repair(last, before, mode=17)
assumefps(25,sync_audio=true)
ssrc(48000)
I'm not 100% sure that I'm using repair properly, as I couldn't find too much information on exactly how it works.
Mawazi is offline   Reply With Quote
Old 22nd December 2018, 23:58   #6  |  Link
Mawazi
Registered User
 
Join Date: Dec 2007
Posts: 20
Quote:
Originally Posted by poisondeathray View Post
As usual, post your script(s)

What format was the ffmpeg output, and how are you checking it? How do you know it's not a decoding/playback issue of the ffmpeg output ?

Post your ffmpeg commandline . Double check your framerates. "1080p60" isn't really 60.0 fps . A discrepancy between avs framerate and -r entered for ffmpeg can cause these sorts of issues too

Another possible culprit might be the source filters used

Was it I-frame HEVC lossless after the 1st step ? Any reason for using HEVC ?
Though I figured out the 'correct' way to do it, the issue I ran into is still an interesting one.

Yes, HEVC lossless (-x265-params "lossless=1") with the first step. HEVC seemed to provide a smaller lossless file than other options I had tested, but my tests certainly weren't exhaustive. I only had around 400GB of free space on the HD, didn't want to fill it up.

I used ffmpegsource2 for both step 1 and step 2, with the original container being mkv (ripped using DVD Fab).

First script:
Code:
FFmpegSource2("DOCTOR_WHO_SERIES_6_SPECIAL_EDITION_BOXSET_DISC_2.Title801.mkv")
qtgmc(preset="very slow",nneurons=4,sourcematch=3,matchpreset="very slow",tr2=1,lossless=2,matchenhance=1.0,noiseprocess=0,edithreads=1,fftthreads=1)
#srestore()
prefetch(8)
Second script:
Code:
FFmpegSource2("s6e2-hevc-lossless1.mkv")
#qtgmc(preset="very slow",nneurons=4,sourcematch=3,matchpreset="very slow",tr2=1,lossless=2,matchenhance=1.0,noiseprocess=0,edithreads=1,fftthreads=1)
srestore()
#prefetch(8)
Unfortunately, I don't have the exact ffmpeg command, as my PC restarted overnight and I lost my cmd history (and I hadn't copy-pasted it to a txt file, which I usually try to do).

They were very basic commands, though, very close to:
ffmpeg -i dw3.avs -c:v hevc -x265-params "lossless=1" s6e2-hevc-lossless1.mkv
ffmpeg -i dw4.avs -i originalmkv.mkv -map 0:v -map 1:a -c:v hevc -tag:v hvc1 -crf 20 -preset slow -c:a ac3 -b:a 320k -map_metadata -1 s6e2-final.mp4

The tag:v hvc1 is there to make the file play through Apple TV, also why I used mp4 as the final container.
Mawazi is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:25.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.