简体   繁体   中英

Playing video with transparency in iOS

A bit of background, i want to play videos with transparency on the web converted from gifs, for all non apple devices i can easily export a webm file like so

ffmpeg -i test.gif -c:v libvpx-vp9 -qmin 0 -qmax 18 -crf 9 -b:v 1400K -quality good -cpu-used 0 -auto-alt-ref 0 -pix_fmt yuva420p -an -sn -metadata title="test webm" test.webm

No need for video streaming with HTTP response 206 partial content loaded it works out of the box

Now for safari and apple devices i am presented with a totally different beast i set up a endpoint that serves the video with HTTP 206 responses and after a quite a struggle i can have the same end result for Safari in macOSX, and i convert the videos like so

ffmpeg -i test.gif -qmin 0 -qmax 18 -vcodec prores_ks -q:v 64 -b:v 1400K -pix_fmt yuva444p10le -profile:v 4444 -an -sn -metadata title="test mov" test.mov

I put in the url address bar the that serves the video with stream and the video plays with transparency all good.

Now on Safari in iOS the video just does not play, it is loaded with the same endpoint and other videos without transparency also work, serving from the same stream endpoint.

Does anyone knows of a solution to encode a video with transparency that plays on all apple devices?

I also gave handbrake a try without success, actually could not even get the transparency right with handbrake.

In the end iOS devices at least before v13 simply do not allow prores codec with alpha channel, so there is no way to have a video with transparency on those devices in whichever format. It had nothing to do with the video streaming and HTTP response 206 partial content loaded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM