elmopl / ktba

Blender addons
MIT License
56 stars 12 forks source link

Suggestion: render to image sequences #12

Closed snuq closed 6 years ago

snuq commented 6 years ago

First i want to say, this is a great addon, I have been wanting to code something like this for a while, but it looks like I dont need to now :)

I would say tho that this script should probably render to image sequences only, if not required, it should at least be suggested, and definitely should be an option. For any larger projects (I just finished editing a 2 hour movie...) doing an image sequence pre-render, then pushing that to a final export is pretty much essential.

Some reasons for it:

  1. Depending on the movie format, lots of short segments could have issues with frames not matching up properly, and there's always the problem of quality loss from 'a copy of a copy'.
  2. Image sequences could be easily re-rendered directly in blender (not needing ffmpeg external), and the script could create a scene specifically for that render when it finishes.
  3. I'm not sure how (or if) your script handles partial renders (wont the videos be partially written and thus corrupted?), with image sequences the script can check the render directory for what it still needs to rendered and only do those frames.
elmopl commented 6 years ago

I have redone my checks and it is possible now to run the script even for image outputs. I only disable concatenation option if it is not movie, as that for sure is not going to work with ffmpeg as it is now.

One thing to note is that this script really only helps if your work is in VSE. 3D renders/animations will not gain much from using it as Blender 3D renderers are already heavily parallelising, so there will be no gain there (although I do see why you might want to render from VSE to images too).

Regarding 3rd point, I am not sure what you mean by 'partial' render. If you cancel render and use movie format output file will not be usable. As my script splits things in chunks you can save some of renders as they will be separate videos (until concatenation happens at the end of run when all is rendered).

snuq commented 6 years ago

Image sequences are good for most of the editing i do - first, i work a lot in 4k which really kills the render times, i also tend to use a lot of compositing (either using scene strips with the node editor, or using lots of transparency layers in the vse) which really slows things down, and i tend to edit rather long projects.

For the third point, i was thinking about if blender crashed halfway through a video render. When this happens, it just leaves the partially generated video file there, which will play for whatever is rendered, then be corrupted. I'm concerned that as far as your script is concerned, the video file would exist, and thus be valid and not overwritten, thus ending up with corrupted frames in the final render.

You could have the script write a temporary progress text file to the render directory, which would just be a list of the valid rendered frames, and have it use that instead of just checking if the file exists, that way it would only write those frames to the text file when its actually finished rendering them.

elmopl commented 6 years ago

Immediate to the subject line I think is somewhat fixed, so I am going to close this issue.

For enhancements on working with images and recovery from broken videos are two other issues.

For case when blender crashes while generating one of batch items to video output I created #13. This should be fairly simple to fix that I might look into at some point.

For handling issues when rendering image sequences feels like bigger job I will have not time to look into. If can create an issue for this and maybe someone else will like to pick it up and make a pull request. I think if you decide to raise an issue for that enhancement you should come up with workflow steps you do, how you would like it to work (i.e. what should happen when Blender crashes, etc.). If we decide on discovery of frames rendered and only rendering missing ones I think I will need some help with coming up with how to show this in UI so that's flexible (so potentially how to make a usable list on which you can select one of thousands items/ranges). It would be ideal if you could find already existing UI elements/addons that show the UI that could be used to represent and manipulate this kind of information (I don't use Blender that frequently, so nothing comes to top of my head).