VideoStream

VideoStream[source]

creates a new VideoStream object from source.

VideoStream[id]

is an object that represents a unique video stream.

Details and Options

  • VideoStream is a handle to a Video object or a device to programmatically control playback or recording of a video.
  • The source can be any of the following:
  • videoplayback stream from a Video object
    "camera"recording stream from a camera in $ImagingDevices
    {"Screen",n}recording stream from the n^(th) connected screen
    {"Screen",n,bbox}recording stream from the region bbox of the n^(th) screen
    NotebookObject[]recording stream from a notebook displayed on screen
    "livestream"a stream generated from an HTTP or HTTPS livestream
  • Use VideoPlay to start playing back the video stream.
  • Use VideoRecord to start recording the stream.
  • Use VideoPause and VideoStop to pause or stop the playback or the recording.
  • Use Video[vstream] to create a Video object from a recorded stream.
  • The following options can be specified:
  • AudioOutputDeviceAutomaticaudio output device to use for playback
    ImageSize Automaticdisplay size of the video frames
    Looping Falsewhether to loop the playback
    RasterSize Automaticdimensions of video frames
    SoundVolumeAutomaticsound volume
  • A property of a video stream vstream can be obtained using vstream["prop"].
  • It is possible to set values of properties with vstream["prop"]=val.
  • Global properties:
  • "Duration"overall duration
    "ID"the stream ID
    "ImageSize"the size at which to display the video
    "Location"location of the linked video file
    "Looping"whether to loop the playback
    "Position"position of the playback given as a time Quantity
    "Status"status of the stream
    "AudioTrackCount"number of audio tracks
    "VideoTrackCount"number of video tracks
    "SubtitleTrackCount"number of subtitle tracks
  • Possible settings for "Status" include "Playing", "Recording", "Paused" or "Stopped".
  • Additional properties for VideoStream[dev]:
  • "AudioInputDevice"audio input device to use for recording
    "GeneratedAssetLocation"path to the file that will store the recorded video
    "RecordedVideo"video object for the recording
    "RecordedDuration"duration of the recorded video
  • Current track properties:
  • "CurrentAudioTrack"index of the current audio track
    "CurrentAudio"snippet of the current audio
    "CurrentVideoTrack"index of the current video track
    "CurrentFrame"a frame of the current video
    "CurrentSubtitleTrack"index of the current subtitle track
    "CurrentSubtitle"snippet of the current subtitle
  • Properties for the current audio track:
  • "AudioOutputDevice"audio output device to use for playback
    "AudioChannels"number of audio channels
    "SampleRate"audio sample rate
    "SoundVolume"sound volume
    "AudioEncoding"audio codec
  • Properties for the current video track:
  • "FrameChannels"number of color channels
    "FrameRate"video frame rate
    "RasterSize"dimensions of the frame
    "VideoEncoding"video codec
  • Properties for the current subtitle track:
  • "SubtitleEncoding"subtitle codec

Examples

open allclose all

Basic Examples  (1)

Create a VideoStream object linking to a local video file:

Change the stream position:

Pause the stream:

Scope  (10)

Basic Uses  (6)

A video stream directly from a file:

A video stream from a Video object:

A stream from a URL:

A stream from a livestream video:

The duration of livestreams is Indeterminate:

A recording stream from a connected imaging device:

Record frames from the stream:

Retrieve the recorded video:

A recording stream from a screen:

Record frames from the stream:

Retrieve the recorded video:

Properties  (4)

Check for available stream properties:

Get the property values of a video stream:

Check for available properties in a recordable stream:

Get the property values of a video stream:

Set the "Position" property:

Extract frame at current position:

Modify properties while playing a stream:

Options  (3)

ImageSize  (1)

By default, automatic image size is used, which scales depending on image dimensions and window size:

Specify a different image size:

Notice that image dimensions are not affected:

Change the "ImageSize" property:

Looping  (1)

By default, the video stream is not looping:

Create a looping stream:

Create a stream that loops twice:

RasterSize  (1)

By default, the original raster size is used:

Specify a different raster size:

Specify both width and height:

Applications  (3)

Build a simple video GUI:

Apply a neural networkbased function to the current frame in real time:

Highlight the results of ImageCases dynamically:

Apply an image processing function dynamically to the current frame:

Compute the result of ImageSaliencyFilter:

Wolfram Research (2020), VideoStream, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoStream.html (updated 2021).

Text

Wolfram Research (2020), VideoStream, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoStream.html (updated 2021).

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_videostream, author="Wolfram Research", title="{VideoStream}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/VideoStream.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

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