unwanted conversion to 600fps #68343

Closed
opened 4 years ago by oferrs03 · 23 comments

Blender Version
Broken: 2.8
when rendering out videos in the video editor it outputs them as 600fps

if you upload a video into the video sequencer and set the framerate for 23.98 it outputs as 600fps. This can be seen by putting the rendered video back into the sequencer or checking the properties of the video itself.

Simplified file:
Simple_T68343.blend

**Blender Version** Broken: 2.8 when rendering out videos in the video editor it outputs them as 600fps if you upload a video into the video sequencer and set the framerate for 23.98 it outputs as 600fps. This can be seen by putting the rendered video back into the sequencer or checking the properties of the video itself. Simplified file: [Simple_T68343.blend](https://archive.blender.org/developer/F7654167/Simple_T68343.blend)
Poster

Added subscriber: @oferrs03

Added subscriber: @oferrs03

Added subscriber: @ChristopherAnderssarian

Added subscriber: @ChristopherAnderssarian

There was a similar fix a while ago.

What export setting are you using? Can you share a .blend?

There was a similar fix a while ago. What export setting are you using? Can you share a .blend?
Poster

bvp.blend Boat vs pole.mp4 I can share the .blend file along with the video I was trying to edit

[bvp.blend](https://archive.blender.org/developer/F7653718/bvp.blend) [Boat vs pole.mp4](https://archive.blender.org/developer/F7653719/Boat_vs_pole.mp4) I can share the .blend file along with the video I was trying to edit
ChristopherAnderssarian self-assigned this 4 years ago

Thanks, I'll check later today...

Thanks, I'll check later today...

Added subscriber: @iss

Added subscriber: @iss

This seems to be similar to #53687 (VSE Detecting and setting incorrect frame rate) (further reading here: #53857)
but (in this example) does happen with AVI and speed control. It works in 2.79b, but fails in 2.8...

@iss not sure if you want to dig in to this or not...

This seems to be similar to #53687 (VSE Detecting and setting incorrect frame rate) (further reading here: #53857) but (in this example) does happen with AVI and speed control. It works in 2.79b, but fails in 2.8... @iss not sure if you want to dig in to this or not...
ChristopherAnderssarian removed their assignment 4 years ago
iss was assigned by ChristopherAnderssarian 4 years ago

Added subscriber: @hannes-10

Added subscriber: @hannes-10

Additional information from another affected user:

File Format FFmpeg Video
Color RGB
Encoding Container AVI
Video Codec h.264

Is there a workaround for this, some different setting I can try?

Additional information from another affected user: | File Format | FFmpeg Video | | -- | -- | | Color | RGB | | Encoding Container | AVI | | Video Codec | h.264 | Is there a workaround for this, some different setting I can try?

Here's a fix using ffmpeg:

ffmpeg -i input_600fps.avi -codec copy -r 30 output_30fps.avi 
Here's a fix using ffmpeg: ``` ffmpeg -i input_600fps.avi -codec copy -r 30 output_30fps.avi ```
iss was unassigned by dfelinto 3 years ago
iss commented 3 years ago
Collaborator

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
iss commented 3 years ago
Collaborator

I can not remember If I was looking into this, but I can not reproduce this issue anymore.

Thing with AVI container and speed fx is strange. Sequencer should have absolutely no influence on output frame rate.

Can anybody involved still reproduce this?

I can not remember If I was looking into this, but I can not reproduce this issue anymore. Thing with AVI container and speed fx is strange. Sequencer should have absolutely no influence on output frame rate. Can anybody involved still reproduce this?

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

In #68343#854989, @iss wrote:
Can anybody involved still reproduce this?

yep
yes0001-0025.avi

re-tested with Simple_T68343.blend


Complete name                            : M:\Blender\BugFinds\T68343 unwanted conversion to 600fps\yes0001-0025.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 104 KiB
Duration                                 : 1 s 56 ms
Overall bit rate                         : 807 kb/s
Recorded date                            : 2020/01/22 16:31:05
Writing application                      : Lavf58.12.100

Video
ID                                       : 0
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : 4 Ref Frames
Format settings, CABAC                   : No
Format settings, RefFrames               : 4 frames
Codec ID                                 : H264
Duration                                 : 1 s 2 ms
Bit rate                                 : 463 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 600.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.000
Stream size                              : 56.6 KiB (54%)
Writing library                          : x264 core 155
Encoding settings                        : cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x3:0x100 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=0 / b_bias=0 / direct=1 / weightb=1 / open_gop=1 / weightp=2 / keyint=18 / keyint_min=10 / scenecut=0 / intra_refresh=0 / rc_lookahead=18 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00

Audio
ID                                       : 1
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Format settings                          : Joint stereo / MS Stereo
Codec ID                                 : 55
Codec ID/Hint                            : MP3
Duration                                 : 1 s 56 ms
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Stream size                              : 22.5 KiB (22%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 23  ms (13.66 video frames)
Writing library                          : LAME3.100

tested with on blender-2.83-ddda1af97afc-windows64

> In #68343#854989, @iss wrote: > Can anybody involved still reproduce this? yep [yes0001-0025.avi](https://archive.blender.org/developer/F8295105/yes0001-0025.avi) re-tested with [Simple_T68343.blend](https://archive.blender.org/developer/F7654167/Simple_T68343.blend) ```lines=5 Complete name : M:\Blender\BugFinds\T68343 unwanted conversion to 600fps\yes0001-0025.avi Format : AVI Format/Info : Audio Video Interleave File size : 104 KiB Duration : 1 s 56 ms Overall bit rate : 807 kb/s Recorded date : 2020/01/22 16:31:05 Writing application : Lavf58.12.100 Video ID : 0 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings : 4 Ref Frames Format settings, CABAC : No Format settings, RefFrames : 4 frames Codec ID : H264 Duration : 1 s 2 ms Bit rate : 463 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 600.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.000 Stream size : 56.6 KiB (54%) Writing library : x264 core 155 Encoding settings : cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x3:0x100 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=0 / b_bias=0 / direct=1 / weightb=1 / open_gop=1 / weightp=2 / keyint=18 / keyint_min=10 / scenecut=0 / intra_refresh=0 / rc_lookahead=18 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00 Audio ID : 1 Format : MPEG Audio Format version : Version 1 Format profile : Layer 3 Format settings : Joint stereo / MS Stereo Codec ID : 55 Codec ID/Hint : MP3 Duration : 1 s 56 ms Bit rate mode : Constant Bit rate : 192 kb/s Channel(s) : 2 channels Sampling rate : 48.0 kHz Compression mode : Lossy Stream size : 22.5 KiB (22%) Alignment : Aligned on interleaves Interleave, duration : 23 ms (13.66 video frames) Writing library : LAME3.100 ``` tested with on `blender-2.83-ddda1af97afc-windows64`
iss commented 3 years ago
Collaborator

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

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

Added subscriber: @salvation

Added subscriber: @salvation

Hello.
I'm not familiar with the source code of Blender and FFmpeg, but I have tried to find the bug and if I insert one line in writeffmpeg.c
it export fine with the right fps ... maybe it helps to solve the problem in the right way.
Because its a hack, I put as example 25fps in the source-file.

The base code is from Blender 2.91.0 Alpha
In the file writeffmpeg.c I have inserted the following at line 1090.

// if the fps (example 25fps) match the VSE scene file it works fine... else I got after some time coloured bad frames while playing
context->video_stream->time_base = (AVRational){ 1, 25 }; // TODO try to fix T68343

I have tested it in Sony Vegas Video, VirtualDub, MediaInfo (MediaArea.net)
Edit: I'm working with Windows 10

writeffmpeg.c

Hello. I'm not familiar with the source code of Blender and FFmpeg, but I have tried to find the bug and if I insert one line in writeffmpeg.c it export fine with the right fps ... maybe it helps to solve the problem in the right way. Because its a hack, I put as example 25fps in the source-file. The base code is from Blender 2.91.0 Alpha In the file writeffmpeg.c I have inserted the following at line 1090. ``` // if the fps (example 25fps) match the VSE scene file it works fine... else I got after some time coloured bad frames while playing context->video_stream->time_base = (AVRational){ 1, 25 }; // TODO try to fix T68343 ``` I have tested it in Sony Vegas Video, VirtualDub, MediaInfo (MediaArea.net) Edit: I'm working with Windows 10 [writeffmpeg.c](https://archive.blender.org/developer/F8986511/writeffmpeg.c)
iss commented 2 years ago
Collaborator

@salvation Thanks for help, I haven't looked at this problem so far so I don't know much more than you. But looking that you used AVRational type, now I suspect that this could be caused by overflow perhaps. Will have a look and see if I get anywhere.

@salvation Thanks for help, I haven't looked at this problem so far so I don't know much more than you. But looking that you used `AVRational` type, now I suspect that this could be caused by overflow perhaps. Will have a look and see if I get anywhere.

@iss Or the value was never set before?
I set it directly after the memory request and it looks like the value never changed after that?... maybe the value was always 0 and therefore ffmpeg set it to a maximum of 600fps?

@iss Or the value was never set before? I set it directly after the memory request and it looks like the value never changed after that?... maybe the value was always 0 and therefore ffmpeg set it to a maximum of 600fps?
iss commented 2 years ago
Collaborator

I have looked into this - bug happens, when fps time base in render settings is whole number.

  else if ((float)((int)rd->frs_sec_base) == rd->frs_sec_base) {
    c->time_base.den = rd->frs_sec;
    c->time_base.num = (int)rd->frs_sec_base;
  }

The code looks pretty much OK, but c->time_base.num was always 0. I have even tried to change offending line to c->time_base.num = (int)(rd->frs_sec_base + 0.5f); bu no luck.
I re-checked in debug build and this didn't happen, so it looks like that compiler optimized this line out or something like that.

I don't know X86 asm so I can't read this immediately, but here is dissassembly (note current instruction vs watch window):

Bad:
bad.png

Good - here I have only swapped lines around, but it would be probably weak fix:
good.png

I have looked into this - bug happens, when fps time base in render settings is whole number. ``` else if ((float)((int)rd->frs_sec_base) == rd->frs_sec_base) { c->time_base.den = rd->frs_sec; c->time_base.num = (int)rd->frs_sec_base; } ``` The code looks pretty much OK, but `c->time_base.num` was always 0. I have even tried to change offending line to `c->time_base.num = (int)(rd->frs_sec_base + 0.5f);` bu no luck. I re-checked in debug build and this didn't happen, so it looks like that compiler optimized this line out or something like that. I don't know X86 asm so I can't read this immediately, but here is dissassembly (note current instruction vs watch window): Bad: ![bad.png](https://archive.blender.org/developer/F8989997/bad.png) Good - here I have only swapped lines around, but it would be probably weak fix: ![good.png](https://archive.blender.org/developer/F8989999/good.png)

fix is working.. that was a easy bugfix after 1 year :)
open source is cool

fix is working.. that was a easy bugfix after 1 year :) open source is cool
Owner

This issue was referenced by b2e067d98c

This issue was referenced by b2e067d98ccf43657404b917b13ad5275f1c96e2
iss commented 2 years ago
Collaborator

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
iss closed this issue 2 years ago
iss self-assigned this 2 years ago
Sign in to join this conversation.
No Label
good first issue
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/2.81
legacy project/2.82
legacy project/2.83
legacy project/2.90
legacy project/2.91
legacy project/2.92
legacy project/3.0
legacy project/3.1
legacy project/3.2
legacy project/3.3
legacy project/Alembic
legacy project/Animation & Rigging
legacy project/Asset Browser
legacy project/Asset Browser (Archived)
legacy project/Asset Browser Project Overview
legacy project/Audio
legacy project/Automated Testing
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Blender Asset Bundle
legacy project/Code Quest
legacy project/Collada
legacy project/Compositing
legacy project/Core
legacy project/Cycles
legacy project/Datablocks and Libraries
legacy project/Dependency Graph
legacy project/Development Management
legacy project/Eevee
legacy project/EEVEE & Viewport
legacy project/Freestyle
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/Geometry Nodes
legacy project/Good First Issue
legacy project/GPU / Viewport
legacy project/Grease Pencil
legacy project/GSoC
legacy project/Images & Movies
legacy project/Import/Export
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Line Art
legacy project/Masking
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Modeling
legacy project/Modifiers
legacy project/Motion Tracking
legacy project/Nodes
legacy project/Nodes & Physics
legacy project/OpenGL Error
legacy project/Overrides
legacy project/Papercut
legacy project/Performance
legacy project/Physics
legacy project/Pipeline, Assets & I/O
legacy project/Platform: FreeBSD
legacy project/Platform: Linux
legacy project/Platform: macOS
legacy project/Platforms, Builds, Tests & Devices
legacy project/Platform: Windows
legacy project/Pose Library Basics
legacy project/Python API
legacy project/Render & Cycles
legacy project/Render Pipeline
legacy project/Retrospective
legacy project/Sculpt, Paint & Texture
legacy project/Text Editor
legacy project/Tracker Curfew
legacy project/Translations
legacy project/Triaging
legacy project/Undo
legacy project/USD
legacy project/User Interface
legacy project/UV Editing
legacy project/VFX & Video
legacy project/Video Sequencer
legacy project/Virtual Reality
legacy project/Wintab High Frequency
migration/requires-manual-verification
Module › Animation & Rigging
Module › Core
Module › Development Management
Module › Eevee & Viewport
Module › EEVEE & Viewport
Module › Grease Pencil
Module › Modeling
Module › Nodes & Physics
Module › Pipeline, Assets & IO
Module › Platforms, Builds Tests & Devices
Module › Platforms, Builds, Tests & Devices
Module › Python API
Module › Rendering & Cycles
Module › Sculpt, Paint & Texture
Module › Triaging
Module › User Interface
Module › VFX & Video
papercut
performance
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information 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
6 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#68343
Loading…
There is no content yet.