1

Topic: Rendering as an image sequence

Hi everyone

Yesterday I did my first animation in AoI smile (I posted it under the animation forum)

I realized that rendering your animation as a sequence of images as opposed to rendering it directly to a video has the advantage of one being able to resume the rendering process at a specific frame, should the rendering have been interrupted for some reason, instead of having to render from the start again when using video as output. When cancelling the render, the video file will be saved to that point, however if the Java process is terminated unexpectedly, the video file is corrupt.

The problem however is that in the render dialog you can only specify the start and end time and not the start and end frame. If you have a 25 second animation at 30fps, the image sequence will consist of 750 frames. If rendering was interrupted after frame 400 and you want to resume at frame 401, you first have to figure out at exactly what time frame 401 is so that you can use that as the starting time.

It would be nice if there was a feature in the render dialog so that you can specify either the start and end times or the start and end frames.

What do you think about this?

Thumbs up

2

Re: Rendering as an image sequence

sounds good, I usually use the slider bar for frames/time on the animation panel to figure that stuff out, but anything to make life easier sounds like a plan

May it be an evening star
Shines down upon you
May it be when darkness falls
Your heart will be true

Thumbs up

3

Re: Rendering as an image sequence

advantage of one being able to resume the rendering process at a specific frame

That and also, that you can preserve better image quality through post processing...

a feature in the render dialog so that you can specify either the start and end times or the start and end frames.

Yes, I have done some sub-sequence rendering myself some times. That kind of a feature would be helpful.

Basically, the information that is needed would be
- The start time of the original/full sequence. (It may not be zero. I have used things like minus 12 seconds.)
- The number of the first frame in the original/full image sequence.
- The start and end frame numbers of the sub sequence.

And I think
- The frame numbers also displayed as the corresponding scene times.
- And vice verca if the user chooses to use times instead.

At it's most simple form this could be just a calculator, that then programs the sequence to the render dialog but then there are more questions like, should it remember, what has been rendered before and how is that information saved? With the scene or with the image sequence?

One useful feature might be he possibility to renumber a previously rendered image sequence. (That is pretty hard to do on the system UI.) -- So you'd be able to add images in the middle or the beginning or something like that.

When I keep thinking, it comes to my mind, why couldn't the rendering sequence be marked on the Score? Or at least a time line of some kind?.

Currently AoI remembers renderer settings otherwise but not the image resolution or animation settings. I'm not sure of all the details now, but it might be possible to add this feature as a plugin ... somethign like "RenderSequence tool".

How do those ideas sound to you? Any detailed ideas on how it should look like or how it should work? -- I'm not making any promises of actually getting at it, but let's make it a request at least. smile

...there's more to the picture than meets the eye...

4

Re: Rendering as an image sequence

Perhaps it can work as follow:

There could be 2 extra input fields in the render settings dialog, one next to the start time and one next to the end time. When you enter the start time, the start frame input field is updated with the frame number at that time. When you enter the start frame, the start time input field can be updated with the corresponding start time. And the same with the end time and end frame.

The Score class calculates these values and displays them in the score window, so the render dialog can calculate these values in a similar way. So the renderer can still use the start time at which it should begin the rendering, the only difference is that if you enter the frame number at which to start, it will calculate the time of that frame for you and enter it in the start time input field for you.

As for the file names, the user can be prompted to enter the file name and then just append the frame number at which the rendering will start, like it currently does. For this to create the correct sequence, the user will have to enter the same file name as during the previous render session. So for example if I saved my sequence as Frame.png, AoI will generate Frame0001, Frame0002 etc. So if I continue my sequence at say frame 401, I will save the image as Frame.png and AoI will continue the file name at Frame0401.png etc. So even if you render a sub-sequence of the sequence and you place all the files in the same folder, they will still be sorted correctly.

In this case, AoI does not need to remember the sequence settings from the previous render session as it will rely on the user to enter the correct details to match the previous render settings.

Thumbs up

5

Re: Rendering as an image sequence

When you enter the start time, the start frame input field is updated with the frame number at that time. When you enter the start frame, the start time input field can be updated with the corresponding start time.

In principle yes, but there is a little bit more to it than that: Currently the default is that time 0.0 corresponds with frame number 1 and when the UI suggests the firts frame number, it is based on that assumption. BUT the user can change that.

I might have perfectly valid reasons to set the frame number at time 0.0 to be for example 300. Then if I want to render a sequence from 458 to 539, I first need to be able to set the "anchor" to 'time 0.0 = frame 300' or the calculation between the frame number and the time will be off by 299 frames.

Currently there also is a problem with the filenames with negative frame numbers. It usually makes sense to create a scene, where the action starts at 0.0 seconds, but once that is done, you may want to add an intro part that begins at, say -10.0 seconds. Then frame numbers will by default start at -299.

