unwanted conversion to 600fps #68343

Closed
opened 2019-08-06 23:50:41 +02:00 by Owen Ferris · 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)
Author

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?
Author

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 2019-08-08 08:23:15 +02:00

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 2019-08-08 10:43:53 +02:00
Richard Antalik was assigned by ChristopherAnderssarian 2019-08-08 10:43:53 +02:00

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 ```
Richard Antalik was unassigned by Dalai Felinto 2019-12-23 16:33:23 +01:00

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

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

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`

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)

@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?

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

This issue was referenced by b2e067d98c

This issue was referenced by b2e067d98ccf43657404b917b13ad5275f1c96e2

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Richard Antalik self-assigned this 2020-10-19 07:19:20 +02: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
6 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#68343
No description provided.