VSE Detecting and setting incorrect frame rate
Closed, ResolvedPublic

Description

System Information
Windows 7 Ultimate, 64-bit, 32GB, 5960x, Nvidia Quadro FX 1800 (Primary) & GeForce 9800 GTX+ (Secondary)
Graphics Tablet: Wacom Bamboo Model: CTF-430 Driver Version 5.2.4-5

Blender Version
Official release(s) unless specified:
Broken: 2.79, 2.79.0-e59cf13 (Windows 64-Bit)
Worked: (N/A)

Short description of error

When adding the first video strip the VSE sets the wrong framerate.

Exact steps for others to reproduce the error

File I used to create the video.

P.S. I could have sworn I saw this bug reported here, but I can't find it and it's not fixed in the Daily build.

Details

Type
Bug
Philipp Oeser (lichtwerk) triaged this task as Confirmed priority.

first note:
ffmpeg itself [like outside of blender] detects the provided file as 1k fps, so this might not be the detection that goes wrong but the writing...

ffmpeg -i 0001-0600\ \(60fps\).mkv 
ffmpeg version 3.3.5 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags='-I/usr/include/nvenc ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, matroska,webm, from '0001-0600 (60fps).mkv':
  Metadata:
    ENCODER         : Lavf57.56.100
  Duration: 00:00:10.00, start: 0.000000, bitrate: 1061 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1k fps, 60 tbr, 1k tbn, 120 tbc (default)
    Metadata:
      DURATION        : 00:00:10.000000000

will dig deeper shortly... [either way there seems to be something wrong here]

There used to be a bug in 2.79 in the writer indeed, should be fixed for 2.79a

if you render provided .blend in 2.79a release branch, the output still reads like this (and will still be interpreted as 1000fps if opened in VSE)
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1k fps, 60 tbr, 1k tbn, 120 tbc (default)

i can't repro that with 2.79a @Philipp Oeser (lichtwerk)?

i rendered VSE_Framerate.blend this is what it spit out..

Input #0, matroska,webm, from '0001-0600.mkv':
  Metadata:
    ENCODER         : Lavf57.56.100
  Duration: 00:00:10.00, start: 0.000000, bitrate: 1076 kb/s
    Stream #0:0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
    Metadata:
      DURATION        : 00:00:10.000000000

Sorry, was on wrong branch. Can confirm that it now writes correctly (and therefor also reads in correctly)

Still left is the case when fps and tbr dont match [like in the mkv posted here], see also T53857

Unfortunately I'll only be able to look at this in April again, so let others take over....