在 lyx 演示文稿中插入视频剪辑并在 GNU/Linux 中播放
如何将视频剪辑插入到 Lyx 创建的演示文稿中?
看过http://www.latex-community。 org/forum/viewtopic.php?f=19&t=48。它可以工作,但是视频在外部播放器的后台开始。
我更喜欢在演示文稿中播放它。如果使用外部播放器,它至少应该在前台启动。但演示占据了前台。在 GNU/linux 中使用 evince 作为 pdf 查看器。 Beamer 用作演示模板。
是否可以在演示文稿本身的嵌入式播放器中播放视频文件?
创建了一个示例演示文稿。代码如下。
\documentclass[english]{beamer}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatletter
\long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
\def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
\def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
\def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
\def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
\long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
\frame<#1>[#2][#3]{\frametitle{#4}#5}}
\makeatother
\def\lyxframeend{} % In case there is a superfluous frame end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usetheme{Warsaw}
\usepackage{hyperref}
\makeatother
\usepackage{babel}
\begin{document}
\title{Testing video}
\makebeamertitle
\lyxframeend{}\section{Testing video}
\lyxframeend{}\subsection{Testing video}
\lyxframeend{}\lyxframe{Testing video}
\href{run:video.wmv}{Movie}
\appendix
\lyxframeend{}
\end{document}
How can I insert a video clip into a presentation created in Lyx?
Have seen http://www.latex-community.org/forum/viewtopic.php?f=19&t=48. It works, but there the video starts in the background in an external player.
I would prefer it to be played in the presentation itself. If an external player is used it it should at least start in the foreground. But the presentation takes the foreground. Using evince in GNU/linux as pdf viewer. Beamer is used as a presentation template.
Is it possible to play a video file in an embedded player in the presentation itself?
Created an example presentation. The code is found below.
\documentclass[english]{beamer}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatletter
\long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
\def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
\def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
\def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
\def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
\long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
\frame<#1>[#2][#3]{\frametitle{#4}#5}}
\makeatother
\def\lyxframeend{} % In case there is a superfluous frame end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usetheme{Warsaw}
\usepackage{hyperref}
\makeatother
\usepackage{babel}
\begin{document}
\title{Testing video}
\makebeamertitle
\lyxframeend{}\section{Testing video}
\lyxframeend{}\subsection{Testing video}
\lyxframeend{}\lyxframe{Testing video}
\href{run:video.wmv}{Movie}
\appendix
\lyxframeend{}
\end{document}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看来您所要求的(现在,也许以前不是?)可以使用 Okular 作为查看器。确保在 LaTeX 序言中包含
\usepackage{multimedia}
,然后您可以在 ERT 中添加:尽管
\movie< 的大多数选项都可以在我的系统上使用(在某种程度上) /code> 命令不起作用,如海报、自动启动等。但是 showcontrols 确实起作用 - 但如果电影运行完成,则控件会消失,直到演示文稿重新启动。尽管如此,我之前并不知道有什么方法可以将电影嵌入到 Linux 中,所以这只是一个开始。
根据记录,我有 Ubuntu 10.10,以及 Okular 0.11.2。我还使用 LyX 2.0.0,这是相当新的,但我认为 LyX 版本不重要。
一些有用的链接:
It seems that what you're asking for is (now, maybe not previously?) possible using Okular as the viewer. Be sure to include
\usepackage{multimedia}
in the LaTeX preamble, then you can add in ERT:This (sort of) works on my system though most of the options for the
\movie
command don't work, like poster, autostart, etc. However showcontrols does work -- though if the movie runs to completion, then the controls disappear until the presentation is restarted. Nonetheless, I didn't know of any way to have movies embedded in Linux before so it's a start.For the record I have Ubuntu 10.10, with Okular 0.11.2. I'm also using LyX 2.0.0 which is pretty new but I don't think the LyX version should matter.
Some helpful links:
如何将视频剪辑插入到使用 LaTex 生成的 PDF 中,请参阅:http://www.uoregon。 edu/~noeckel/PDFmovie.html(使用 <代码>movie15包)。
不幸的是,您可以插入,但无法在 Linux 上播放该视频(evince 和 okular 不支持它,acroread 仅当您安装了 realplayer 并且非常幸运时才能播放它)。此类 PDF 格式的视频可以在 Windows 上播放。
您可以使用 制作 PDF 格式的跨平台动画(而非视频)
animate
包和 tikz/pgf。它们可以在 Linux 和 Windows 中玩 acroread(如果启用了 JavaScript)(但不明显也不正常)。否则,您可以使用 OpenOffice Impress 或 S5 创建演示文稿,两者都可以轻松嵌入视频,并且都可以在 Linux 上运行良好。对于 PDF,像您一样放置超链接似乎是最可靠的方法。
How to insert video clips into PDF produced with LaTex, see: http://www.uoregon.edu/~noeckel/PDFmovie.html (using
movie15
package).Unfortunately, you can insert, but you cannot play that video on Linux (evince & okular don't support it, acroread plays it only if you have installed realplayer and are really lucky). Such video-in-a-PDF is playable on Windows.
You can produce cross-platform animations in PDF (not video) by using
animate
package and tikz/pgf. They play both in Linux and Windows acroread (if JavaScript is enabled) (but not in evince nor okular).Otherwise you can create presentations with OpenOffice Impress or S5, both allow to embed videos easily, and both play well on Linux. For PDF putting a hyperlink, like you do, seems to be the most reliable way.
一个相当不专业的方法是使用HTML5方法。将您的文档转换为基于浏览器的演示文稿。也许使用 inkscape,或者手动转换它然后添加视频标签
A quite non-professional way is to use the HTML5 method. Convert your document into a browser based presentation. Maybe use inkscape, or maybe convert it manually and then add the video tag