ffmpeg - mp4在safari中播放,除非它不是第一个来源?铬不会播放相同的MP4? [英] ffmpeg - mp4 plays in safari unless it is not the first source? Chrome wont play same mp4?

查看:150
本文介绍了ffmpeg - mp4在safari中播放,除非它不是第一个来源?铬不会播放相同的MP4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

另一个问题是试图获取html5视频。



我使用ffmpeg创建了3种不同格式的相同视频的3个版本:mp4,ogg和webm 。
$ b 当作为第一个html5视频源列出时,.ogg在Chrome中播放效果很好,而当第一个html5视频源列为.mp4时,。 ,如果我在.ogg源文件的上面列出.mp4源文件,chrome将不再加载/播放.ogg文件,因为它默认为.mp4视频。不会播放,并且以同样的方式,如果我在.mp4源文件上面列出.ogg源文件文件,safari不会加载.mp4视频。



我很茫然。这是我的嵌入代码:

 < video width =100%height =100%> 
< source src =./ videos / Wildlife.ogg>
< source src =./ videos / Wildlife.webm>
< source src =./ videos / Wildlife.mp4>
< / video>

有关资源之间回退的原因的任何想法都无法正常工作?



为什么safari不服从后备顺序并忽略.ogg / .webm文件?

解决方案

 <$ c在经过相当多的故障排除以及添加/删除标签后,我终于可以通过列出其类型来正常工作。 $ c>< video width =100%height =100%> 
< source src =./ videos / Wildlife.oggtype =video / ogg>
< source src =./ videos / Wildlife.webmtype =video / webm>
< source src =./ videos / Wildlife.mp4type =video / mp4>
< / video>

换句话说,就我而言,浏览器不会回退到下一个可用(可播放)视频格式,除非我在每种视频类型上添加'type ='属性。


Yet another issue trying to get html5 video working.

I have created 3 versions of the same video in 3 different formats using ffmpeg: mp4, ogg, and webm.

The .ogg plays fine in chrome when listed as the first html5 video source, and the .mp4 plays fine in safari when listed as the first html5 video source, however, if I list the .mp4 source above the .ogg source, chrome will no longer load/play the .ogg video as it is defaulting to the .mp4 video which will not play, and in the same fashion, if I list the .ogg source file above the .mp4 source file, safari will not load the .mp4 video.

I am at a loss. Here is my embed code:

<video width="100%" height="100%">
    <source src="./videos/Wildlife.ogg">
    <source src="./videos/Wildlife.webm">
    <source src="./videos/Wildlife.mp4">
</video>

Any ideas as to why the fallbacks between sources are is not working properly?

Why isn't safari obeying the fallback order and ignoring the .ogg/.webm files?

解决方案

After quite a bit of troubleshooting, and adding/removing tags, I finally got the fallbacks to work properly by listing their types.

<video width="100%" height="100%">
    <source src="./videos/Wildlife.ogg" type="video/ogg">
    <source src="./videos/Wildlife.webm" type="video/webm">
    <source src="./videos/Wildlife.mp4" type="video/mp4">
</video>

In other words, in my case, the browsers would not fallback to the next available (playable) video format unless I added the 'type=' attributes on each video type.

这篇关于ffmpeg - mp4在safari中播放,除非它不是第一个来源?铬不会播放相同的MP4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