Unfortunately the minus sign is just added into the filename as such, extending the file name by one character. After that arranging the images by name shuffles them pretty badly. Arranging by creation date works until you decide to re-render a set of frames, that is even partly in the negative numbers. After that there is no way of arrangin the frames in the correct order, but to do it manually....  Or to render the whole thing over again.... (I tested, how GIMP reads an image sequence. Anything that relies on the system's arranging methods probably works the same way)

But anyway, I'll write feature request out of this soon. I think at the simplest it could be just a frame-to-time-to-frame calculator and if it works directly with the render-dialog all the better. smile

...there's more to the picture than meets the eye...

6

Re: Rendering as an image sequence

Yes, the "anchor" point can perhaps be a bit of a problem if the user decides to change it. However if we assume that the user don't want to change this, and that time 0.0 will always be frame 1, we can overcome the issue with negative frame numbers as follow:

For positive frames, AoI prefix the string "_b_" in front of the frame number. So if I render frames 1 to 5 and save my file as Image, then I will end up with the following :

Image_b_000001.jpg
Image_b_000002.jpg
Image_b_000003.jpg
Image_b_000004.jpg
Image_b_000005.jpg

For negative frames AoI will prefix the string "_a_" in front of the number. This number is calculated as follow: 999999 - frame number + 1 (this however has the restriction that we can only render up to frame -999999). So if I render frames -5 to -1 and save my file as Image, then I will end up with the following:

Image_a_999995.jpg
Image_a_999996.jpg
Image_a_999997.jpg
Image_a_999998.jpg
Image_a_999999.jpg

It will therefore not matter where you start and end the rendering sequence as the file names will always be in sequence in the file system provided the file is saved with the same name. So if I render from frames -5 to 5, I will have the following:

Image_a_999995.jpg
Image_a_999996.jpg
Image_a_999997.jpg
Image_a_999998.jpg
Image_a_999999.jpg
Image_b_000001.jpg
Image_b_000002.jpg
Image_b_000003.jpg
Image_b_000004.jpg
Image_b_000005.jpg

This will require several changes to the existing code, so perhaps a plugin would be better suited.

  smile

Last edited by WolfyCL (July 21, 2017, 2:41 am)

Thumbs up

7

Re: Rendering as an image sequence

I wrote a little calculator that can do the calculations. And just for interest's sake I added a feature that generates the file names  smile

Image Sequence Calculator

Thumbs up

8

Re: Rendering as an image sequence

This is fine but I have some accuracy fears about floating pt numbers and such... maybe pete can easy my mind about this.  Anyhow the way I see it is the integer frame numbers are more accurate because you are just doing +1 each time... so if you are rendering 30 fps and want to redo from 3.43535 seconds again, just round down to the nearest integer in this case 3 and muliply by 30/do the integer part and rerender a small portion of the scene with the proper integer numbers in there, might be more accurate, than trying to render from 3.43535 and some other random numbers, then again maybe it wouldn't matter as long as the sequence is right... just thinking about how it would work in practice is a little troubling, I guess AOI already does this floating calculation if you start at a certain time, Im mostly worried about very irrational framenumbers getting miscalculated, like say you had the number "1/30"="0.33333...." where is something lost in the sequence of images or what number are they calculated at, but again could just be that the sequence itself would take care of it since video will be a constant rate when batched together.

My worry comes from losses in float to integer and integer to float conversion is all I am getting at there.  I'm no expert on how AoI currently does this though.  So could still be handy to work on something like a calculator for it.

May it be an evening star
Shines down upon you
May it be when darkness falls
Your heart will be true

Thumbs up

9

Re: Rendering as an image sequence

That is actually an interesting problem I ran into when writing the code. The score in AoI works on 30fps,so if you move the green slider to 1 second, it will indicate it is frame 30 etc. I looked at the code of AoI and from what I could see was that when frame numbers are calculated, the time is multiplied by the fps and then the ceiling value of the answer becomes the frame number. I rounded the the time upwards. If you use 30fps in the calculator, the values matches those as displayed by the score, however I don't know what will happen if you use a very specific time as you've mentioned.

What was also interesting is that when you render from time 0 to time 12 seconds at 30fps, you end up with 360 images, however you should have 361 images, as frame 0 should also be included, so I'm not exactly sure how that works. smile

Thumbs up

10

Re: Rendering as an image sequence

Well, with 30 fps a 12 second render should produce 360 imagse as it does and the 361th one belongs to the next 12 seconds, though IMHO the frame numbering should be 0 to 359 instead of 1 to 360. What happens at a movie render, 360 are rendered and the 361th (at exactly 12 sec) is only produced on screen.

One thing to consider is that currently  there is no connection from the score to the actual fps setting of the rendering. The score always shows 30 fps, what ever you wish to do. Building that connection would require some rethinking of the UI, so that you could set the rendering sequence directly on the score. What exactly would be a logical and intuitive approach, I can not say at the moment.

(And OOT, similar things should be built between the Camera view and the rendering UI. The camera view definitely should display the aspect ratio of the rendering setting so that framing a scene could happen without extra trial and error rounds and the aspect ratio, resolution and other rendering settings should be accessed through the camera(s) as well)

Valid questions. smile

Last edited by peteihis (July 30, 2017, 10:37 pm)

...there's more to the picture than meets the eye...

11

Re: Rendering as an image sequence

I wrote a little calculator that can do the calculations.

For some reason it does not accept desimals if I write to the time field. It's possible that it is because the local settings use comma as decimal separator, but the .exe does not know that...

...there's more to the picture than meets the eye...

12

Re: Rendering as an image sequence

Finally:

https://sourceforge.net/p/aoi/feature-requests/381/

Feel free to discuss options and details. smile

...there's more to the picture than meets the eye...

13

Re: Rendering as an image sequence

Thank you  smile

Thumbs up