I am a happy user of img2pdf. This tool does the minimal amount of work to put a series of JPEG 2000/JPEG/PNG images into a PDF “enveloppe”. However I am now faced with a new challenge: embed a MP4 file into a PDF “enveloppe”.
I see that commercial tool can do it, as seen at:
Here is one such sample PDF file (no Flash required on windows in this sample):
It seems to have been introduced in ISO 32000-1 (PDF 1.7 Extension Level 5)
I am looking for a solution which will use the Rich Media annotation inside the PDF stream.
There are dozen of duplicated questions on superuser/stackoverflow, which all pretty much refer to imagemagick/convert command line tool. But in my case, convert
expand the images into a multi-page PDF (which is not my desired behavior):
$ convert input.mp4 output.pdf
$ pdfinfo output.pdf
Title: out
Producer: https://imagemagick.org
CreationDate: Wed Aug 19 15:38:01 2020 CEST
ModDate: Wed Aug 19 15:38:01 2020 CEST
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 1601
Encrypted: no
Page size: 352 x 288 pts
Page rot: 0
File size: 534407296 bytes
Optimized: no
PDF version: 1.3
with:
$ convert --version
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib
and
$ file input.mp4
input.mp4: ISO Media, MP4 Base Media v1 [IS0 14496-12:2003]
$ ffprobe -v quiet -print_format json -show_streams input.mp4 | grep codec_long_name
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
How would you embed an MP4 inside a PDF now that Flash support is being removed from Acrobat (Dec 2020) ? The solution should be on the command line (linux based system).
There is no standard solution to embed MP4 directly into a PDF using command line tools. However, you could consider using a multimedia package like LaTeX to create a PDF with an embedded MP4 file. A package called media9 allows to embed audio and video files, including MP4, in a PDF document. To use it, you would need to have a working LaTeX environment.