Search Unity

Video videoplayer compression

Discussion in 'Audio & Video' started by fildax, Apr 15, 2020.

  1. fildax

    fildax

    Joined:
    Apr 7, 2017
    Posts:
    37
    Hey,
    so, I have prerendered intro and cutscenes for my game. When I use non transcoded video, my game crashes during intro ( only in build though ). But when I transcode, I lose quality and my video have artifacts ( I transcode MP4 files from sony vegas ) - should I transcode uncompressed video to get best quality? Or what format should I choose to get best quality?

    Thanks in advance for any tips.
     
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi!

    It'd be nice if you could submit a bug so we can look at what is happening. It's plausible that we cannot support all possibilities of mp4 files (there is a myriad of possible codecs, settings, track types and so on), but Unity should ideally report what's not supported to guide you towards adapting your media files.

    Using the H.264 video codec, with the Baseline profile and a max resolution of 4K (4096 × 2304) will get you the best compatibility. This is just a broad recommendation since I don't have details about the media source files and the platform you're targetting. Note that with H.264, you can still produce very high quality videos if you allow for a higher bit rate.

    Hope this helps,

    Dominique
    A/V developer at Unity
     
    CodeRonnie likes this.
  3. fildax

    fildax

    Joined:
    Apr 7, 2017
    Posts:
    37
    Hey Dominique,
    I will try to render it in h264 stright out of Vegas and try to use it without unitys transcode. ( h264 is not in vegas by default, had to download it )

    About the crash - its kind of strange, but the crash happens with no additional info - it just stuck and crash to desktop with no popup, nothing. Also, only happens in build, not in editor. I guess it will be something with the MP4 file I was using.

    Im also using old 2017LTS for the project.

    Anyway, thanks for tip!
     
  4. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    In this case, I wonder what the original mp4 contained? It probably plays a good part in the crash: mp4 with video tracks other than H.264 or H.265 is quite uncharted territory. But this is no excuse for crashing of course, so my recommendation to submit a bug remains!

    There have been a number of crash fixes in this area in ulterior versions but I'm not sure they've all been back-ported (it's more of an on-demand affair, to not cause too big a churn in older versions).

    So I guess changing to 2018 LTS or even 2019.3 is out of question for your project, but just trying out this video in a more recent version of Unity may tell you if this has been fixed already.

    Have a nice day,

    Dominique
     
  5. n8burba

    n8burba

    Joined:
    Feb 4, 2013
    Posts:
    12
    I had this issue. I changed the render texture's color format from 8-bit to 24-bit color and it fixed it.