Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support video into PDF #227

Open
Intelligent2013 opened this issue Nov 4, 2023 · 6 comments
Open

Support video into PDF #227

Intelligent2013 opened this issue Nov 4, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@Intelligent2013
Copy link
Contributor

Source ticket: metanorma/metanorma#338

Investigate how to support video (H.264) in the PDF.

@Intelligent2013 Intelligent2013 added the enhancement New feature or request label Nov 4, 2023
@Intelligent2013 Intelligent2013 self-assigned this Nov 4, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Nov 4, 2023
@Intelligent2013
Copy link
Contributor Author

Apache FOP doesn't support richmedia.
PDFBox doesn't support richmedia annotations (https://issues.apache.org/jira/browse/PDFBOX-5495).

So, the solutions are:

  • add video as PDF attachment and add the link to the attachment.
  • add the link to the external video file.

@ronaldtse
Copy link
Contributor

In this case it would definitely be important for FOP to first support PDF 2.0…

Both solutions you proposed are important use cases, and both also apply to things outside of just video.

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 16, 2023
@Intelligent2013
Copy link
Contributor Author

For testing purposes, I've prepared the PDF example with videos:

  • internet link
  • local link on disk
  • embedded PDF

For the presentation XML (it's prototype, manually created):

<p>Link to the video sample on http site: <video src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_30MB.mp4"/></p>
<p></p>
<p>Link to the video sample on disk in the same folder with pdf: <video src="Big_Buck_Bunny_1080_10s_2MB.mp4"/></p>
<p></p>
<p>Embedded video sample: <video src="Jellyfish_1080_10s_2MB.mp4" embedded="true"/></p>

Resulted PDF:
PDF_video_sample.zip

@ronaldtse
Copy link
Contributor

@Intelligent2013 I can confirm that all 3 methods work in Adobe Acrobat Reader. All 3 methods fail in macOS Preview.

@Intelligent2013
Copy link
Contributor Author

@ronaldtse I've tested in macOS Preview in my environment (MacOS BigSur, Preview 11.0 (1017)):

  • internet link

Video is playing in the Safari browser.

  • local link on disk

Shows the strange error:
image

If I double-click on .mp4 in the Finder directly, then QuickTime player plays the video successfully.

  • embedded PDF

Nothing happens, because Preview doesn't support PDF attachments.

@petervwyatt
Copy link

Note that PDF 1.x supports Movie Annotations but these are deprecated in favour of RichMedia Annotations in PDF 2.0. Adobe Extension Level 3 added RichMedia annotations to PDF 1.7 before PDF 2.0 adopted them so as long as the correct Adobe extensions dictionary is added you can have them in PDF 1.7 also (but not PDF 1.6 or earlier. RichMedia annotations are more flexible and support any form of rich media beyond just movies - incl. 3D, etc.

Movie, Sound and 3D annotations are also not permitted in PDF/A-3 or PDF/A-4 files.
RichMedia annotations are allowed in PDF/A-4e files (the PDF/A-4e conformance level must be explicitly used).

As far as accessibility goes, movies should include subtitles (and audio files should include a transcription) but this is beyond what PDF specs technically require.

Support for any form of multimedia is also highly dependent on the PDF viewer used and possibly what additional SW is also installed.

Alternatives include:

  • Link annotation to an external web URL (e.g. YouTube)
  • attach the movie file as an embedded file either as a File Attachment annotation or an Associated File - it's then packaged and along for the ride but not directly playable in situ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants