Page MenuHome

Image node not starting sequences on the correct frame, and background image frame count is incorrect.
Closed, ResolvedPublic

Description

Problem #1

I'm preparing an in depth tutorial on rotoscoping with Blender and I ran into a problem that took me awhile to track down.

I've prepared a simple .blend file to demonstrate the issue.

The attached .zip file contains:
a blend file;
a movie file containing 25 frames of film leader;
and 3 identical image sequences of the film leader. The only difference between the image sequences is the start value of the file numbers.

Look in the node editor and you'll see 4 image nodes.
They are named appropriately for what they contain.
"Image" contains the movie file.
"Image.000" contains an image sequence numbered from 0.
"Image.001" contains an image sequence numbered from 1.
"Image.002" contains an image sequence numbered from 2.

All the image nodes are set to "Start Frame: 0" and "Offset: 0"

"Image" and "Image.001" display the frames in sync (correctly) when you scrub the timeline.

"Image.000" displays the frame incorrectly. It is 1 frame ahead, and if you set the timeline to 0, the first frame of the sequence doesn't even display.

"Image.002" displays the frame incorrectly. It is 1 frame behind.

It appears that Blender is using the file names of the image sequence to determine when the first frame should appear.
It is disregarding the "Start Frame: 0" entry.

I know you can set an Offset value to correct this, but this is not how it should work and it is going to waste the time of many people who won't understand why their image sequences aren't in sync.

If you are doing rotoscoping with the new "RotoBezier" addon, it will be common to load a video as background in the camera and then keyframe a curve against the video. If you leave your start frame for the background image at "0" and then render your mask out to an image sequence, you will have frame numbers starting from "0." Then when you load them into the Compositer in an Image Node, you will run into the problem I've detailed. In this case, the roto work you have done won't align properly with a video loaded into an image node. Without doing a test like I did, you won't know what the problem is!

In addition, I loaded the movie and the three image sequences into Adobe Premiere Pro, and the 4 views were in perfect sync as they should be. Video editing applications don't use the file names in image sequences to determine when the first frame should appear.

This is really going to confuse people.



Problem #2
If you load the video file into the background image of a camera, and click the "Match Movie Length" button to load up the proper frame count, you will see an incorrect value.
It says there are 26 frames in the video. There are only 25.


Event Timeline

Thanks for the wonderful clean example :)

Up to recently, defaults in Blender assumed a first frame would always be 001. This was recently changed, but not updated for image sequences.
I know the "offset" and "start" options are confusing at best... but this is code we use for 15 years already. :) Can be made much friendlier some day.

Anyway, will fix all this now... hold tight!

OK, here's the issue:

- the code still assumed the first frame of movie files or sequences of images was '1'. That's allowed to be zero now too for sequences. (will commit)
- however, movie files will always still use 'frame 1' as first frame. That means that in your setup, with "startframe 0" the first image (1) shows on frame 0.
- even worse: if you use image sequences, setting "startframe 0" will also put image 1 on frame 0.
- and then the culprit: to get image 0 play on frame 0, you have to set startframe to -1 :)

I would really advise you to present your tutorial with a default to start always with frame 001 as first frame. That's the default, and it makes counting files simple.
Based on popular request, we allowed the 'start frame' for rendering to be frame 0, but this will just cause confusing situations like here.

Note: simply changing the meaning of 'startframe' to denote "name of first file in sequence" will break compatibility. The meaning is instead "the blender frame a sequence starts playing, assuming the sequence starts with 001". It's certainly an area for improvement, but that's altogether a different topic. I will make a note about this for when we work on that. Adding a button that says something like "first file # in sequence" could help...

(BTW: I don't know a button "match movie length", nor do I know how to add a video file as background to camera?)

Ton Roosendaal (ton) changed the task status from Unknown Status to Resolved.Dec 18 2010, 8:05 PM

I'll do that for the tutorial.
But I think a simple fix for this would be to make Blender ignore the file names just like video editing software does, and use the first pic in an image sequence as the first frame no matter what the file name is. We should try to make Blender work the same way other video software does as far as the "Image" node is concerned.

Surely you jest Master Ton!
Adding a background video to a camera is easy.
Watch my Rotoscoping tutorial series at goodspiritgraphics.com


Good idea, the file you select as 'sequence file' then just becomes first.

Maybe you are using a patched blender? Background images for 3d views are not added to cameras, but there's a patch allowing it afaik.

I downloaded the current official release. It is 2.55.0 rev. #32738 from Blender.org. It is not a patched version.
If you go to the background images panel and load up a video file you can select "All Views", or "Camera" View and your movie will pop up in the camera view.
In that panel is a button called "Match Movie Length." If you click on that you will see that it is showing an incorrect frame length. Try it with the example I provided you.

OK, you add a regular background image, but set to camera view :) There's a patch that allows to add such images to objects and cameras individually.
My build had movie reading disabled atm, so I couldn't test buttons for movies...