Video rendering, Callbacks and ordered sequences

    Misc

    Norman Freund's icon
    Norman Freund's icon
    Norman Freund
    Jan 28 2023 | 6:49 pm
    Getting Max to execute objects in a particular order and only advance to the next task once the first task is completed — that is my challenge. The objects in question are those with no call backs.
    So here is the context:
    I am working a video rendering to movie file project and am continually getting in trouble with Max objects not providing call backs once the assigned the assigned task is completed. For signal and matrix processing no troubles, there is an input and an output once the task is done — there is a definite signal path, so things get executed in the correct order. Now when rendering all those matrices to pictures and saving them to disk, things need to be done in a particular order. So far inserting the delay object is my solution. Ok some examples: mtr object message to begin recording (no call back), jit.record object message to accept images to a file via write message (again no call back). Surely there must be a better way than cross your fingers and if that fails insert a delay on dowstream tasks?
    It seems there are a lot of objects in Max that can be called upon to do a task, but you as the programmer can not tell when such a task has been completed. Perhaps I need to think about it a different way.
    Thanks in advance, Norman.

    • wbreidi's icon
      wbreidi's icon
      wbreidi
      Jan 30 2023 | 12:16 pm
      Hello, I'm not sure if I understand well, but have you checked the [trigger] object ? Also the [record] object, I think, sends a job done message from its right outlet if I remember well. What does your console say?
      Share
    • Norman Freund's icon
      Norman Freund's icon
      Norman Freund
      Jan 31 2023 | 6:35 am
      Hi Wbredi, The trigger object does not solve the problem, naturally I have made extensive use of the trigger objects to obtain the correct firing order, however some objects do not have a call back saying they are done, so for these as soon as the object is given it's task, the next trigger in line for firing in the trigger object list get's it's turn -- but those critical objects with out call backs may not have been done yet. The record object is fine for audio recording, but my challenge is with the jit matrices of textures/pictures which are mutlidimensional, compare one dimensional for the audio streams. Perhaps the other way of thinking about it, is to not use objects that do not have a call back, which are execution order dependant.
      The project I am working, has had some changes since my first post, all working fine for a small segment of the Live Arrangement view time line, but then effectively drops frames for the full time line. I am recording all inputs in x1 time scale, then replay this in slow motion, giving the processes more time to complete, perhaps I have to slow it down even further.
    • LSka's icon
      LSka's icon
      LSka
      Jan 31 2023 | 9:08 am
      I don't know if you already know the oneirotomy package: https://github.com/xenorama/oneirotomy/ and if it could suit your case.