Rendered video is missing frames that are on the playback timeline #86361

Closed
opened 2021-03-07 17:00:59 +01:00 by Konstantin Kharlamov · 16 comments

System Information
Operating system: Archlinux
Graphics card: Intel HD Graphics 620

Blender Version
Broken: 2.92.0 and also tested latest daily build blender-2.93.0-8618c4159c7b-linux64
Worked: unknown

Short description of error

The resulting rendered video is lacking last frames (in fact, judging by the timeline it lacks last 2 seconds of the video). If you play the video inside timeline, you can see last frames are where there's a hand appears and the man disappears. However after I render it to a file, and play the file, the video stops some moments earlier, i.e. frames where the man is still in frame.

Also relevant is that when "rendering" is happening, you can see slider is moving on the timeline, and it shows the wrong frames. IOW, at the end of the timeline it should show a frame with no man — however instead it shows a frame with the man.

From my experimentation it seems that the problem is somehow related to cuts in the video. Because when there's no cuts or only a cut at the end, video is rendered properly.

Exact steps for others to reproduce the error

I haven't figured a way to do this from scratch on an irrelevant video, so I attached an archive with a tiktok video I'm editing and a bug-report.blend file which has all the necessary setup (most importantly, cuts, because they seem to trigger the problem).

  1. Place files from archive into /tmp directory
  2. Open bug-report.blend in Blender
  3. Press Render → Render Animation and wait for it to finish.
  4. Open the resulting /tmp/0001-0156.mkv file in any video editor, and scroll to the final frame of the video.

Expected

The final frame is matching the timeline inside Blender, where there is no one in the frame.

Actual

It finishes with the man in frame.

bug-report.tar.zst

