How can I embed a video in my PDF using LaTeX?
It used to be possible via the media9
package but due to Adobe ceasing support for Flash at the end of 2020, versions of the media9
package which rely on Flash should no longer be used to embed video or other multimedia content into LaTeX-generated PDF files, including any projects created on Overleaf. However, it is likely that the media9
package will be updated by its author to use non-Flash-based methods for embedding video into LaTeX-generated PDFs.
Non-Flash-based video embedding: proof of concept
The author of media9
posted a proof-of-concept example on tex.stackexchange demonstrating how to embed video into PDFs using a technique that does not rely on Flash. An Overleaf project which demonstrates that code can be found here—note that the video won’t play in Overleaf’s preview panel; instead, download the PDF and open it in a suitable viewer such as Adobe Reader.
Situation as of February 2021
With the very recent end-of-life for Flash, playback of video or sound embedded within PDFs now relies on the host operating system’s built-in software for playing sound or video. The immediate post-Flash technology landscape for playback of video embedded into PDFs is somewhat fluid, particularly for users who rely on Windows 10 due to problems with video playback on some Windows 10 installations. A workaround for Windows 10 was posted on the Adobe Support Community forum on 10 February 2021—you’ll need to find an entry by Himanshu Sagar posted on that date.
The author of the media9
package has noted (here and here) that, for the time being, best practice might be to provide links to video files, not to embed them. Users who choose to provide PDF links to video content will need to ensure those videos are available to anyone who reads your PDF document.
Further discussion on the post-Flash landscape for video content embedded in PDFs, such as .mp4
files, can be found in Adobe’s online forums. For LaTeX users, further information and discussions can be found on tex.stackexchange:
- Media9 is becoming obsolete Dec 2020. Any alternatives for embedding video/audio in LaTeX?
- Alternatives for media9 after Dec 2020 in overleaf
Flash in PDF: brief background and history
Adobe acquired Flash technology in 2005 when it bought a company called Macromedia (see Wikipedia or here for history and general overviews). In June 2008 Adobe published an extension to the IS0 32000 PDF specification which introduced PDF’s support for Flash-based content embedded in PDF files, providing a convenient method for PDF files to contain various forms of “rich media”, including video, sound and Flash animations. Those extensions to the PDF specification coincided with the release of Adobe Reader 9 which supported viewing and playback of embedded Flash-based “rich media”.
Flash was an extremely popular technology for creating, embedding and sharing rich, interactive content—including within web pages—but, over time, support for Flash decreased and new open web technologies and standards arose which further eroded Flash’s role in the technology mix. Eventually, the writing was placed clearly on the wall when, on July 25 2017, Adobe announced that its support for Flash would cease at the end of 2020. Today, Adobe’s latest PDF products no longer support embedding or playback (display) of Flash-based media formats—*.flv
and *.swf
files. See also Flash Player end-of-life: Impact in Reader and Acrobat.
From a technical standpoint there’s nothing to prevent you embedding Flash-based media into PDFs via LaTeX packages or through your own custom macros which inject the appropriate operators into the output PDF file—but your content won’t be supported, thus available to readers, via the current, and future, generations of PDF-viewing applications.
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class