VSE movie strips: unreliable timing, unwanted time warping #50489
Labels
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#50489
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Short description of the problem
When using video files in movie strips in Blender's Video Sequence Editor - sometimes the videos are impossible to sync, becasue the timeing of the video streams are warping unpredictably - this breaks audio/video sync while editing and in final renders and makes editing movies impossible.
Introduction and my personal history with this issue
Since I started using Blender 2.5 I have experienced severe problems with syncing video to audio in Blender Video Sequence Editor.
Syncing together multi-camera footage was even more impossible. I'm not sure but I feel like the problem was non-existent before Blender 2.5
I was very frustrated with this and had a few-year long brake in using Blender for video editing.
I published this video right before I agave up:
https://youtu.be/7tq4lX6OmLc?t=40m56s
You can hear that I speak, while my lips don't move an vice versa. But it's not just the webcam part, all of the video is totally out of sync with the video. The raw footage I captured with RecordMyDesktop was playing fine alone - after editing and rendering it - the audio and video never align in the screencast part - what's strange, a part captured with Canon 550D DSLR is fine.
After a few years I have finally gave Blender another try. I'm currently using Blender again to edit videos, and I managed to edit and render a 75-minute video without experiencing this problem. Heres that video:
https://youtu.be/SMrHEoci5Fk?t=39m8s
You can see a few frames static A/V desync but that's totally correctible. It's not what I'm talking about here.
Two days ago I recorded footage with my webcam (the same way I recorded footage for the video above) and with a camcorder.
I recorded a visible and audible hand clap to help myself syncing - I tried to sync these movie strips together by their audio first. This seemed to fail. The footage didn't seem to align with the sound. So I tried by frames - I found and locked on the exact same moment when my hands meet. After rendering I dont see any place where the tow cameras meet in syc. The result is this video:
https://www.youtube.com/watch?v=vCwANW3IH60
The camcorder (on the left) seems to be in sync with the audio at first, the ndrifts away, but the webcam (right) is totally off right from the start. Notice how the webcam footage stops sometimes, while the camcorder footage is rolling. If you jump to the last seconds of this video - you can see how far off the webcam footage is in the end, still playing in the middle, while camcorder and audio are already finished with the performance.
The strange thing is that it's not the camcorder footage the one that seems to fail most - it's the webcam. Camcorder was a new thing . I edited webcam footage captured exactly the same way with success in Blender. An example with a ton of editing where the sync is solid:
https://www.youtube.com/watch?v=fEduGnD6ZKQ
Here's a screenshot of the session:
Symptoms
The issue appears unpredictably. Probably when different input video formats are used together. Only for movie strips, never for image sequences.
I know it's on when I sync Movie Strips in one point, I scrub to a different point and they don't match there.
I also know the issue is on, when I do some cuts, only to realize after rendering that my editing decisions were completely distorted and the cuts are not where I wanted them to be.
I know it's on when the original and aligned audio doesn't match up with the video, after 2 minutes into the footage.
Another sign of this problem happening is that 2 sources that started in sync don't end in sync - one is still "in the middle" while the other is over already.
But didn't you just forget to..?
I generate 25% and sometimes 50% JPEG proxy for all the footage. And most of the time I edit using that.
I enable Freerun timecode for all the footage also.
I have A/V Sync enabled at all times.
Testing the problem
So to finally find out what is happening I have captured 4-source footage of a 25-FPS Timecode counter going from 00:00:00:00 to 00:04:00:01
The sources are:
You can download all the video files here and do your own testing:
https://drive.google.com/drive/folders/0BxsUHyFo7VxfcUFJT2FTN0VWbHM?usp=sharing
Here's ffprobe output for all the files (omitting the redundant heading information):
Screencast
Camcorder
Camera
Phone
(I remuxed this video with ffmpeg to remove the GPS location tag: ffmpeg -i input.mp4 -metadata location="" -metadata location-eng="" -acodec copy -vcodec copy output.mp4)
The issue initially expressed itself strongly.
I have synced the 4-camera footage, having all 4 sources match on timecode 00:00:00:10 (on frame 1 the laptop screen was obscured by my arm when I pressed the spacebar to start the timecode).
I tested with VLC and all video files contain the full footage from 00:00:00:00 to 00:04:00:01. However - the phone is never getting so far. In Blender it ends earlier. I wasn't able to correct this by importing the footage multiple times, even though VLC shows me footage that Blender never gets to. Strange.
Heres' the resulting video, edited and rendered with Blender 2.78:
https://youtu.be/cPP7YX1ljFE
Generally looks like the phone is lagging behind by about 20 seconds, the rest stays within the limits of 8 frames of desync in relation to the Blender's timecode:
I hope we can sort this out finally.
Changed status to: 'Open'
Added subscriber: @TobiaszunfaKaron
Added subscriber: @JoshuaLeung
The problem here is that your various clips have different framerates (i.e. 30fps for the screencast, 25fps for the camcorder, 30fps for the camera, and 26.57fps for the phone).
Blender's Video Sequencer can only cope with having a single framerate for all movie clips (i.e. the one defined in the render settings). In other words, it doesn't know how to resample videos to get them to have a consistent framerate. That's why you'll see the video + audio streams getting out of sync, and also why some of the videos will look too long/short (depending on which one you used first - at least since 2.77/8, Blender will use the framerate of the first clip to determine the framerate for the project, and then all others will be interpreted accordingly).
AFAIK, there are currently no plans to add support for doing this sort of resampling, as there's no one working on the sequencer itself either.
What you could do in this case is to manually convert the clips to all have the same framerate (it looks like 30fps might be a good baseline, given that half your clips are in that format already). I suspect FFMPEG (or even VLC) should have options to do this.
Good luck :)
Added subscriber: @Funkster-3
I use mixed framerates a lot, so I made blender cope with it better than it does... it's not quite production ready yet as I do notice bugs when I'm using it, but I no longer rely on the "speed control" strip.
https://rightclickselect.com/p/sequencer/Ppbbbc/vse-playback-rate-control
I should put the patch up somewhere, I haven't had any time to work on Blender recently though.
aligortith, I'm not sure if we are on the same page.
I know Blender will not automatically compensate for different framerates and simply use 1:1 frame resulting in distorted video playback speed.
I have no problem using the Speed Control strip to correct this manually (as you can see in the screenshot).
Audio strips from movie import are very useful, because they show how long the clip should be after changing framerate.
Do you mean that the Speed Control strip doesn't work properly?
If this is a known problem, could Blender offer an option to resample the video strips using ffmpeg at import so they will match the project framerate?
Funkster, your patch seems like a great thing for what I want to do, I'd definitely check it out.
I downloaded your phone video, and I think that it does not have a consistent framerate - as algorith noted its average framerate is 26.57fps, but even with blender set to that rate it doesn't map correctly.
If the phone is dropping frames, all hope is lost of ever being able to synchronise it. Not sure if any video container has presentation time for each frame, but I doubt it - most video cameras have a stable clock so it's not required. I have a cheapo IP camera whose framerate drops when it's dark, and none of the usual video tools can handle it.
Added subscriber: @Blendify
Can this be closed?
Added subscriber: @mont29
Changed status from 'Open' to: 'Archived'
Yes it can, there is no bug here, this is user assistance task and should not be handled vie this tracker. User forums like blenderartists.org or blender.stackexchange.com should be used for that matter.