VideoExtractTracks

VideoExtractTracks[video]

returns a list of Video and Audio objects, each of which represents one track of video.

VideoExtractTracks[video,"type"]

returns tracks from video of a given "type".

VideoExtractTracks[video,trackspec]

returns tracks specified by trackspec.

Details

  • VideoExtractTracks can be used to get direct access to a specific video, audio track or subtitle tracks.
  • Possible values for "type" are:
  • "Audio"returned as Audio objects
    "Video"returned as Video objects
    "Subtitle"returned as a list of styled text in the form of {int1text1,int2text2,}
    "SubtitleText"returned as a list of strings in the form of {int1string1,}
  • In VideoExtractTracks[video,trackspec], trackspec can take any specification allowed by Extract.
  • Examples of track specifications in trackspec are:
  • {"Audio",n}n^(th) audio track
    {"Audio",Span[]}a span of audio tracks
    {{"Video",n},{"Audio",m},...}specific audio and video tracks
    {All,n}n^(th) audio and video tracks

Examples

open allclose all

Basic Examples  (2)

Extract one audio track:

Plot the waveform of the audio track:

Extract the text of the first subtitle track:

Scope  (3)

Import a video file with multiple audio and subtitle tracks:

Extract all audio tracks:

Extract all subtitle track texts:

Applications  (2)

Perform speech recognition on a specific audio track:

Compare to the corresponding subtitle track:

Extract a specific subtitle track and translate it to a different language:

Create a new video with a translated subtitle track:

Properties & Relations  (1)

Extract the first audio track using the Audio constructor:

This is equivalent to:

Other audio tracks cannot be extracted using the Audio constructor:

Wolfram Research (2023), VideoExtractTracks, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoExtractTracks.html.

Text

Wolfram Research (2023), VideoExtractTracks, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoExtractTracks.html.

CMS

Wolfram Language. 2023. "VideoExtractTracks." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VideoExtractTracks.html.

APA

Wolfram Language. (2023). VideoExtractTracks. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoExtractTracks.html

BibTeX

@misc{reference.wolfram_2024_videoextracttracks, author="Wolfram Research", title="{VideoExtractTracks}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/VideoExtractTracks.html}", note=[Accessed: 30-May-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_videoextracttracks, organization={Wolfram Research}, title={VideoExtractTracks}, year={2023}, url={https://reference.wolfram.com/language/ref/VideoExtractTracks.html}, note=[Accessed: 30-May-2024 ]}