Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Which codec and file format for alpha channel video playing on Safari for iOS (and iPad)

Discussion in 'Web' started by Kafar, Dec 10, 2022.

  1. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Hello,

    I'm sorry for my english and if this question was replied in the past.

    Basically, I'm working on WebGL project and I have to play a video on Chrome mobile browser and on Safari on iPhones and iPad.

    This video have an alpha channel.

    About Chrome I converted the video in VP8 codec and webm file format and it play correctly.

    Then I taken the webm above and I tried to convert it in Apple ProRes 4444 and mov file format, using FFMPEG because I'm on Windows platform.

    But the video in this format above don't play on iPhone and iPad. I tried also with other formats and variants but nothing to do. Same results or the video plays but not with alpha channel.

    Here the ffmpeg command line I tried:

    Code (CSharp):
    1. ffmpeg -i inputfile.webm -c:v prores_ks -profile:v 4 -vendor apl0 -pix_fmt yuva444p10le -s 1280x720 -r 30 output.mp4
    I'm using Unity 2022.1.23f1.

    Please, can someone help me with suggestions?

    Many thanks in advance.

    -Kafar
     
  2. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    HEVC codec has alpha channel and plays on (newer) Safari.

    Unfortunately HEVC is not supported on Chrome so you will have to detect the platform and stream the correct video format.
     
  3. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Thanks for reply.
    I don't have problems with chrome, I detect chrome and play video in correct format (webm and VP8 codec).
    I have problems on Safari. I tried with HEVC but it shows video with no alpha channel, I don't understand what I'm wrong.
     
  4. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    I tried now converting from webm with alpha to HEVC and also to QTRLE but the video not start on Safari. I can't convert to HEVC_VideoToolbox with ffmpeg because I don't have Mac.
    Then, it's not possible in other ways?
    Someone has solved on windows?
    Thanks