[PR #4369] [MERGED] Fix frame rate probing for interlaced MKV files #10038

Closed
opened 2026-02-07 06:13:00 +03:00 by OVERLORD · 0 comments
Owner

📋 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: masterHead: mkv-interlaced-fix


📝 Commits (1)

  • 84fd5a0 Fix 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.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/4369 **Author:** [@orryverducci](https://github.com/orryverducci) **Created:** 10/25/2020 **Status:** ✅ Merged **Merged:** 10/25/2020 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `mkv-interlaced-fix` --- ### 📝 Commits (1) - [`84fd5a0`](https://github.com/jellyfin/jellyfin/commit/84fd5a09532bd1e854ec3745609f845aa7098da2) Fix frame rate probing for interlaced MKV files ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs` (+10 -0) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:13:00 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10038