简体   繁体   English

在 iOS 中播放具有透明度的视频

[英]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一点背景知识,我想在从 gif 转换的 web 上播放具有透明度的视频,对于所有非苹果设备,我可以像这样轻松导出 webm 文件

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无需使用 HTTP 响应 206 部分内容加载它开箱即用的视频流

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现在,对于 safari 和苹果设备,我遇到了一个完全不同的野兽,我设置了一个端点,用 HTTP 206 响应为视频提供服务,经过一番挣扎后,我可以在 macOS 中为 Z50DE9BC68C9、3DC32D8C7C905 中的 Z50DE9BC68C9、3DC32D8C7C7C905像这样

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.我在 url 地址栏中输入了使用 ZF7B44CFFAFD5C52223D5498196C8A2E7BZ 提供视频的地址栏,视频播放的透明度都很好。

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.现在在 iOS 中的 Safari 上,视频无法播放,它加载了相同的端点,其他没有透明度的视频也可以使用,从相同的 stream 端点提供服务。

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.最后,至少在 v13 之前的 iOS 设备根本不允许具有 alpha 通道的 prores 编解码器,因此无法在这些设备上以任何格式获得具有透明度的视频。 It had nothing to do with the video streaming and HTTP response 206 partial content loaded.它与加载的视频流和 HTTP 响应 206 部分内容无关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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