[xep-support] how to embed an mp4 video in PDF?

Bob Stayton bobs at sagehill.net
Thu May 14 15:20:48 PDT 2020


I have a client who wants to embed an MP4 video into the PDF generated 
by DocBook and XEP, but I'm not having much luck.

I followed the XEP User Guide, and so I insert an rx:media-object 
element in an fo:block for the video.

<rx:media-object xmlns:rx="http://www.renderx.com/XSL/Extensions" 
embed="true" show-controls="true" 
src="url(file:///C:/xml/video_files/video2.mp4)" width="100%" 
height="auto" content-width="scale-to-fit" content-height="scale-to-fit" 
content-type="auto"/>

I also included the following pdf-version processing instruction at the 
top of the FO:

<?xml version="1.0" encoding="utf-8"?>
<?xep-pdf-pdf-version 1.5?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" ...

When I process the .fo file with XEP 4.24, it seems the video is 
included in the generated PDF file, because the XEP process does not 
report an error, and the file size indicates the video is included (very 
large file).

But the presentation of the video in the PDF is useless.  I just get a 
Play button that looks like an arrow inside an ellipse.  When I press 
the Play button in Adobe Acrobat Pro 9, I get a "Multimedia Player 
Finder" popup that says:

"The media requires an additional player.  Please click 'Get Media 
Player' to download the correct media player."

I thought the issue might be the content-type attribute, but every 
variation I try results in the same display.  Here is what I tried:

content-type="content:video/mp4"
content-type="video/mp4"
content-type="content:video/mpeg"
content-type="video/mpeg"
content-type="content:auto"
content-type="auto"

I can demonstrate that Acrobat Pro 9 supports mp4 videos by manually 
inserting the video into the same PDF file using the menu items Tools > 
Multimedia > Video Tool. That inserts the video, displays the video 
controls, and allows me to successfully play the video in the reader.

So I want XEP to be able to embed the video the way Acrobat Pro 9 does.  
I think I'm missing some crucial detail.

-- 
Bob Stayton
Sagehill Enterprises
bobs at sagehill.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20200514/5ffec4c5/attachment.html>


More information about the Xep-support mailing list