Framerate detection uses decimals in base when shouldn't #87776

Open
opened 2021-04-24 11:18:05 +02:00 by Gerard Taulats Braos · 7 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Intel(R) HD Graphics 4600 Intel 4.3.0 - Build 20.19.15.5058

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-04-21 20:15, hash: 932b23782a
Worked: Never

Short description of error
When importing a video in the sequencer, if the video was in 30 fps, Blender detects it as 3 fps and base 0.1
The more extreme case happens when rendering with decimal base, that importing this clip sets the fps to 32767 and the base to 1092.233 (matches 30 fps).

Exact steps for others to reproduce the error

  • Open blender with the Video Editing preset (does the same from the default scene)
  • Set framerate to 30 and render a video (1 frame is enough)
  • Import the video placing it in the sequencer
  • Check "Custom" on the framerate and notice fps and base
    Further exploration:
  • Change the presets of file format to any except default (with Matroska doesn't happen this).
  • Render a video with 3 fps and base 0.1
  • Import the video and check "custom"

Some notes:

  • I discovered this issue several months ago, but I paid no mind due to being apparently harmless. I noticed that if the base is not 1, some decoders fail to open the videos (in my case playing videos online in Drive).
  • With FFMPEG seems to do so when using multiples of 10 (20, 30, 60, 120, etc.)
  • When rendering with the AVI internal (AVI JPEG or AVI RAW), when importing the video the fps are set to 10 and the base to 0.333
  • There are many more odd behaviors involved with different combinations of fps and base.
  • The behavior seems to be different in 2.77 (the one first included the automatic feature) and 2.78, where for example a framerate of 30 is set as 6 fps and base 0.2. From 2.79 behaves the same the same way as explained.
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: Intel(R) HD Graphics 4600 Intel 4.3.0 - Build 20.19.15.5058 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-04-21 20:15, hash: `932b23782a` Worked: Never **Short description of error** When importing a video in the sequencer, if the video was in 30 fps, Blender detects it as 3 fps and base 0.1 The more extreme case happens when rendering with decimal base, that importing this clip sets the fps to 32767 and the base to 1092.233 (matches 30 fps). **Exact steps for others to reproduce the error** - Open blender with the Video Editing preset (does the same from the default scene) - Set framerate to 30 and render a video (1 frame is enough) - Import the video placing it in the sequencer - Check "Custom" on the framerate and notice fps and base Further exploration: - Change the presets of file format to any except default (with Matroska doesn't happen this). - Render a video with 3 fps and base 0.1 - Import the video and check "custom" Some notes: - I discovered this issue several months ago, but I paid no mind due to being apparently harmless. I noticed that if the base is not 1, some decoders fail to open the videos (in my case playing videos online in Drive). - With FFMPEG seems to do so when using multiples of 10 (20, 30, 60, 120, etc.) - When rendering with the AVI internal (AVI JPEG or AVI RAW), when importing the video the fps are set to 10 and the base to 0.333 - There are many more odd behaviors involved with different combinations of fps and base. - The behavior seems to be different in 2.77 (the one first included the automatic feature) and 2.78, where for example a framerate of 30 is set as 6 fps and base 0.2. From 2.79 behaves the same the same way as explained.

Added subscriber: @Tabra

Added subscriber: @Tabra
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I can reproduce using 3.0 master 87a70801c6.

FPS 3 Base 0.100.png

FFmpeg wants the base to be an Integer.

https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/rational.h

While rational numbers can be expressed as floating-point numbers, the
conversion process is a lossy one, so are floating-point operations. On the
other hand, the nature of FFmpeg demands highly accurate calculation of
timestamps. This set of rational number utilities serves as a generic
interface for manipulating rational numbers as pairs of numerators and
denominators.

Apparently this issue has come up before and was partially fixed in 956cb4f403

I can reproduce using 3.0 master 87a70801c6a9. ![FPS 3 Base 0.100.png](https://archive.blender.org/developer/F10037090/FPS_3_Base_0.100.png) FFmpeg wants the base to be an Integer. https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/rational.h > While rational numbers can be expressed as floating-point numbers, the > conversion process is a lossy one, so are floating-point operations. On the > other hand, the nature of FFmpeg demands highly accurate calculation of > timestamps. This set of rational number utilities serves as a generic > interface for manipulating rational numbers as pairs of numerators and > denominators. Apparently this issue has come up before and was partially fixed in 956cb4f403

Added subscribers: @iss, @Sergey

Added subscribers: @iss, @Sergey

@iss, Do you feel like you can look into the issue in a long term?

P.S. A long term is because this isn't a newly introduced problem, but it does feel like we do need to bring the fps and related topics under control.

@iss, Do you feel like you can look into the issue in a long term? P.S. A long term is because this isn't a newly introduced problem, but it does feel like we do need to bring the fps and related topics under control.

I should be able to have a look and find solution. I have noticed more places where FPS calculation fails or causes problems as well.

I should be able to have a look and find solution. I have noticed more places where FPS calculation fails or causes problems as well.
Philipp Oeser removed the
Interest
VFX & Video
label 2023-02-10 09:31:49 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87776
No description provided.