Skip to content

PPTX/ODP: embedded video and audio are not represented in the document #4740

Open

Description

@Steve-Allison

Bug

An embedded video on a PPTX slide produces no item at all: the PPTX backend handles picture and group shapes but not movie/media shapes. (The ODF backend likewise skips draw:plugin.) The media is silently absent from the document.

Steps to reproduce

"""Reproduce: PPTX footer/date/slide-number placeholders arrive as body text, and an embedded video is ignored.

Usage: repro_pptx_footer_video.py <path-to-a-short-mp4>
"""

import sys
from importlib.metadata import version
from io import BytesIO

from docling.datamodel.base_models import InputFormat
from docling.document_converter import DocumentConverter
from docling_core.types.doc import ContentLayer, TextItem
from docling_core.types.io import DocumentStream
from lxml import etree
from pptx import Presentation
from pptx.util import Inches


P = "http://schemas.openxmlformats.org/presentationml/2006/main"
A = "http://schemas.openxmlformats.org/drawingml/2006/main"


def placeholder(ph_type: str, idx: int, text: str) -> etree._Element:
    return etree.fromstring(
        f'<p:sp xmlns:p="{P}" xmlns:a="{A}"><p:nvSpPr><p:cNvPr id="{10 + idx}" name="{ph_type} {idx}"/>'
        f'<p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="{ph_type}" idx="{idx}"/></p:nvPr>'
        f"</p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:p><a:r><a:t>{text}</a:t></a:r></a:p></p:txBody></p:sp>"
    )


def build(video: str) -> BytesIO:
    prs = Presentation()
    slide = prs.slides.add_slide(prs.slide_layouts[6])
    slide.shapes.add_textbox(Inches(1), Inches(1), Inches(6), Inches(1)).text_frame.text = "Slide body text"
    tree = slide.shapes._spTree
    tree.append(placeholder("ftr", 11, "Company confidential footer"))
    tree.append(placeholder("dt", 10, "10 October 2026"))
    tree.append(placeholder("sldNum", 12, "1"))
    slide.shapes.add_movie(video, Inches(1), Inches(3), Inches(4), Inches(2.25), mime_type="video/mp4")
    buf = BytesIO()
    prs.save(buf)
    buf.seek(0)
    return buf


result = DocumentConverter(allowed_formats=[InputFormat.PPTX]).convert(
    DocumentStream(name="repro.pptx", stream=build(sys.argv[1]))
)
print(f"docling {version('docling')}, docling-core {version('docling-core')}, python {sys.version.split()[0]}")
for item, _ in result.document.iterate_items(included_content_layers=set(ContentLayer)):
    label = item.label.value if hasattr(item, "label") else type(item).__name__
    text = item.text if isinstance(item, TextItem) else ""
    print(f"{label}: {text!r} [{item.content_layer.value}]")

(Pass any short MP4.) The output lists the slide's paragraphs and nothing for the movie shape.

Expected

At least one item per media object recording its part name and slide; ideally the media handed to the ASR pipeline the way a standalone video input is.

Docling version

docling 2.137.0, docling-core 2.101.1, python 3.14.8 (macOS, Apple Silicon)

Activity

  1. self-assigned this
    on Oct 10, 2026
  2. DanielNg0729 commented on Oct 10, 2026

    @DanielNg0729
    Member

    Thank you @Steve-Allison for the clear report of this issue! I can reproduce it on main. python-pptx reads a video as a Movie, not a Picture, so the PPTX backend skips it, and an audio shape comes out as a plain speaker-icon picture. On ODP, only the draw:plugin preview comes out.
    I opened #4752 to cover this issue. Please feel free to make a comment on it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions