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

An incorrect fps detection #27

Closed YomikoR closed 1 year ago

YomikoR commented 1 year ago

I happen to meet a corner case with the following video stream: [BDMV][Kimetsu no Yaiba Yuukaku Hen][Vol.1-6 Fin]\連動購入者特典\「鬼滅ラヂヲ」動画配信ver. - TVアニメ「鬼滅の刃」 遊郭編公式サイト 第3巻-第4巻連動購入者特典.ts

After demuxing with tsmuxer, the extracted video file has H.264 format with .264 extension. ffmpeg says it has 59 fps and 59.94 tbr. A thorough ffprobe run reports that the beginning 4 frames have pkt_duration_time=0.04, while the rest have pkt_duration_time=0.016683 (59.94 fps).

lsmas can index all the frames, if without manually specifying fps, but tags all frames as 59 fps.

AkarinVS commented 1 year ago

lsmas could either use fps reported by ffmpeg (59) or use the average fps (slightly less than 59.94), but neither will be ideal for this case.

https://github.com/AkarinVS/L-SMASH-Works/blob/ee60c53b18ea958081c3b96a817a66d4b9989619/common/lwlibav_video.c#L305

I don't see how this situation could be improved. any ideas?

YomikoR commented 1 year ago

Personally I would assume all .ts sources are vfr, so the clip fps is not important to me. Also if I remember correctly, lsmas ignores frame durations for (non-standard) blu ray video streams. But having 59 fps as the conclusion is still annoying, as this figure is useless by any means.