Search Unity

Question Replacement for Unity screen recorder?

Discussion in 'Audio & Video' started by RichyK, Jan 28, 2024.

  1. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    Hi all, I've made a music video using Unity. I used kdenlive with a project set to HD at 25fps to set up the guides for where the lyrics and some beats were, exported them to Unity, where they are read and processed. Camera angles have been set up in Unity, each one linked to a guide, with the duration of the camera angle automatically calculated.

    Each frame, I advance my pointer that controls the camera position and orientation by 1/25 of a second so that no matter how fast or slow Unity renders the frame, it's still 1/25 of a second and my video should still sync with the music in kdenlive when I import it.

    The problem is that Unity's screen recorder is crap. I'm running a version of Unity from 2022 and the latest version of screen recorder (v4 something).

    Mp4 at HD comes out poor, so does webp, even if I play with bitrate, which doesn't seem to make any difference to the quality.

    The Apple codecs are jittery, the rendered output flows then jitters, jumping back multiple frames. The highest quality one from Apple, the top one in the list, looks good quality but the jitter ruins it.

    I'm tearing my hair out trying to work out how to get a rendered video out of Unity. I've tried OBS and a few others but a Windows screen recorder won't do the trick due to the different durations that Unity takes to render each frame.

    I need to get my video out of Unity, does anybody have any ideas how I can go about it? I've thought about upgrading my version of Unity but I can't really afford the disk space and given that I'm using the latest version of screen recorder I don't see that it will make any difference. I would've thought that Unity was mature enough by now to provide a top quality screen recorder to render cut scenes.

    Is anybody able to help?

    Thanks

    Richard
     
  2. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    142
    Hi there !

    Sorry you are experiencing issues with Recorder. What you describe is indeed not what I would expect from Recorder, especially with a recent version like 4.X. So let's try to find out what is going on.

    First, just in case, please clarify the specific version of Recorder you are using.
    I would also need to get your precise Unity version (ex: 2022.3.15f1) + OS you are using (Windows what ?) to try to repro.

    I did a quick tests on Unity 2022.3.15f1 / Recorder 4.0.2 on Windows 10, using Movie Recorder, recording game view in 4k, using Unity Media Encoder with H264 codec and High quality profile, and didn't notice anything unexpected (quality was good).
    I also tried custom encoding quality set-up and was able to observe changes corresponding to my intentions (aka bad quality when I tuned the set-up to be bad).

    So what could help bring the investigation further is:
    - screenshot of the Recorder parameters you tried
    - if you can, screenshot of the bad quality artefact you see in your exports

    Also as fine tuning these parameters can be tricky because it requires some codec knowledge, I'm sharing just in case it helps, the portion of recorder doc explaining Unity Media Encoder params, and this external page that explains well how to set-up H264 parameters.

    Thanks !
     
  3. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    Hi! Thanks for the reply!

    I ended up writing a bit of extra code to screenshot each frame to PNG, then spent ages trying to work out how to convert 6000+ image files into a lossless movie file, ending up with a 7gb+ mkv file.

    I've since archived my project to an external drive, but I'm wondering if it was because it all wasn't brightly lit, it was dusk / night with illumination from car headlights and a helicopter searchlight. I know that mp4 does not handle dark scenes well.

    I'm tinkering with another music video, this time for an Alice Cooper song, it's not a definite but I'll see how I go with accumulating assets for it.

    I'll see how this one goes and, if it gets to the stage where I can cut a video file of it, I'll see what the quality is like and let you know.

    Thanks

    Richard

    Ps if you are curious, my video was an unofficial video for the Sparks song Take Me For A Ride

     
  4. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    142
    Great to hear your were able to find a workaround.
    Ya, definitely dark environment are trickier to encode because our eyes discriminate very well details in blacks (more than in highlights).

    Out of curiosity, why not using ImageSequence Recorder directly instead of writing up a script ?
    Also, in case what you used to create your final movie is FFMpeg, Recorder comes with a sample that shows how to redirect your stream to an FFMpeg command.
     
  5. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    I had downloaded ffmpeg and changed the Recorder to use ffmpeg, but results weren't very good. I ended up using ffmpeg from the command line with various options to join all those PNG files in to a lossless mkv.

    I'll give the ImageSequence Recorder a go next time and see what quality I get out of it

    Richard