Estrarre media da PowerPoint usando Python

This quick tutorial shares the details for extracting the media from PowerPoint using Python. All necessary areas are covered, such as IDE setup, a list of steps, and a sample code that shows how to extract a video from PowerPoint using Python. The sample code provided will help retrieve both video and audio content from the presentation.

Passaggi per estrarre video da PowerPoint usando Python

  1. Imposta l’IDE per usare Aspose.Slides for Python via .NET per estrarre il video
  2. Import the OS module and the Aspose library.Slides
  3. Define a mapping to retrieve the file extension from the content type.
  4. Upload the source PPTX file into the object of class Presentation.
  5. Analizza tutte le diapositive nella presentazione
  6. Inspect all shapes for embedded multimedia content on each slide.
  7. Check if the shape is a VideoFrame, save it with the appropriate extension using the mapping with the content type.
  8. Verifica se la forma è un AudioFrame, salvala con l’estensione appropriata usando la mappatura con il tipo di contenuto.

These steps explain how to extract a video from PowerPoint using Python. Load the presentation, iterate through all the slides, retrieve each shape, and inspect it for the content type. If it is a video or audio, define its extension and save it to disk.

Code to extract audio from PPTX using Python

Questo codice dimostra come estrarre un video da un PowerPoint usando Python, o un file audio se ne viene trovato uno. È possibile utilizzare la collezione Presentation.video o presentazioneAudio to directly access the content at the presentation level, avoiding the analysis of each slide and format. Shape.Il nome può anche essere usato per nominare un file invece di contatori generici.

Questa guida ha spiegato come recuperare contenuti video e audio da una presentazione. Per estrarre il testo da una presentazione, consulta l’articolo Estrai testo da PowerPoint usando Python.

 Italiano