knitr mp4电影嵌入在Windows XP上不起作用 [英] knitr mp4 movie embedding does not work on Windows XP

查看:718
本文介绍了knitr mp4电影嵌入在Windows XP上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用一个产生mp4电影的块编织一个Rmd文件(到html):

I knit a Rmd file (to html) with a chunk producing a mp4 movie :

```{r clock, fig.width=7, fig.height=6, fig.show='animate'}
par(mar = rep(3, 4))
for (i in seq(pi/2, -4/3 * pi, length = 12)) {
    plot(0, 0, pch = 20, ann = FALSE, axes = FALSE)
    arrows(0, 0, cos(i), sin(i))
    axis(1, 0, "VI"); axis(2, 0, "IX")
    axis(3, 0, "XII"); axis(4, 0, "III"); box()
}
```

knitr 生成以下用于嵌入mp4电影的html代码:

knitrgenerates the following html code for embedding the mp4 movie :

<p><video   controls="controls" loop="loop"><source src="figure/clock.mp4" type="video/mp4" />video of chunk clock</video></p>

mp4电影在图形子文件夹中创建得很好但是当我没有出现在html输出中使用Chrome,Firefox或Explorer在Windows XP计算机上打开它。

The mp4 movie is well created in the figure subfolder but it does not appear in the html output when I open it with a Windows XP machine using either Chrome, Firefox or Explorer.

这是一个(临时)示例: http://stla.overblog.com/ellipse-chart-test - 这不是时钟示例,但这是完全相同的渲染问题。我在Windows Vista计算机上看到Chrome的电影,但在我的Windows XP机器上看不到。

Here is a (temporary) example : http://stla.overblog.com/ellipse-chart-test - this is not the "clock" example but this is exactly the same rendering problem. I see the movie with Chrome on a Windows Vista machine, but not with my Windows XP machine.

解释是什么?操作系统或浏览器版本确实存在问题吗?

What is the explanation ? Is it really a problem with the OS or with browser versions ?

推荐答案

tl; dr 浏览器真的使用操作系统执行一些媒体解码任务。通过 a)为您的受众群体提供备用媒体流 b)使用最兼容的媒体格式 c)使用插件(即Flash) )或 d)建议安装MP4插件。

tl;dr Browsers really use the OS to perform some media decoding tasks. Work around it by a) providing alternate media streams b) using the most compatible media format for your audience c) using a plugin (i.e. Flash), or d) recommend installing an MP4 plugin.

这实际上是操作系统的问题。许多浏览器,就像特定平台上的某些其他程序一样,使用操作系统资源来完成给定任务。在受知识产权保护的程序方面尤其如此。

This is in fact a 'problem' with the OS. Many browsers, just as some other programs on a particular platform, use the operating system resources to acomplish a given task. This is particularly true when it comes to procedures protected by intellectual property rights.

您的编解码器(h.264又称MP4)恰好是对IP片段的激烈争夺。因此,浏览器不会花费很长时间来授权手头的IP,而是使用主机系统的许可编解码器。

Your codec (h.264 aka "MP4") happens to be a particulary fiercely fought over piece of IP. Thus, browsers don't go to lengths to licence the IP at hand, but rather use the licenced codecs of the host system.

在您的情况下,Windows XP无法解码视频的媒体格式,浏览器似乎无法自行解决。

In your case, Windows XP happens not to be able to decode the media format of your video, and the browser doesn't seem to be able to do that by itself.

您现在的替代方案:


  • 使用您的<$提供额外的媒体流c $ c> video 标记(请参阅维基百科例如)

  • 试图找出大多数用户在XP上使用的浏览器,然后选择本机支持的格式(适用于Chrome的> webm 或适用于Firefox的 ogg

  • 只需使用Flash播放MP4(如HTML5之前的日子)

  • 告诉用户安装操作系统级别的插件来播放h.264;你甚至可以在后备文本中做到这一点。我不会推荐特定的产品,但有很多。

  • Give additional media streams with your video tag (see Wikipedia for an example)
  • Trying to find out what browser the majority of users is using on XP, then choose a natively supported format (either webm for Chrome or ogg for Firefox)
  • Just use Flash to play the MP4 (as in the pre-HTML5 days)
  • Telling users to install an OS-level plugin to play h.264; you could even do that in the fallback text. I won't recommend a specific product, but there are many.

这篇关于knitr mp4电影嵌入在Windows XP上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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