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 > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th January 2025, 15:32   #1  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 166
x264 mod to encode mixed framerate in CFR container

I was reading Blu-ray.com, found about a new release with mixed framerate content that used hard pulldown, and I decided I had enough.

So, here are two tools to encode VFR content in CFR containers, exploiting the soft pull-down capabilities of H.264. x265 support to come later. Blu-ray compatible, of course.

VS-PicStruct - VapourSynth tool to analyze a VFR clip and produce a sequence of pulldown instructions that have to be used by the encoder to achieve the container framerate. Porting this to AviSynth should be straightforward.
x264 - x264 mod adding a --psfile option to parse the pull-down instructions and put them in the stream appropriately.

All pull-downs supported (18/1.001 -> 23.976, 24/1.001 -> 29.97, 23.976->29.97, 23.976 -> 59.94p, etc.) and the pattern can change anytime according to your own desires! A test x264 build is provided on the release page, enjoy.

Last edited by cubicibo; 30th January 2025 at 22:37.
cubicibo is online now   Reply With Quote
Old 12th January 2025, 00:09   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,838
Beautiful, many thanks cubicibo ! Will come handy for silent films, Regular 8, Super 8.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 12th January 2025, 15:53   #3  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 166
You are welcome. You are right, all low framerate films can benefit from it. Any movie or anime with VFR content too!

The versatility of H.264 pic struct enables for exotic framerates to fit in 23.976/24/25/29.97. VS-PicStruct determines the pattern programmatically, you don't have to figure them out yourself: they can be nasty. The pulldown pattern is also written in the output file as comments, you can verify them.

For those who care, the rules to see if there's a pulldown are:
- (container_framerate)/(clip_to_pd_framerate) = repetitions/cycles should be in [1; 3]
- cycles must be smaller than container_fps, else PD goes over gop-second boundary.
If both conditions are satisfied, there should be a pulldown pattern. VS-PicStruct will happily crash if it can't find a pattern. No garbage guaranteed!

Last edited by cubicibo; 12th January 2025 at 16:00.
cubicibo is online now   Reply With Quote
Old 30th January 2025, 22:11   #4  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 166
I updated both VS-PicStruct and the x264 binaries after extensive testing on HW decoders. The new versions should work flawlessly on both Blu-ray (or any STB AVC) players and software decoders. Enjoy.
cubicibo is online now   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 16:26.


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