FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
574 stars 104 forks source link

Wrong frame rate problem #372

Open MunMunMiao opened 3 years ago

MunMunMiao commented 3 years ago

First, I used staxrip and identified the problem caused by ffms2

Information on the original file, mega

General
ID                             : 1 (0x1)
Complete name                  : D:\test.ts
Format                         : MPEG-TS
File size                      : 44.3 MiB
Duration                       : 29 s 997 ms
Overall bit rate mode          : Variable
Overall bit rate               : 12.4 Mb/s

Video
ID                             : 256 (0x100)
Menu ID                        : 1 (0x1)
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High@L4
Format settings                : CABAC / 2 Ref Frames
Format settings, CABAC         : Yes
Format settings, Reference fra : 2 frames
Format settings, GOP           : M=1, N=15
Codec ID                       : 27
Duration                       : 30 s 14 ms
Bit rate mode                  : Constant
Nominal bit rate               : 20.0 Mb/s
Width                          : 1 920 pixels
Height                         : 1 080 pixels
Display aspect ratio           : 16:9
Frame rate                     : 29.970 (30000/1001) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : MBAFF
Scan type, store method        : Separated fields
Scan order                     : Top Field First
Bits/(Pixel*Frame)             : 0.322
Color range                    : Limited
Color primaries                : BT.709
Transfer characteristics       : BT.709
Matrix coefficients            : BT.709

Audio
ID                             : 257 (0x101)
Menu ID                        : 1 (0x1)
Format                         : AAC LC
Format/Info                    : Advanced Audio Codec Low Complexity
Format version                 : Version 4
Muxing mode                    : ADTS
Codec ID                       : 15-2
Duration                       : 29 s 824 ms
Bit rate mode                  : Variable
Channel(s)                     : 2 channels
Channel layout                 : L R
Sampling rate                  : 48.0 kHz
Frame rate                     : 46.875 FPS (1024 SPF)
Compression mode               : Lossy
Delay relative to video        : 18 ms

Menu
ID                             : 4096 (0x1000)
Menu ID                        : 1 (0x1)
Duration                       : 29 s 997 ms
List                           : 256 (0x100) (AVC) / 257 (0x101) (AAC)
Service name                   : Service01
Service provider               : FFmpeg
Service type                   : digital television

When V2.2

WeChat Screenshot_20201222230601 1、The frame rate is 58.407803 FPS, not 29.97 FPS. 2、The video rendered with this configuration. There will be acceleration problems at 00:00:08 this's log test_staxrip.log this's output file mega

When V2.4

WeChat Screenshot_20201222225506 In this version, although the frame rate resolution is correct. But at 00:00:03, 00:00:08, there will be jitter. this's log test_staxrip.log this's output file mega

dwbuiten commented 3 years ago

I'll take a look, I suspect the the problem (or maybe it 'fixed' the file) is related to interlacing fixes.

ghost commented 3 years ago

StaxRip, MeGUI, XviD4PSP5, AviSynth, FFMS2 and other Windows tools are not suitable for encoding arbitrary files due to the lack of support for non-linear container timecodes and variable frame rates. They are defective in design (CFR only). Use these tools for DVD/BluRay encoding only. For everything else, there is Handbrake (ffmpeg based) or Avidemux at least.

ghost commented 3 years ago

Older decoders incorrectly define fps as 2x. In addition, ffmpeg reports that there are some "corrupt decoded frames", but that's okay. Handbrake and Avidemux encode fine (at 29.97p). The problem is with ffms2 and avisynth (video slowdown), I confirm.