View Full Version : AutoMKV and Frame Rate Changes


DoctorM
18th July 2008, 21:06
I've worked with video where I wanted to remove interlacing and restore frame rates while encoding. Since I have successfully managed this, I wanted to share my results.

The 2 cases I've worked with now is PAL interlaced material (from film) with blended fields (25 to 23.976), and NTSC interlaced material from a PAL 25fps source (29.97 to 25).

0) Grab Mrestore (and it's support filters). Rename Mrestore.avi as Mrestore.avsi and place in your avisynth plugins folder.

1) Configure AutoMKV. On the Advanced Settings page, set "Deinterlacer" to None, check the "Last line AVS Script" box and enter:
Ord=last.getparity() ? 1 : 0.LeakKernelBob(Order=Ord).MRestore()

(Mrestore's default setting can manage many common fps changes without parameters)

2) Encode

3)Your output file will now be out of sync. Easy.

Create a text file with the following (with the number being your desired frame rate):
# timecode format v1
assume 25

Name it whatever you want. Fps.txt is fine.

4) Load your MKV file in MKVMerge GUI. Click on the video stream in the "Tracks" box.
Below where it says "Timecodes", click the browse button and point it to your text file (Fps.txt).

5) Start muxing (use a different name of course) and you're done.


I'm sure steps 3-5 can be avoided, but (and maybe it's me) I cannot get the Change FPS features to work on AutoMKV's Advanced Profiles tab. My output frame rate always matches my input regardless of how I configure it. If it did work, it'd be easier to select "AssumeFPS" and enter your new frame rate.

Cheers.

Edit: In place of MRestore, for other uses, telecide & decimate should work in step one.
For example 59.94p to 23.976p, you could use fdecimate(rate=23.976).
Or 29.97i to 23.976p (hard telecine): Ord=last.getparity() ? 1 : 0.telecide(order=Ord).decimate(5), etc.
You would still need to correct the mkv's frame rate afterwards, but pretty much anything is possible.