Isn’t it possible to display text over a video

multimediaoverlaystikz-pgf

I would like to have text being displayed on top of a video. I tried both multimedia and media9, as soon as the video starts, the text disappears. I also tried creating multiple tikzpicture environments, without success.

Here is the MWE

\documentclass{beamer}
\usepackage{multimedia, tikz}
\begin{document}
\begin{frame}[plain]
\begin{tikzpicture}[remember picture, overlay]
\node[at=(current page.center)] {\movie[poster, open]{}{video.mov}};
\node[at=(current page.center)] {Isn't it possible to display this text over the video??};
\end{tikzpicture}
\end{frame}
\end{document}

Best Answer

It is possible with SVG. Unlike PDF, HTML5 standards and their implementation by modern web browsers indeed allow overlaying video content with graphics and text. The example below embeds a YouTube video, but local embeds are possible too (see media4svg documentation and examples).

Click to open:

Typeset with

latex example
latex example
dvisvgm --font-format=woff2 --bbox=papersize --zoom=-1 --page=- --linkmark=none example
\documentclass[dvisvgm]{beamer}

\usepackage{media4svg}
\usepackage{tikz,graphicx}
\usetikzlibrary{ducks}

\setbeamertemplate{navigation symbols}{}

\begin{document}

\begin{frame}{Graphics over video}
  \begin{tikzpicture}
  \node[inner sep=0pt]{\includemedia[width=\linewidth,height=0.5625\linewidth,youtube,controls]{}{5p_SuO96Jd4}};
  \pic[duck/water=blue,shift={(2,0)},scale=0.4] {duck};
  \end{tikzpicture}
\end{frame}

\end{document}

By design, video and other interactive elements are implemented in PDF as so-called PDF Annotations that live in a separate layer on top of the page content. Therefore, they are always displayed on top of text and graphics, no matter in which order they appear in the TeX input. As for hyperlinks, the link text is part of the page content, but the link rectangle is part of the PDF annotation.

\documentclass[border=5pt]{standalone}

\usepackage{tikz}
\usepackage[urlbordercolor=blue]{hyperref}

\begin{document}

\begin{tikzpicture}
\node [anchor=west] {\Huge\url{https://ctan.org}};
\node [fill=green, inner sep=2cm] {};
\end{tikzpicture}

\end{document}

![enter image description here