Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

How hard would it be to add custom "extra processing" to Recorder clips?

Discussion in 'Virtual Production' started by akent99, Aug 8, 2021.

  1. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I have a challenge very specific to my project (good chance no-body else needs it). I want to create video clips, but for every clip created I want to save an image for the first frame and I want to take the last frame and make it fade out for half a second.

    (My use case is I am trying to create "Web Stories" (https://stories.google/) for an animated comic. For each video clip it is recommended to have a placeholder image so it can download that while starting the video stream. Also, feedback from users was each clip ends abruptly - they would rather the last frame freeze and fade out by 30% for like half a second just as a video cue it stopped on purpose.)

    I can write a separate script to go through a directory of files and try to manipulate the video clip files that way (current plan), but was wondering if it was easy to add "plugins"(??) to the video mode of RecorderClip? Or hack a copy of the video recorder (e.g. inherit from existing classes?) (I copied and hacked Storyboard Tracks as well - so I could put cartoon speech bubbles in a track - but copying and hacking the code means I have to keep it up to date from now on - wondering if there is a more elegant way.)

    Thanks!
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    The Recorder will allow you to export a single still or a series of stills. Maybe the first frame could just be a second Recorder clip to do exactly that?

    For the final frame, I'd have thought it'd be a lot easier to simply stop the action and continue to record for a half second (perhaps with a post processing effect to get the fade).

    I realize these don't exactly answer your question about custom processing...but I think these might be the most straightforward ways to get the outcome you're after.
     
  3. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Yes, that is what I do now. At around 50 to 100 pages per episode, that is 50 to 100 more recorder clips to manually set up. I have been working on automating it, but the hold-and-fade at the end does not seem as easy as I need it in the video file. As soon as I have to manipulate a video file, I may as well do it all there. (I tried using the Unity video support - but failed to get it to work - it seems like it is designed for Play mode. But still learning!)

    Yes and no - I can stop the action, but all the physics don't stop (falling leaves on trees, wind blowing, etc). I would have to turn all that off as well (50 to 100 times per episode).

    This is the answer I expected - probably easier to write a separate script in this case. Thanks for the info - knowing I am not missing something obvious is actually a big help!
     
  4. thomastt_unity

    thomastt_unity

    Unity Technologies

    Joined:
    Nov 6, 2018
    Posts:
    16
    May I suggest another approach?

    For the fading, have you considered to use an animation track to control the alpha value of an Image widget? (set with no image, black color). You would have total control over the fading curve and its timing. Also, you can also have the first frame with the placeholder you want. Just make sure to setup the canvas to the size that fits your video outputs to avoid glitches.
     
  5. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Thanks. That makes sense for animating the fading. I was hoping I could hold the last frame of the video as well (no wind blowing trees or leaves falling), but I have a few things to try. Thanks everyone for the suggestions!