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.
  2. Dismiss Notice

Question Video vs Sprites

Discussion in 'Audio & Video' started by AMishkov, Jun 12, 2023.

  1. AMishkov

    AMishkov

    Joined:
    Dec 29, 2020
    Posts:
    2
    Hello,

    I have several sequence of 120 sprites with size 1440x2560 pixels which I use as a background. This is a big hit on the RAM. Would it be better for the performance if I use videos instead. 1 sequence turns into 2 sec video. If not do you have other suggestions that might help my case?

    Thank you!
     
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    499
    If all of them are similar maybe, but otherwise probably not. Video codec uses reference frames to compress the file. If all frames are completely different you will in fact get a bigger file. But you can try it yourself. Here is a command to convert a sequence of images in a video using FFmpeg.
    Code (CSharp):
    1. ffmpeg -framerate 60 -start_number 1 -i ./%04d.png -c:v libvpx -crf 15 -b:v 20M -pix_fmt yuva420p -auto-alt-ref 0 -metadata:s:v:0 alpha_mode="1" ./output.webm
    The input filename would be 0001, 0002, etc.
     
  3. AMishkov

    AMishkov

    Joined:
    Dec 29, 2020
    Posts:
    2
    Thank you for the reply I am testing things out!