AkarinVS / L-SMASH-Works

Works based on L-SMASH project; This repo focuses on the common portion and the VapourSynth plugin. AviSynth users please use https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works. ffmpeg 5.0+ please use ffmpeg-4.5 branch.
47 stars 11 forks source link

Doubled frame rate for MKV containing field based video stream #26

Open cnzqy1 opened 2 years ago

cnzqy1 commented 2 years ago

When loading an MKV containing a field based AVC video stream (store method: Separated fields), the frame rate reported is doubled. Loading the raw video stream directly without muxing reports the correct frame rate. Latest version of FFMS2 reports the correct frame rate for such an MKV. This may be related to: https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Wrong-frame-rate-displayed.

This bug is present in both vA.3i and vA.5b. This bug is not present for field based MPEG-2 streams.

AkarinVS commented 2 years ago

Is there a sample file available that I can take a look? is lsmas returning a separate frame for each field?

cnzqy1 commented 2 years ago

Most commonly these streams are progressive videos encoded as field based "1080i25" AVC for Blu-ray standard compliance (because 1080p25 is not allowed for Blu-ray). They are progressive in nature and lsmas correctly decodes and returns original size frames (not half height), and the only issue appears to be the detected frame rate after muxing into MKV. Here is a sample video stream: https://files.catbox.moe/aos9lg.264. You can compare loading this video stream directly using lsmas vs. muxing with mkvtoolnix first and then loading the MKV: https://files.catbox.moe/e79jap.mkv.

cnzqy1 commented 2 years ago

Also here is a discussion in the DGDecNV forum for the same issue in case it's helpful: https://rationalqm.us/board/viewtopic.php?p=15801#p15801.

EDIT: setting repeat=0 in lsmas gives the correct frame rate.