VideoPlay[video]
returns a new VideoStream object from video and starts the playback.
VideoPlay[vstream]
starts playing a VideoStream object vstream.
VideoPlay
VideoPlay[video]
returns a new VideoStream object from video and starts the playback.
VideoPlay[vstream]
starts playing a VideoStream object vstream.
Details and Options
- VideoPlay can be used to perform programmatic video playback.
- VideoPlay will continually change the "Position" property of vstream starting from the current position.
- VideoPlay by default plays the entire stream until paused, stopped or finished.
- The following option can be specified:
-
Looping Automatic whether to loop the playback - VideoPlay continues to play until either MaxDuration is reached or the maximum number of loops is played.
Examples
open all close allBasic Examples (1)
Create a VideoStream object linking to a local video file:
stream = VideoStream["ExampleData/Caminandes.mp4"]Dynamic[stream["CurrentFrame"]]VideoPlay[stream]VideoPause[stream]Scope (3)
Play a VideoStream:
str = VideoStream["ExampleData/Caminandes.mp4"];VideoPlay[str]Create a VideoStream from a Video object and immediately play it:
v = Video["ExampleData/Caminandes.mp4"];VideoPlay[v]Create two separate streams from a Video object:
v = Video["ExampleData/bullfinch.mkv"];s1 = VideoStream[v];
s2 = VideoStream[v];The two streams are independent. Play one video 0.5 seconds after the beginning of the other one:
VideoPlay[s1];Pause[.5];VideoPlay[s2];VideoStop[]Options (1)
Looping (1)
By default, the stream is played only once:
v = VideoTrim[Video["ExampleData/Caminandes.mp4", RasterSize -> 200], {2, 4}];str1 = VideoPlay[v];
Dynamic[str1["CurrentFrame"]]Use LoopingTrue to loop the playback:
str2 = VideoPlay[v, Looping -> True]Dynamic[str2["CurrentFrame"]]Use an integer value to loop a specific number of times:
str3 = VideoPlay[v, Looping -> 2]Dynamic[str3["CurrentFrame"]]VideoStop[]Applications (4)
stream = VideoStream["ExampleData/bullfinch.mkv"]Panel@Column[{
Dynamic[stream["CurrentFrame"]],
Slider[Dynamic[QuantityMagnitude[stream["Position"], "Seconds"], (stream["Position"] = #)&], {0, QuantityMagnitude[stream["Duration"], "Seconds"]}],
Button[
Dynamic[If[stream["Status"] === "Playing", "Pause", "Play"]],
If[stream["Status"] === "Playing", VideoPause[stream], VideoPlay[stream]]
]
}, Alignment -> Center]Apply a neural networks–based function to the current frame in real time:
stream = VideoStream["ExampleData/bullfinch.mkv"]Highlight the results of ImageCases dynamically:
VideoPlay[stream];HighlightImage[stream["CurrentFrame"], ImageCases[stream["CurrentFrame"], All -> "BoundingBox"]]//DynamicVideoPause[]Apply an image processing function dynamically to the current frame:
stream = VideoStream["ExampleData/bullfinch.mkv"]Compute the result of ImageSaliencyFilter:
VideoPlay[stream];Dynamic@ImageSaliencyFilter[stream["CurrentFrame"]]VideoPause[]Make a dynamic visualization of a video stream:
stream = VideoStream["ExampleData/Caminandes.mp4"]Display the Spectrogram of the current audio using a color function based on the dominant colors of the current frame:
VideoPlay[stream];Dynamic@With[{cols = DominantColors@stream["CurrentFrame"]}, If[AudioQ@stream["CurrentAudio"], Spectrogram[stream["CurrentAudio"], ColorFunction -> (Blend[cols, #]&), PlotRange -> All], None]]VideoPause[]Related Guides
History
Text
Wolfram Research (2020), VideoPlay, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoPlay.html.
CMS
Wolfram Language. 2020. "VideoPlay." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VideoPlay.html.
APA
Wolfram Language. (2020). VideoPlay. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoPlay.html
BibTeX
@misc{reference.wolfram_2026_videoplay, author="Wolfram Research", title="{VideoPlay}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/VideoPlay.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_videoplay, organization={Wolfram Research}, title={VideoPlay}, year={2020}, url={https://reference.wolfram.com/language/ref/VideoPlay.html}, note=[Accessed: 13-June-2026]}