mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #4369] [MERGED] Fix frame rate probing for interlaced MKV files #10038
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/4369
Author: @orryverducci
Created: 10/25/2020
Status: ✅ Merged
Merged: 10/25/2020
Merged by: @Bond-009
Base:
master← Head:mkv-interlaced-fix📝 Commits (1)
84fd5a0Fix frame rate probing for interlaced MKV files📊 Changes
1 file changed (+10 additions, -0 deletions)
View changed files
📝
MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs(+10 -0)📄 Description
Changes
Currently Matroska (MKV) files containing interlaced video report the frame rate at the field rate instead of the expected frame rate. As a result the stored and displayed frame rate is double what it should be (e.g. 50 instead of 25). This also has the unintended effect of disabling double rate (bob) deinterlacing for those that have it switched on.
This change halves the average and real frame rate when it is probed for interlaced video streams in an Matroska container, so that the correct frame rate is stored.
Issues
Fixes #4314
Additional Context
The Matroska container doesn't have a header for the frame rate to be stored in. Instead it stores a display duration for each block containing a frame of video.
As FFprobe (and other apps) don't have a stored framerate in the container to display, they use the block display duration to calculate the frame rate instead.
However this doesn't work properly for interlaced videos, as the blocks store fields instead of frames. The display durations for the blocks are halved so that they represent the duration each field should be displayed, and as a result the frame rate value is calculated as being double what it should be.
For more info see https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Wrong-frame-rate-displayed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.