0
$\begingroup$

I want to use blender to read a video clip that had been edited and show me the edit points. It's a shot change detector. I made it in the compositor and can make it in geometry nodes. I chose the compositor as I thought I could use the less than math node as a boolean switch to control the render output type. If I can make blender write a still frame then it will overwrite all the frames that are NOT change frames. It will then return to writing animation frames with frame numbers appended. I thought I could interrupt the write process after the compositor reads the frame? As someone else changed the flag here change render type to still

I'm trying to get blender to change it's image save type during render from animation(with frame numbers) to still(no frame numbers). I don't know which frames to render until my compositor tree evaluates a source movie, then it will trigger a state change based on a Less Than result. I looked at my Info panel and discovered that I could find the node as

bpy.data.scenes["Scene"].node_tree.nodes["Math.001"].operation = 'LESS_THAN'

But I don't know how to reveal the Result? If I can get that I should be able to build an IF ELSE to control the render state using

bpy.ops.render.render(write_still=True)

How can I read the math node's output?

$\endgroup$
5
  • $\begingroup$ i might be wrong but i think that's not possible. One reason is because the compositor works (as GN does) on pixel basis so it's not just one but many values (as fields in GN) $\endgroup$
    – Chris
    Commented Mar 11 at 12:35
  • $\begingroup$ the only way i could imagine to solve that would be to write a python script which "does everything", what your compositor nodes does until your less_than node $\endgroup$
    – Chris
    Commented Mar 11 at 12:36
  • $\begingroup$ But I don't know if I can read and subtract movie files from each other per frame then determine s mean result and run the less than over it. I'm really surprised that I can't send the math node result out from the node group. I wonder if it could drive a property, could I access that instead? $\endgroup$
    – 3pointedit
    Commented Mar 11 at 12:45
  • $\begingroup$ as i wrote - i might be wrong, but these node results are many (!) values. It's like in the shader editor - you cannot get the output values either to use it for something. I recommend describing a bit more what you wanna do, so maybe there is totally other solution for your problem. e.g. if the movie image doesn't change to much, just render one image instead of a movie ... $\endgroup$
    – Chris
    Commented Mar 11 at 12:55
  • $\begingroup$ I don't fully understand your question. Do you want to change render output typ during render time? Maybe just do render 2 times from range A to B, and second render at C frame. $\endgroup$ Commented Mar 11 at 20:09

1 Answer 1

0
$\begingroup$

To get the output of the compositor you need to use bpy.ops.render.render. So before rendering each frame you need to render the output image of the Less Than setup and analyze the pixels.

The answer to your question is not a sentence or a step by step guide. One should need to write an actual ~100+ lines script and debug it along side answering you.

Besides that it will be more appropriate to add a File Output Node in your compositing setup that would save the Less Than image outputs and using it rename all the frame files accordingly after all the renders done.

If it is not about actually rendering in Blender you are better off not using Blender at all, just google "ffmpeg remove duplicate frames".

$\endgroup$
5
  • $\begingroup$ The less than node is a math node so returns an integer. I want that as a flag to determine if blender should write an animation frame OR a still frame. I understand that you think it should render twice? $\endgroup$
    – 3pointedit
    Commented Mar 11 at 21:42
  • 1
    $\begingroup$ It is not an integer and it does not exist before an output node. At best it is an array of pixels. The Blender's compositor operates on a per-pixel basis and does not support a conditional node tree execution. $\endgroup$
    – unwave
    Commented Mar 11 at 22:06
  • $\begingroup$ Oh ok. Thank you for your patience. I did not understand that. I guess ok try the geometry nodes approach instead. Will still require this file save change however. I've seen another stack x Post suggest you can alter this flag $\endgroup$
    – 3pointedit
    Commented Mar 11 at 22:58
  • $\begingroup$ Unwave I'm confused how does it not exist before the output node? $\endgroup$
    – 3pointedit
    Commented Mar 12 at 0:01
  • $\begingroup$ I dud consider trying to make the file output node trigger an alternate file name but blender forces the frame numbers to be appended during animation which is why I want to trigger the Write Still conditionally $\endgroup$
    – 3pointedit
    Commented Mar 12 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .