Estrai media da PowerPoint usando Java

This short guide explains how to extract media from PowerPoint using Java. Imparerai a configurare l’IDE, ottenere un elenco di passaggi e un codice di esempio che mostra come estrarre un video da PowerPoint usando Java. The sample code contains two separate sections to extract video and audio from each slide.

Passaggi per estrarre l’audio da PPTX usando Java

  1. Set the IDE to use Aspose.Slides for Java to extract media from a presentation.
  2. Apply the license and perform the initial setup by declaring several variables.
  3. Upload the original PPTX into the object of class Presentation.
  4. Iterate through all the slides in the presentation and analyze each shape in the corresponding slide.
  5. If the current shape is an IVideoFrame with embedded video, retrieve its stream and save it to disk.
  6. If the shape is an IAudioFrame with an embedded audio clip, retrieve the stream data and save it to disk.

These steps show how to extract a video from PowerPoint using Java; however, the sample code also demonstrates extracting audio clips. To start the process, load the source presentation, iterate through each slide, and access its collection of shapes. Check the content type of each shape by comparing it with IVideoFrame for embedded videos or with IAudioFrame for audio clips. Se il contenuto è di tipo video o audio, recupera il suo flusso e salva il media con l’estensione appropriata determinata tramite una funzione personalizzata.

Codice per estrarre video da PowerPoint usando Java

Questo codice mostra come ottenere video da PowerPoint usando Java. It is also possible to extract other content, such as text, speaker notes, extract text from grouped tapes, and export the text in TXT or JSON format if needed. Se il tipo di contenuto non viene trovato, cioè non è nella lista fornita di tipi di contenuto, vengono utilizzati i tipi predefiniti MP4 o MP3.

This article shows how to extract video and audio from a presentation. Per estrarre testo da una presentazione, fare riferimento all’articolo Extract text from PowerPoint using Java.

 Italiano