**System Information** Operating system: Archlinux Graphics card: Intel HD Graphics 620 **Blender Version** Broken: `2.92.0` and also tested latest daily build `blender-2.93.0-8618c4159c7b-linux64` Worked: unknown **Short description of error** The resulting rendered video is lacking last frames (in fact, judging by the timeline it lacks last 2 seconds of the video). If you play the video inside timeline, you can see last frames are where there's a hand appears and the man disappears. However after I render it to a file, and play the file, the video stops some moments earlier, i.e. frames where the man is still in frame. Also relevant is that when "rendering" is happening, you can see slider is moving on the timeline, and it shows the wrong frames. IOW, at the end of the timeline it should show a frame with no man — however instead it shows a frame with the man. From my experimentation it seems that the problem is somehow related to cuts in the video. Because when there's no cuts or only a cut at the end, video is rendered properly. **Exact steps for others to reproduce the error** I haven't figured a way to do this from scratch on an irrelevant video, so I attached an archive with a tiktok video I'm editing and a `bug-report.blend` file which has all the necessary setup (most importantly, cuts, because they seem to trigger the problem). 1. Place files from archive into `/tmp` directory 2. Open `bug-report.blend` in Blender 3. Press `Render → Render Animation` and wait for it to finish. 4. Open the resulting `/tmp/0001-0156.mkv` file in any video editor, and scroll to the final frame of the video. **Expected** The final frame is matching the timeline inside Blender, where there is no one in the frame. **Actual** It finishes with the man in frame. [bug-report.tar.zst](https://archive.blender.org/developer/F9877412/bug-report.tar.zst)

Added subscriber: @Hi-Angel

Added subscriber: @Hi-Angel

#98265 was marked as duplicate of this issue

#98265 was marked as duplicate of this issue

#86971 was marked as duplicate of this issue

#86971 was marked as duplicate of this issue

Added subscriber: @iss

Added subscriber: @iss

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

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

Can confirm issues here,

This will probably be similar seek bug as #86971, but since there is a lot of different video formats will keep this open so I can investigate both files separately.

Again setting to high prio only because I am looking at this area currently.

Problem may be much more complicated and I may lower priority in such case.

Can confirm issues here, This will probably be similar seek bug as #86971, but since there is a lot of different video formats will keep this open so I can investigate both files separately. Again setting to high prio only because I am looking at this area currently. Problem may be much more complicated and I may lower priority in such case.

Added subscriber: @davidmcsween

Added subscriber: @davidmcsween

I might add here that Blender has always been challenged by difficult to decompress CODECs. Especially variable bit rate ones. IIRC some screen recorders have variable IP and B frames too. This obviously makes scrubbing/seeking a nightmare.

I might add here that Blender has always been challenged by difficult to decompress CODECs. Especially variable bit rate ones. IIRC some screen recorders have variable IP and B frames too. This obviously makes scrubbing/seeking a nightmare.

Added subscribers: @SyllabusGames, @mano-wii

Added subscribers: @SyllabusGames, @mano-wii

Problem in this file is variable frame rate, which is not supported currently.

Video has 210 frames, but Blender sees only 196. When video is played frame by frame, like during rendering, decoding takes different route than when file is seeked, when it is cut or frames are dropped.
Even if I was able to resolve issue with missing frames, there will be still problem when decoding needs to seek even for one frame, it would result in big jump that is undesirable, because time in video doesn't "flow" at the same rate as sequencer timeline time.

This is not trivial problem to resolve and I am not sure if I will have time to resolve this anytime soon so I will change this form bug to known issue.

There are 2 possible workarounds:

  • use proxies (which are automaticaly built in 2.93)
  • manually transcode your files to constant FPS rate

@davidmcsween yes there are many challenges, though variable I-frame rate should cause no problem even with current implementation.

Problem in this file is variable frame rate, which is not supported currently. Video has 210 frames, but Blender sees only 196. When video is played frame by frame, like during rendering, decoding takes different route than when file is seeked, when it is cut or frames are dropped. Even if I was able to resolve issue with missing frames, there will be still problem when decoding needs to seek even for one frame, it would result in big jump that is undesirable, because time in video doesn't "flow" at the same rate as sequencer timeline time. This is not trivial problem to resolve and I am not sure if I will have time to resolve this anytime soon so I will change this form bug to known issue. There are 2 possible workarounds: - use proxies (which are automaticaly built in 2.93) - manually transcode your files to constant FPS rate @davidmcsween yes there are many challenges, though variable I-frame rate should cause no problem even with current implementation.

Thank you for the research!

Problem in this file is variable frame rate, which is not supported

Do you think it would make sense to solve this task by simply refusing to render the video in such situation? I imagine a pop-up message saying something like

Rendering with variable frame rate is not yet supported. There are workarounds, see https://developer.blender.org/T86361#1139592 for details

I imagine it would help a lot to people, because otherwise they would spend hours and hours of their time trying to make it work*(as it happened to me)* without knowing there is a problem.

Thank you for the research! > Problem in this file is variable frame rate, which is not supported Do you think it would make sense to solve this task by simply refusing to render the video in such situation? I imagine a pop-up message saying something like ``` Rendering with variable frame rate is not yet supported. There are workarounds, see https://developer.blender.org/T86361#1139592 for details ``` I imagine it would help a lot to people, because otherwise they would spend hours and hours of their time trying to make it work*(as it happened to me)* without knowing there is a problem.

In #86361#1139599, @Hi-Angel wrote:
Do you think it would make sense to solve this task by simply refusing to render the video in such situation? I imagine a pop-up message saying something like

This is good question. I am not sure whether it is easy to tell if framerate is variable just from metadata, but will check this.

It may be possible that some devices may record with slight time deviation due to various reasons and these would be evaluated as variable framerate, but they would actually decode properly otherwise. Then it may be probably easier to actually fix playback in such files.

> In #86361#1139599, @Hi-Angel wrote: > Do you think it would make sense to solve this task by simply refusing to render the video in such situation? I imagine a pop-up message saying something like This is good question. I am not sure whether it is easy to tell if framerate is variable just from metadata, but will check this. It may be possible that some devices may record with slight time deviation due to various reasons and these would be evaluated as variable framerate, but they would actually decode properly otherwise. Then it may be probably easier to actually fix playback in such files.

Added subscribers: @Deckelmouk, @OmarEmaraDev

Added subscribers: @Deckelmouk, @OmarEmaraDev

This issue was referenced by f0a3d2beb2

This issue was referenced by f0a3d2beb23e127ea246f9544d68355fbf3ce438

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'

This issue has been resolved by f0a3d2beb2, so will close the report.

This issue has been resolved by f0a3d2beb2, so will close the report.
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#86361
No description provided.