safari不会播放转换为mp4或m4v的gif [英] safari won't play a gif converted to mp4 or m4v

查看:237
本文介绍了safari不会播放转换为mp4或m4v的gif的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将由三个图像组成的gif转换为mp4,并将m4v(用于Safari)转换为html5视频播放器,但Safari不会播放 .mp4 也不是 .m4v ,包含以下内容

 < video preload =yescontrols =true> 
< source src =。/ menu.mp4type =video / mp4/>
< source src =。/ menu.m4vtype =video / m4v/>
< / video>

但是,如果我使用正确的视频(即不是转换的gif),Safari(9.2)将会播放它使用上面的语法,所以我知道html5视频播放器在我的浏览器中工作,而不是我转换的gif。
问题,对于转换为静止影片照片的gif,我是否必须设置不同的类型,即 type =gif / m4v或还有另外一个设置我必须激活吗?



我用ffmpeg将gif转换为mp4,但是不记得我跑去做的确切命令。 / p>

更新
根据这篇 TechCrunch文章,Twitter使用mp4s代替gifs所以我认为它应该适用于所有浏览器。



可以在这里查看mp4文件



https://www.dropbox.com/s/mvkzo8xe7is4rle/menu.mp4?dl=0

解决方案

问题是视频编码,特别是H.264配置文件设置,与视频编解码器一起使用。



您当前的视频编码为:高4:4:4 Predictive @ Level 2.2 这对于浏览器视频来说似乎不常见(并且可能无法在某些移动设备上解码)。



解决方案:



在您的编码器中,选择基线 Main



工作视频 使用 Main @ L3.1



使用 FFmpeg 您可以在主页下制作新视频个人资料(适合您的尺寸宽度480 X高度640 )。

  ffmpeg -i input.mp4 -c:v libx264 -pix_fmt yuv420p -profile:v main -level:v 3.1 -an output.mp4 



有用的注释:




  • 您可以 点击这里 一些Apple推荐的个人资料(参见 Point.11 )。预计视频使用 4:2:0 采样,而不是有问题的 4:4:4 不工作的视频。


  • Wowza.com解释 移动设备的配置文件和级别。


  • A 基线配置文件可以保证在更旧的设备上播放(例如:iPhone 3或更早版本)。



I converted a gif composed of three images to mp4 and also to m4v (for Safari) to play in the html5 video player, however, Safari won't play either the .mp4 nor the .m4v with the following

<video preload="yes" controls="true" >
<source src="./menu.mp4" type="video/mp4" />
<source src="./menu.m4v" type="video/m4v" />
</video>

However, if I use a proper video (i.e. not a converted gif) Safari (9.2) will play it using the above syntax, so I know the html5 video player is working in my browser, just not my converted gif. Question, for a gif that's converted to a "movie of still" photos, do I have to set a different type i.e. type="gif/m4v" or is there another setting I have to activate?

I used ffmpeg to convert the gif to an mp4 but don't recall the exact command that I ran to do it.

Update According to this TechCrunch article, Twitter uses mp4s instead of gifs so I'm assuming it should work on all browsers.

the mp4 file can be viewed here

https://www.dropbox.com/s/mvkzo8xe7is4rle/menu.mp4?dl=0

解决方案

The problem is the video encoding, specifically the H.264 Profile setting, used with video codec.

Your current video is encoded as : High 4:4:4 Predictive @ Level 2.2 which seems unusual for a browser video (and possibly won't decode on some mobile devices).

Solution :

In your encoder, choose an H.264 Profile of either Baseline or Main.

This working video uses Main @ L3.1

Using FFmpeg you can produce a new video under Main profile (which is suitable for your dimensions width 480 X height 640).

ffmpeg -i input.mp4 -c:v libx264 -pix_fmt yuv420p -profile:v main -level:v 3.1 -an output.mp4


Useful Notes :

  • You can check here some Apple recommended profiles (see Point.11). It is expected the video is using 4:2:0 sampling, not the problematic 4:4:4 in the not-working video.

  • Wowza.com explains Profiles and Levels for mobile devices.

  • A Baseline Profile would guarantee playback on even older devices (eg: iPhone 3 or older).

这篇关于safari不会播放转换为mp4或m4v的gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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