VideoExtractTracks

VideoExtractTracks[video]

returns a list of video, audio and subtitle tracks 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
    "SubtitleRules"returned as a list of styled text in the form of {int1text1,int2text2,}
    "SubtitleStringRules"returned as a list of plaintext in the form of {int1string1,int2string2,}
    "SubtitleString"returned as a single string of concatenated subtitle texts
    "Video"returned as Video objects
  • 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
    {{"Audio",n},{"SubtitleString",m},...}specific audio, subtitle or 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 tracks as rules of time intervals to styled text, replacing white text with orange for visibility:

Extract all subtitle tracks as rules of time intervals to strings:

Extract all subtitle tracks as strings:

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 (2024), VideoExtractTracks, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoExtractTracks.html (updated 2024).

Text

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

CMS

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

APA

Wolfram Language. (2024). 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="2024", howpublished="\url{https://reference.wolfram.com/language/ref/VideoExtractTracks.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

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