MP4视频可在台式机上运行,​​而不能在移动设备上运行 [英] MP4 video working on desktop, not on mobile devices

查看:136
本文介绍了MP4视频可在台式机上运行,​​而不能在移动设备上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将视频嵌入以下URL: https://www.speurtochten.nl/over -ons/ 我是使用Premiere Pro CC制作的,并将其导出为H.264.

I embedded a video in the following URL: https://www.speurtochten.nl/over-ons/ I made it with Premiere Pro CC, exported it as H.264.

我在WordPress中使用的代码:[video src="https://speurtochten.nl/sbsfilm.mp4"][/video]

The code I use in WordPress: [video src="https://speurtochten.nl/sbsfilm.mp4"][/video]

我尝试上传一些虚拟视频( http://www .sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4 ),它们在台式机和手机上都能正常工作.

I tried uploading several dummy videos instead (http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4), and they worked perfectly fine on the desktop AND on a mobile phone.

在我的iPhone上,出现加载此资源时出错".

On my iPhone, I get "Error loading this resource".

推荐答案

接受并同意这是一个临界编码问题/答案的评论,我将尝试在编码上下文内提供答案. ),或者至少是指开发人员通常用来调试此类问题的工具.

Accepting and agreeing with the comments that this is a borderline coding question/answer, I'll try to provide an answer but within a coding context(ish...), or at least referring to the tools a developer might typically use to debug this type of problem.

调试此类问题比较棘手,但是使用调试器工具会有所帮助-您可以将手机连接到Mac/PC,然后使用Chrome或Safari开发者工具查看控制台和网络流量,以进行尝试看到这样的错误的原因.示例链接(在撰写本文时是正确的,但如果链接中断/移动了摘要,则摘要是:连接设备,启用USB调试;单击设备"标签中的检查"按钮以打开工具来检查设备),以获取有关Chrome开发者工具的说明,此处:

Debugging this type of issue is tricky but it can help to use the debugger tools - you can attach a mobile phone to a Mac/PC and use the Chrome or Safari developer tools to look at the console and the network traffic to try to see the reason for an error like this. Example link (correct at the time of writing, but in case link breaks/moves the summary is: attach device, enable USB debugging; click on inspect button in devices tab to open tools to inspect the device) for instructions for Chrome developer tools here:

以您的情况进行此操作将表明该站点正在正常加载(请注意不相关的HTTPS CSS问题).

Doing this will in your case show that the site is loading fine (expect for an unrelated HTTPS css issue).

您还可以查看页面源并找到视频URL,然后从工具窗口中打开一个选项卡,以直接在移动浏览器中播放视频.

You can also view the page source and find the video URL and then open a tab, from the tools window, to play the video directly on the mobile browser.

在您的情况下,视频无法播放.

In your case the video does not play.

通过查看页面源代码,您还可以看到在mediaelement.js的情况下正在使用视频播放器-大多数网络视频播放除了视频标签外,还使用某种形式的HTML5/javascript播放器.

Looking at the page source also allows you see that the video player being used if mediaelement.js - most web video playback uses some form of HTML5/javascript player in addition to the video tag.

该播放器是开源的( https://github.com/mediaelement/mediaelement )可以在GitHub上检查代码,从而可以很容易地在存储库的整个版本中搜索文本字符串.快速检查错误字符串或什至部分错误,表明该错误不是由播放器生成的(或者不是当前版本)-如果您想保持细致,可以确定并检查网页中使用了哪个版本.

This player is opensource (https://github.com/mediaelement/mediaelement) so the code can be checked, on GitHub, which provides the ability to search an entire version of the repository for a text string quite easily. Checking for the error string or even parts of it quickly shows that this error is not generated by the player (or not the current version anyway - if you wanted to be meticulous you could make sure and check whatever version is used in your webpage).

这表明问题出在底层浏览器或设备视频支持本身.

This suggests that the issue is with the underlying browser or device video support itself.

使用ffprobe下载视频并查看其属性( https://ffmpeg.org/ffprobe.html )显示包括以下内容的输出:

Downloading the video and looking at its properties using ffprobe (https://ffmpeg.org/ffprobe.html) shows output including the following:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sbsfilm.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2017-11-23T19:23:40.000000Z
  Duration: 00:02:06.93, start: 0.000000, bitrate: 10311 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 9989 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)

此处的关键信息是高级"部分,这意味着它是H.264高调视频. H.264具有不同的配置文件以及许多不同的潜在设置和选项,因此我们不能仅说设备将播放H.264,而是需要查看更多细节.

The key information here is the 'High' part which means it is a H.264 High profile video. H.264 has different profiles and many different potential settings and options, so we can't just say that a device will play H.264, instead we need to look at more detail.

查看Android支持媒体类型(同样在撰写本文时...),表明High Profile不在列出的受支持类型中(

Looking at the Android support media types (again at the time of writing...) shows that High Profile is not in the listed supported types (https://developer.android.com/guide/topics/media/media-formats.html):

这很可能是您遇到的问题-如果您将视频重新编码为H.264 Main或Baseline配置文件,然后重试该视频应可在移动设备上使用(基线受支持最多,但压缩效果不佳)作为Mainline,因此您可能需要尝试找到最适合您的需求).

This is quite likely to be your problem - if you re-encode the video to H.264 Main or Baseline profile and try again the video should work on Mobile devices (baseline is the most supported but does not offer as good compression as Mainline so you may want to experiment to find the best match for your needs).

这篇关于MP4视频可在台式机上运行,​​而不能在移动设备上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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