PresentationBuilder cannot copy video slides correctly

Home Forums PresentationML PresentationBuilder cannot copy video slides correctly

This topic contains 7 replies, has 3 voices, and was last updated by  sliu 11 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2511

    sliu
    Participant

    I’m using Windows 10 and Office 2016. I just downloaded the latest OpenXml PowerTools and ran PresentationBuilder01. It works with the provided pptx files. I added 2 slides – one has audio (mp3) and the other has video (mp4). I modified the code to copy these 2 slides into a new pptx. After the file is generated, I tried to play the video. But it is not playable. The error is “Codec Unavailable”. I looked at the generated folder layout and media files. They are different from the source. Can you try to copy a video slide to see what the problem is.

    Thanks in advance!!!

    #2512

    Eric White
    Keymaster

    This certainly sounds like a bug. I’ll attend to this in the next week or so. Should not be hard to fix.

    #2516

    sliu
    Participant

    Hi Eric,

    That would be great! I’m new on OpenXml SDK. I’m reading PowerTool code. I see PtOpenXmlExtensions.GetXDocument and PutXDocument use OpenXmlPart.Annotation<XDocument> method to store part xml. I don’t fully understand its purpose. If all the parts have their annotations with different types, when the presentation is saved to pptx, can I see the annotations? Do they affect pptx rendering?

    Thanks very much!!!

    #2525

    Eric White
    Keymaster

    GetXDocument and PutXDocument are convenience functions that make it easier to work with LINQ to XML using the Open-Xml-Sdk. You can call GetXDocument multiple times and it will de-serialize it only once. The annotations are on the Open XML parts within a package. You can think of annotations as strongly-typed ‘user data’ for a part within a package.

    Annotations are in-memory only. They have no affect on rendering.

    #2529

    sliu
    Participant

    Thanks for the explanation.

    After reading the code, I realized all the media files are created as DataPart in PresentationBuilder and the Non-Public memember TargetFileExtension is “.bin”. For images, OpenXml SDK adds .bin to media files. For audio and video files, it doesn’t add any extension. I know audios created by OpenXml SDK are playable, but not video. I’m not sure if it is caused by file extension. I thought using OpenXm SDK I can create exactly folder layouts as pptx generated by PowerPoint. It seems like not exactly.

    I’m wondering how [Content_Type].xml is created by sdk. Which sdk api or part is related to its generation? Can I load in this xml and modify it and save it back to some part. When package is saved, my modified content is in [Content_Type].xml?

    #2531

    Eric White
    Keymaster

    No, you can’t create folder layout exactly as generated by PowerPoint. But it should not matter.

    [Content_Type].xml is created implicitly by System.IO.Packaging when you create a package. When you maintain a package, adding parts, you specify the content type, and System.IO.Packaging will add new entries into [Content_Type].xml. You should never need to maintain this explicitly.

    #3495

    tika01
    Participant

    PresentationBuilder cannot copy video slides correctly, could you plz help us.

    #3496

    sliu
    Participant

    This issue has been resolved. How do I help?

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.