Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Video Unity Recorder: Low Video Quality

Discussion in 'Audio & Video' started by Selzier, Dec 16, 2018.

  1. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Hello, I render Music Videos using Unity and have recently switched to using Unity Recorder. However, the video has what seems to be compression artifacts and the video is low quality.

    Is there anyway to get a higher quality render with the "lines" running across the screen? (mostly on the right side)
     
    Last edited: Jan 8, 2019
    Vaupell likes this.
  2. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Unity: 2018.2.19.f1
    OS: Window 7 Pro SP1
    CPU: Intel i7-6700k
    RAM: 32 GB DDR4
    GPU: NVIDIA GeForce GTX 1050 ti
     
  3. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    126
    Hey @Selzier !

    We are indeed aware their are quality issues and we are currently working at a better way of setting and exposing the codec parameters, so anyone can reach the level of quality one needs.

    But as it is related to Unity Core and each OS Video API, it is a slower release timeline.

    That said :
    - did you tried both Movie Recorder MP4 / WebM formats ?
    - if targeting a camera (and not recording Game View) is an option for you, might be worth trying to use the Legacy MP4 recorder that allows to specify a bitrate (To see legacy recorders : Windows > General > Recorder > Options > Show Legacy Recorders)

    Let me know how it goes !
     
    Selzier likes this.
  4. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Ok thanks for the help, I prefer MP4 but I tried WebM and the quality is great! The only problem now is that the WebM render does not add audio to the final .WebM file. The audio track is added if I use mp4, but is not added if I use WebM. Is there a way I get Unity Render to add audio to the WebM video export?
    (audioSettings.preserveAudio is true)

    I also have a source .mp3 file so if possible I can just add that to the video render (It's just a music video so I don't need to capture any sounds around the scene).
     
    Last edited: Dec 19, 2018
  5. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    126
    I just gave a try and was able to export a WEBM with sound in 2018.2 with no issue (on OSX).
    So it should work.

    Do you have errors in the console ?
     
    yanpen likes this.
  6. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    There are no errors or warning, I even turned on Verbose mode. I made a video to show how the MP4 file will export the audio, but the WebM file will not.
     
  7. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    126
    The fact there is no sound playing while you are recording is a good sign, meaning the sound is redirected somewhere.
    Would you mind sharing the final WebM just in case ?
     
  8. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    That solved it! All I had to do was upload to dropbox and it played the audio for me. Obviously I have a codec issue on my local machine ;)

    https://www.dropbox.com/s/4oqdm7nxzmzvdap/movie.webm?dl=0

    Thanks for the help marief_unity! This is "Music Video Recorder" and will be on the Asset Store as a Unity 2019 Asset that uses Unity Recorder. By copying a URL from soundcloud and clicking 1 button, it will download the mp3, jpg from soundcloud, render with Unity Recorder, and upload to Youtube automatically.

    This will be a great tool for Youtube channels like Trap Nation
     
    marief_unity likes this.
  9. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    I do want to raise the issue that the .WebM export still has very noticeable compression artifacts, but it's better than the MP4 export. However, I would like to get better quality than this:
     
  10. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    126
  11. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    This is our current solution and takes a lot of disk space + time. Ideally, we could render a video like Adobe Premiere and just have an .MP4 exported.

    This is OK as a work-around for now, I hope we can use Unity Recorder to render actual videos (instead of image sequence) soon!
     
  12. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    241
    Can you not just expose the bitrate option to us? Alternatively, is there a source file i can edit to increase the bitrate of what is considered "high" quality? I tried looking but couldnt find any numerical values for bitrates that i can edit for current recorders, only found for legacy encoders.
     
    Last edited: Jan 23, 2019
    Selzier likes this.
  13. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    This quality problems makes "Unity Recorder" completely useless. They quality is terrible, even at High, and clearly this can be used only as a prototype. Any video producer cannot use this low quality video render.

    Unity, will there be any updates to Recorder or should we just plan to use "360 Pano Render" as our solution (image file render, completed by FFMPEG.exe)

    If I put "Rendered with Unity" on my videos, the viewers would be saying "Ehhh we better not render videos with that software!".
     
    Last edited: Jan 28, 2019
    LaurieAnnis and Conferno like this.
  14. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    There has been an increase in quality in the new 2.0 version of Unity Recorder with Unity 2019.2:



    Keep up the good work, thanks Unity!
     
    marief_unity likes this.
  15. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    49
    better ? you gonna kidding!
    The new unity recorder 2 is still usseless peace of junk. I need to record gameplay uncompressed movies for trailer and preview video to stores of my game. And what? I need to suffer with image sequences without sound? use spikes and shaman tambourine? or what if I want to record in 4k? mp4 will still create S*** quality. What a shame, Unity team.... this simple stuff in ue working out of the box from 2015, but here what we can see? 2020 soon and Unity still can't record screen with sound in lossless quality. Facepalm...
     
    Crossway and Garen_ like this.
  16. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    126
    Hey @Conferno,

    May I suggest you look at FFmpeg Recorder ?
    https://github.com/keijiro/FFmpegRecorder

    As mentioned before, improving the way quality is set-up in Movie Recorder is in our current scope, BUT we want to unlock it with a solution that will allow more flexibility and control than just setting a bitrate.
     
    LaurieAnnis and kcastagnini like this.
  17. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    49
    it can't record sound
     
  18. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    402
    I tried the ffmpeg recorder, and it has great quality, but the game is unplayable while recording. I'm on a 2018 Macbook Pro, but maybe it takes too much cpu power. Is there some setting to fix this? Yeah I had to record the sound separately it can be ok, but not ideal :)
     
  19. Clarludum

    Clarludum

    Joined:
    Apr 22, 2020
    Posts:
    1
    I found the video will play properly at high definition/resolution if the render texture is set at the same aspect ratio of the video (it seems not necessary to use the exact pixels frame width and height).
     
  20. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    What is the best way to record videos these days? I am recording animations, not real time gameplay.

    Usually the quality is fine, but sometimes (e.g. in wind zones with trees) the quality is poor in the recording. For example, here is a screenshot from several seconds into the video. It starts crystal clear, then reduces to this quality.

    upload_2021-8-16_12-14-9.png

    Here is the game window in Unity for reference.

    upload_2021-8-16_12-14-39.png

    I have a new 12 core i9, 32 GB memory, RTX 3080 - so I don't think a faster machine would help. Unity 2021.2.0b5.3166.2, Recorder 3.0.0 (from "Cinematic Studio")

    My settings:

    upload_2021-8-16_12-17-11.png

    What is interesting is if I change the media file format to VP8 WebM (instead of H.264 MP4) then when recording it slows down the playback, but the video comes out much higher quality. This is fine for animations (I don't need real-time performance). I am guessing it is the compression algorithm failing to keep up with MP4 - so it starts good, but gets too far behind so starts degrading quality so it can keep up realtime. With VP8 WebM it seems to slow everything down so it can complete the compression between frames.

    If this is the case, could a flag be added to MP4 to "slow down and get it right" for use with computer animation?
     
    RufferPhoto and LaurieAnnis like this.
  21. Dorian2010

    Dorian2010

    Joined:
    Sep 26, 2017
    Posts:
    1
    Hi, you still haven't solved this problem? I have the same
     
  22. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I use WebM and an external script to convert webm to mp4 separately. It got me going, so I moved on.
     
    LaurieAnnis likes this.
  23. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    211
    Im using Recorder 4.0.0 pre 2

    recording size 1080p 60fps, ryzen 3600 & nvidia 1650

    MP4 : records at decent speed, but image quality is horrendous, If my game committed a crime it would get away scott free cause I wouldnt be able to pick it out of a lineup, jpg quality = 1

    VP8: records at about 1fps (so unusable) but image quality is best, jpeg quality = 80

    ProRes Quick Time : Game slows down to about 1/3 speed during recording, image quality better than mp4 ~jpg quality ~50
     
    akent99 likes this.
  24. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
  25. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    9,943
    The jpeg quality for stills is also very bad. (unless something changed very recently)



    Personally I perceive it as a statement on what Unity thinks about the content its users produce: "These terrible settings are probably good enough for the bullshit people make with Unity".

    Something like that.
     
    kellywzy0914 likes this.
  26. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    320
    Maybe it's time to release those moths from that wallet.
    Lots of Pro recorders available in the Asset Store which can easily do what you want. Many of them.
    Check them out. A lot less stress and hassle than relying on a "free" Unity alpha experiment.
     
  27. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    9,943
    Nah, thanks, relying on the Asset Store is kinda bad too.
     
  28. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    188
    Resurrecting this very old thread:
    The latest recorder version, 4.0.0-pre.5 implements a higher quality h264 encoding, maybe it will alleviate some issues you are experiencing.
    This is compatible with Unity 2022.1 and newer.
     
  29. EJSainz

    EJSainz

    Joined:
    Mar 24, 2015
    Posts:
    29
    I upgraded my project to 2022.1 yesterday to test the new encoding.

    On the good side, rendering (or at least recording) is noticeably faster, but on the bad side the H264 encoding in high quality is still full of compression artifacts. I don't feel it's good enough for an internal demo.

    I finally rolled back to 2021.3.6f1 because I had issues with importing psb's, but in the future I'm resorting to generate PNG frames into a movie with some dedicated software.
     
    Last edited: Aug 12, 2022
    akent99 likes this.
  30. Mehrdad995

    Mehrdad995

    Joined:
    Jul 17, 2013
    Posts:
    46
    Just wanted to confirm the bad video quality also on Unity 2022.2.15f1 and Recorder 3.0.3 (latest version on my package manager)
    Settings->
    upload_2022-8-14_18-48-20.png

    output @1200x940
    upload_2022-8-14_18-50-17.png

    output @2400x1880
    upload_2022-8-14_18-51-6.png

    output @1200x940 - VP8
    upload_2022-8-14_18-52-51.png

    VP8 has very good quality but it makes the editor extremely slow (like 2-3 fps) and is only good if you want to record animations.
    Mp4 is always blurry regardless of the resolution due to low bitrate I guess.
    Wish we could set the target bitrate to fine-tune according to our needs.
     
  31. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,328
    You need a newer version 4.0.0 of recorder to see the improvements
     
  32. Banglemoose

    Banglemoose

    Joined:
    Dec 9, 2014
    Posts:
    9
  33. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    320
  34. Byproduct

    Byproduct

    Joined:
    Sep 3, 2021
    Posts:
    7
    4 years later and the H.264 option still produces crap videos. Silly because the recorder + cinemachine combo works fine otherwise, and seems to me it only needs to pass better quality/bitrate parameters to the H.264 encoder. Such a small thing but makes the recording practically useless.

    ProRes Quicktime / 422 HQ format seems to produce decent results, thankfully. Hard to play that format without stutter (at least on my machine), but Handbrake seems okay with converting it to good quality H.264 or other formats.

    I'd rather record in good quality H.264 directly though. Or H.265 even, if we can dream...
     
    Last edited: Nov 24, 2022
    JCorfer likes this.
  35. CelestialShark

    CelestialShark

    Joined:
    Nov 20, 2021
    Posts:
    11
    I'm a little disappointed Unity doesn't offer better marketing/recording tools for Unity. I just finished making my recordings only to realize a lot of it is unusable. I have steam & fog in my game, which means the lower recording quality becomes super obvious of different colors blend together.
     
    angrypenguin likes this.
  36. JCorfer

    JCorfer

    Joined:
    Apr 22, 2016
    Posts:
    16
    Export it to ProRes Quicktime / 422 HQ has been the solution for me. After I take the render and put it in Davinci Resolve (that it's free) to export H.264 with good quality.
     
  37. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
  38. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    80
    Hey @akent99! I'm curious which Unity H.264 quality was used in those tests?

    Since Recorder 4.0.0 (requires Unity 2022.1+) there is now an option to set custom bitrate for H.264 encoding which should give you much better control and quality over the previous presets (low/medium/high).

    Screenshot 2023-03-01 104310.png
     
  39. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Not being an expert on what numbers are best (and because it's what I think most people would do), I picked the "High" preset. Flipping to "Custom" shows the following settings.

    upload_2023-3-1_8-56-52.png

    It is worth remembering I zoomed way in on the image - it still looked pretty good. I was interested in comparing the options available, quality of their results, file size, and usability.
     
    cguertin likes this.
  40. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    80
    The main setting controlling the quality would be
    Target Bitrate
    . For a comparison, this is the approximate target bitrate for each preset when recording at 1920x1080 (the values scale proportionally based on the resolution):
    • Low: 2 Mbps
    • Medium: 5 Mbps
    • High: 8 Mbps
    So if we found that the High preset is not sufficient, we could switch to Custom and incrementally set the bitrate to something greater than 8 until we are happy with the quality.
     
  41. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Completely up to Unity of course, but it was interesting to see the "High" preset for MP4 and WebM generated different quality videos with very different file sizes (WebM was 5 times bigger). I would have expected "High" to generate similar quality videos.