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 17th April 2017, 22:21   #1  |  Link
BakaProxy
Registered User
 
Join Date: Jan 2015
Posts: 47
24, 30 and 60 fps mixed content to timecodes

Does anyone have any experience with 24p/30p/60p mixed content?

I want to make a VFR encode but I'm having a hard time figuring out how to make the timecodes file that doesn't break the subtitle timings.

The most recent idea I came up with is using DeDup(maxcopies=5, maxdrops=3), which is "drop max 3 frames per 5 frames" if I'm correct. so for a 60 fps stream that should end me up with atleast 24 fps stream on stillframes.

If anyone has experience on this topic I'd really appreciate help.
BakaProxy is offline   Reply With Quote
Old 18th April 2017, 00:07   #2  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 974
I don't understand what the problem is at all, not even after reading what you wrote on IRC. Speculating, though: if the issue is that the video doesn't update often enough on static scenes to refresh the subtitles properly with some renderers and enforcing a sane-ish minimum frame duration isn't an option for some reason (it should be, long sequences of identical frames are essentially free in h264), you're far enough up special snowflake creek that you're gonna have to write some custom tooling to get the job done. I'd suggest a script that parses the timecodes and subtitles files and ensures that coded frames exist at the points where the subtitles are supposed to change.
TheFluff is offline   Reply With Quote
Old 18th April 2017, 01:04   #3  |  Link
BakaProxy
Registered User
 
Join Date: Jan 2015
Posts: 47
Quote:
Originally Posted by TheFluff View Post
Speculating, though: if the issue is that the video doesn't update often enough on static scenes to refresh the subtitles properly with some renderers and enforcing a sane-ish minimum frame duration isn't an option for some reason (it should be, long sequences of identical frames are essentially free in h264)
Well one of my previous ideas was to just leave the file 60 fps since it doesn't take much more space (if anything really), but an arguement came up on that idea. Which was about 60 fps isn't a multiple of 24, so you get a 2-3-2-3-2-3 pattern instead of a constant duplication which may result in slight judder. And going with fps higher than 60 wasn't an option either because apparently some media players also have problems with such content.
BakaProxy is offline   Reply With Quote
Old 18th April 2017, 01:10   #4  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,483
DeDup, as far as I know, doesn't produce the type of variable frame rate you (probably) want. It simply deletes duplicate frames. How are you processing the video before it gets to Dedup? With an IVTC filter etc?

TIVTC will do variable frame rate, although it'll only do a mixture of 23.976 (film) and 29.970 (de-interlaced video etc).. I don't think there's any way to get it to deinterlace to 60fps. If there's a lot of interlaced content you can go the other way and convert the whole lot to 60fps, but for hybrid DVDs I just get it to de-interlace the interlaced bits to 29.940fps myself.

There's instructions in the TIVTC help files, but the gist is you run it like this in a script to run an analysis pass first (no encoding required).

TFM(Output="D:\TFM Episode 1.txt").TDecimate(Mode=4, Hybrid=2, Output="D:\TDecimate Episode 1.txt")

That'll create a couple of metrics files (text files) which you use for the encoding pass.

TFM().TDecimate(Mode=5, Hybrid=2, Input="D:\TDecimate Episode 1.txt", TFMIn="D:\TFM Episode 1.txt", mkvOut="D:\Timecodes Episode 1.txt")

If you do it right, TIVTC will create a timecodes file before encoding begins. Ideally you'd give the timecodes file to x264 to play with so it can encode in variable frame rate mode, or you can encode in constant frame rate mode and add the timecodes file when muxing instead. If you're encoding subtitles, it's probably better to encode in VFR mode though, otherwise the subtitle timing will change if you add the timecodes file when muxing.

--tcfile-in "D:\Timecodes Episode 1.txt"

The timecodes file doesn't have to exist when you configure the encoder (assuming you're using a GUI). You just need to plan ahead so each encode uses a unique timecodes file, and add the appropriate timecodes file to the x264 command line, even if it doesn't exist at that point. It'll be created as soon as the script is run.

If you're encoding with DeDup in constant frame rate mode (I've barely used it so I can't remember much about it) and adding the timecodes file it creates when muxing, that's probably messing with the subtitle timings. Once again, even if you don't need to use TIVTC, I'd still use the timecodes file to Dedup creates to encode in variable frame rate mode if possible, assuming you really have to delete duplicate frames. Generally, I can't see the point myself.
hello_hello is offline   Reply With Quote
Old 18th April 2017, 01:14   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,483
Quote:
Originally Posted by BakaProxy View Post
Which was about 60 fps isn't a multiple of 24, so you get a 2-3-2-3-2-3 pattern instead of a constant duplication which may result in slight judder. And going with fps higher than 60 wasn't an option either because apparently some media players also have problems with such content.
As it turns out, that's exactly what happens when you play 24fps video on a 60Hz display. Every second frame displays for an extra screen refresh for the same 3:2 pattern of screen refreshes.
Of course when you encode it that way, you're stuck with it regardless of the refresh rate of the display.
hello_hello is offline   Reply With Quote
Reply

Tags
avisynth, dedup, subtitles, tdecimate, vfr

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 09:04.


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