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

From: <kevin_at_ADDRESS_REMOVED>
Date: Thu May 21 2020 - 12:25:15 PDT

So, I went through many things here and I do not believe this is a “RenderX” issue, I believe this is some Adobe settings issue.

 

To test I created one PDF with RenderX and one using Adobe Acrobat using the exact same video.

At first, I could not get anything to play at all … Adobe would open and when the video was selected to play, Adobe would just crash.

This happens for both the RenderX one and Adobe’s own one.

I then changed some settings in Acrobat to enable protected mode at startup (which is in Security Enhanced) and then both would play but Audio only.

The important point here is that both behave exactly the same.

There is nothing in RenderX that is in the pure Adobe solution and it yields the exact same result for me.

 

Now, no video but audio is strange as it could be I am missing some codec to display the video on my machine … but I do not think so.

I converted the MP4 to a few other formats and went through this exact process and got the exact same result.

No video, just audio.

I can also double click the video and it plays in my media player without issue.

 

So, might I suggest using file annotations as I would think that is actually a better way to do it anyway. Then the recipient can view the video in their own way, whatever is the default player on their machine.

 

To do this, one could do like this:

<rx:pdf-comment title="Video Attachement" content="A video">
            <rx:pdf-file-attachment src="url('SampleVideo_1280x720_1mb.mp4')"
            filename="SampleVideo.mp4"
            icon-type="paperclip"/>
</rx:pdf-comment>

This would attach the video inside the PDF and double-clicking the icon will launch an external viewer appropriate for the filename extension.

You can use the same method to embed Word, Excel … just about any filetype you wish.

You can also expose the “Attachments” bar in Adobe Reader to see the attachment and launch from there.

 

Kevin Brown

RenderX

 

From: Xep-support <xep-support-bounces@renderx.com> On Behalf Of Bob Stayton
Sent: Thursday, May 14, 2020 3:21 PM
To: RenderX Community Support List <xep-support@renderx.com>
Subject: [xep-support] how to embed an mp4 video in PDF?

 

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> "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> "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@sagehill.net <mailto:bobs@sagehill.net> 

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Thu May 21 12:21:24 2020

This archive was generated by hypermail 2.1.8 : Thu May 21 2020 - 12:21:38 PDT