You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by John Ruschmeyer <jr...@eoir.com> on 2015/04/06 18:30:20 UTC

Question about embedded video in PPTX files

Technical Question: Is it possible to have a single copy of a video file in a PPTX file and to embed it in more than one slide?

I’m using POI to create a PPTX file and embedding video based on a code sample I found on the web. It works if I create a copy of the video for each embed, but I get a corrupted PPTX file if I try to embed all from one copy.

Thanks…
John

Re: Question about embedded video in PPTX files

Posted by John Ruschmeyer <jr...@eoir.com>.
I’ve moved from trying to bookmark my video to using the trim capability.

The relevant section of my code looks like this:

        String p14Ns = "http://schemas.microsoft.com/office/powerpoint/2010/main";



        cur.beginElement(new QName(p14Ns, "media", "p14"));
        cur.insertAttributeWithValue(new QName(STRelationshipId.type.getName().getNamespaceURI(), "embed"), prsEmbed.getId());

        cur.beginElement(new QName(p14Ns, "trim", "p14"));
        cur.insertAttributeWithValue(new QName(p14Ns, "st", "p14"), df_time.format(so.getStart()*1000.0));

When I try to open the PPTX file in PowerPoint 2011 (Mac), I get an error that the file contains content that is not recognized and will be removed. Except for the trimming, everything then works fine.

Looking at the XML, the relevant portion looks like this:

                    <p:nvPr>
                        <a:videoFile r:link="rId5"/>
                        <p:extLst>
                            <p:ext uri="{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}">
                                <media r:embed="rId4">
                                    <p14:trim p14:st="6741" xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"/>
                                </media>
                            </p:ext>
                        </p:extLst>
                    </p:nvPr>

If I create the video trimming from within PowerPoint, I get XML which looks like this:

                    <p:nvPr>
                        <a:videoFile r:link="rId1"/>
                        <p:extLst>
                            <p:ext uri="{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}">
                                <p14:media xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" r:embed="rId2">
                                    <p14:trim st="6468"/>
                                </p14:media>
                            </p:ext>
                        </p:extLst>
                    </p:nvPr>

Except for the differences in namespace handling, I don’t see the difference.

I confess that I am fairly naive when it comes to generating XML programatically (I’m more used to using marshaling frameworks), so any advice on what I could be doing wrong is welcome.

Thanks...

John Ruschmeyer
EOIR Mission Command Division
23 Christopher Way
Eatontown, NJ 07724
jruschmeyer@eoir.com<ma...@eoir.com>
732-759-6311   Office
732-995-2875   Cell
www.EOIR.com<http://www.eoir.com/>



[cid:CDF3A723-4E6F-4C7B-A132-7C29CAEAB829]

On Apr 8, 2015, at 12:27 PM, kiwiwings <ki...@apache.org>> wrote:

John Ruschmeyer wrote
Any idea which versions of PowerPoint support starting and stopping
mid-video?

You have to add the timing elements which are kinda recursive, for each
following presentation step.

I've got PowerPoint 2010 on my project laptop and the mid-video jumps were
working,
e.g. I had two videos on the same page:
1st click start from 5th second on first video
2nd click stop first video
3rd click start from 10th second on second video
4th click stop second video

I did the setting up in PowerPoint. The resulting video didn't have control
overlays on the video.

Furthermore I guess not all video formats are randomly accessable.
I would open the videos in Quicktime and see if it's possible to start
mid-video.

Andi


Re: Question about embedded video in PPTX files

Posted by kiwiwings <ki...@apache.org>.
John Ruschmeyer wrote
> Any idea which versions of PowerPoint support starting and stopping
> mid-video?

You have to add the timing elements which are kinda recursive, for each
following presentation step.

I've got PowerPoint 2010 on my project laptop and the mid-video jumps were
working,
e.g. I had two videos on the same page:
1st click start from 5th second on first video
2nd click stop first video
3rd click start from 10th second on second video
4th click stop second video

I did the setting up in PowerPoint. The resulting video didn't have control
overlays on the video.

Furthermore I guess not all video formats are randomly accessable.
I would open the videos in Quicktime and see if it's possible to start
mid-video.

Andi



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Question-about-embedded-video-in-PPTX-files-tp5718461p5718472.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Question about embedded video in PPTX files

Posted by John Ruschmeyer <jr...@eoir.com>.
Thanks for the sample. It got me past my problem of embedding the file more than once.

Now I’m trying to work through starting the video at a specific time point. At first, I thought the problem was that the <bmkLst> element needed a <bmk> element, but that just gets me a file which needs repair. Then the repair strips out the bookmark.

Any idea which versions of PowerPoint support starting and stopping mid-video?

Thanks again…
John

> On Apr 6, 2015, at 4:47 PM, Andreas Beeker <ki...@apache.org> wrote:
> 
> Hi John,
> 
>> Technical Question: Is it possible to have a single copy of a video file in a PPTX file and to embed it in more than one slide?
> 
> Technical Answer: yes ;) -> http://pastebin.com/3kmT6ufk
> 
> This is working as expected in MS Powerpoint Viewer - haven't tested in a normal Powerpoint.
> Maybe you want to jump to certain timestamps within the video on different slides.
> You would need to add then the corresponding timing settings + the marker (already included in the sample).
> As this is a bit lengthy, simply create a sample presentation with the timing settings for starting and stopping the videos, save it as pptx and have a look at the resulting xml.
> 
> In case you would use xuggle, please use their latest version 5.4 - the rest is described in http://www.xuggle.com/downloads


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

Re: Question about embedded video in PPTX files

Posted by Andreas Beeker <ki...@apache.org>.
Hi John,

> Technical Question: Is it possible to have a single copy of a video file in a PPTX file and to embed it in more than one slide?

Technical Answer: yes ;) -> http://pastebin.com/3kmT6ufk

This is working as expected in MS Powerpoint Viewer - haven't tested in a normal Powerpoint.
Maybe you want to jump to certain timestamps within the video on different slides.
You would need to add then the corresponding timing settings + the marker (already included in the sample).
As this is a bit lengthy, simply create a sample presentation with the timing settings for starting and stopping the videos, save it as pptx and have a look at the resulting xml.

In case you would use xuggle, please use their latest version 5.4 - the rest is described in http://www.xuggle.com/downloads

Best wishes,
Andi




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org