VideoStream[source]
新たなVideoStreamオブジェクトをソースから作成する.
VideoStream[id]
一意的な動画ストリームを表すオブジェクトである.
VideoStream
VideoStream[source]
新たなVideoStreamオブジェクトをソースから作成する.
VideoStream[id]
一意的な動画ストリームを表すオブジェクトである.
詳細とオプション
- VideoStreamは,動画の再生または録画をプログラムで制御するためのVideoオブジェクトまたはデバイスへのハンドルである.
- source は以下のいずれでもよい.
-
video Videoオブジェクトからの再生ストリーム "camera" $ImagingDevicesのカメラからの録画ストリーム {"Screen",n} n
番目の接続スクリーンからの録画ストリーム{"Screen",n,bbox} n
番目のスクリーンの領域 bbox からの録画ストリームNotebookObject[…] スクリーンに描画されたノートブックからの録画ストリーム "livestream" HTTPまたはHTTPSのライブストリームから生成されたストリーム - VideoPlayを使って動画ストリームの再生を開始する.
- VideoRecordを使ってストリームの録画を開始する.
- VideoPauseとVideoStopを使って録音の再生を一時停止したり中止したりする.
- Video[vstream]を使って録画されたストリームからVideoオブジェクトを作る.
- 次は使用可能なオプションである.
-
AudioOutputDevice Automatic 再生に使用する音声出力デバイス ImageSize Automatic 動画フレームの表示サイズ Looping False 再生をループにするかどうか RasterSize Automatic 動画フレームの次元 SoundVolume Automatic 音量 - vstream["prop"]を使って動画ストリーム vstream の特性が入手できる.
- vstream["prop"]=val で特性の値が設定できる.
- 次は,大域的特性である.
-
"Duration" 全体的な継続時間 "ID" ストリームID "ImageSize" 動画の再生サイズ "Location" リンクされた動画ファイルの位置 "Looping" 再生をループにするかどうか "Position" 時間Quantityとして与えられた再生位置 "Status" ストリームの状態 "AudioTrackCount" 音声トラック数 "VideoTrackCount" 動画トラック数 "SubtitleTrackCount" 字幕トラック数 - "Status"の可能な設定値には,"Playing","Recording","Paused","Stopped"がある.
- 次は,VideoStream[dev]のその他の特性である.
-
"AudioInputDevice" 録音に使う音声入力デバイス "GeneratedAssetLocation" 録音された音声を保存するファイルのパス "RecordedVideo" 録音のための動画オブジェクト "RecordedDuration" 録音された動画の継続時間 - 次は,現行のトラック特性である.
-
"CurrentAudioTrack" 現行音声トラックのインデックス "CurrentAudio" 現行音声の断片 "CurrentVideoTrack" 現行動画トラックのインデックス "CurrentFrame" 現行動画の1フレーム "CurrentSubtitleTrack" 現行字幕トラックのインデックス "CurrentSubtitle" 現行字幕の断片 - 次は,現行音声トラックの特性である.
-
"AudioOutputDevice" 再生に使用する音声出力デバイス "AudioChannels" 音声チャンネル数 "SampleRate" 音声サンプルレート "SoundVolume" 音量 "AudioEncoding" 音声コーデック - 次は,現行動画トラックの特性である.
-
"FrameChannels" 色チャンネルの数 "FrameRate" 動画フレームレート "RasterSize" フレームの次元 "VideoEncoding" 動画コーデック - 次は,現行字幕トラックの特性である.
-
"SubtitleEncoding" 字幕コーデック
例題
すべて開く すべて閉じる例 (1)
ローカルの動画ファイルにリンクしたVideoStreamオブジェクトを作成する:
stream = VideoStream["ExampleData/Caminandes.mp4"]Dynamic[stream["CurrentFrame"]]VideoPlay[stream]VideoPause[stream]スコープ (10)
基本的な用法 (6)
stream = VideoStream["ExampleData/Caminandes.mp4"]Dynamic[stream["CurrentFrame"]]Videoオブジェクトからの動画ストリーム:
v = Video["ExampleData/Caminandes.mp4"]stream = VideoStream[v]stream["Duration"]stream = VideoStream["http://exampledata.wolfram.com/agent327.mp4"];stream["Position"] = 60;stream["CurrentFrame"]stream = VideoStream[URL[...]];
VideoPlay[stream]stream["CurrentFrame"]ライブストリームの継続時間はIndeterminateである:
stream["Duration"]stream = VideoStream[$DefaultImagingDevice]VideoRecord[stream]
Pause[5];
VideoStop[stream];Video[stream]Information[%]stream = VideoStream["Screen"]VideoRecord[stream]
Pause[5];
VideoStop[stream];Video[stream]Information[%]特性 (4)
stream = VideoStream["ExampleData/Caminandes.mp4"];
stream["Properties"]AssociationMap[stream, stream["Properties"]]//Datasetstream = VideoStream[$DefaultImagingDevice];
stream["Properties"]AssociationMap[stream, stream["Properties"]]//Datasetstream = VideoStream["ExampleData/Caminandes.mp4"];stream["Position"] = 30;stream["CurrentFrame"]stream = VideoStream["ExampleData/Caminandes.mp4"]VideoPlay[stream];
Pause[5];
stream["SoundVolume"] = .1;
Pause[5];
stream["SoundVolume"] = 1;オプション (5)
AudioOutputDevice (1)
デフォルトで,AudioOutputDeviceは対応するVideoオブジェクトから継承される:
v = Video["ExampleData/rule30.mp4", AudioOutputDevice -> $DefaultAudioOutputDevice];
stream = VideoStream[v];AudioOutputDevice /. Options[v]stream["AudioOutputDevice"]AudioOutputDeviceオブションを使ってVideoStreamを別のデバイスに設定することもできる:
stream = VideoStream[v, AudioOutputDevice -> $AudioOutputDevices[[2]]];stream["AudioOutputDevice"]ImageSize (1)
デフォルトで,画像の次元とウィンドウサイズに基づいてスケールする自動画像サイズが使われる:
str = VideoStream["ExampleData/bullfinch.mkv"]str["CurrentFrame"]str = VideoStream["ExampleData/bullfinch.mkv", ImageSize -> 200];
str["CurrentFrame"]ImageDimensions[%]str["ImageSize"] = 400;
str["CurrentFrame"]Looping (1)
str = VideoStream["ExampleData/bullfinch.mkv"]str["Looping"]str = VideoStream["ExampleData/bullfinch.mkv", Looping -> True];
str["Looping"]str = VideoStream["ExampleData/bullfinch.mkv", Looping -> 2];
str["Looping"]RasterSize (1)
v = Video["ExampleData/bullfinch.mkv"];Information[v]["VideoTracks"]str = VideoStream[v];
str["CurrentFrame"]//ImageDimensionsstr = VideoStream[v, RasterSize -> 320];
str["CurrentFrame"]//ImageDimensionsstr = VideoStream[v, RasterSize -> {320, 100}];
str["CurrentFrame"]//ImageDimensionsSoundVolume (1)
デフォルトで,SoundVolumeは対応するVideoオブジェクトから継承される:
v = Video["ExampleData/rule30.mp4", SoundVolume -> .5];
stream = VideoStream[v];SoundVolume /. Options[v]stream["SoundVolume"]SoundVolumeオプションを使ってVideoStreamを異なる音量に設定することもできる:
stream = VideoStream[v, SoundVolume -> .1];stream["SoundVolume"]アプリケーション (3)
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]ニューラルネットワークに基づいた関数をリアルタイムで現行フレームに適用する:
stream = VideoStream["ExampleData/bullfinch.mkv"]ImageCasesの結果を動的にハイライトする:
VideoPlay[stream];HighlightImage[stream["CurrentFrame"], ImageCases[stream["CurrentFrame"], All -> "BoundingBox"]]//DynamicVideoPause[]stream = VideoStream["ExampleData/bullfinch.mkv"]ImageSaliencyFilterの結果を計算する:
VideoPlay[stream];Dynamic@ImageSaliencyFilter[stream["CurrentFrame"]]VideoPause[]特性と関係 (1)
VideoPlayを使って動画ストリームを作成し,これの再生を開始する:
v = Import["ExampleData/Caminandes.mp4"];
stream = VideoPlay[v]Dynamic[Quiet@stream["CurrentFrame"] /. Except[_Image] -> None]VideoPauseを使って再生を一時停止する:
VideoPause[stream];VideoStopを使って再生を中止して再設定する:
VideoStop[stream];VideoStreamsを使ってシステム中のすべての動画ストリームをリストにする:
VideoStreams[]RemoveVideoStreamを使ってストリームと関連するリソースを削除する:
RemoveVideoStream[stream];関連するガイド
-
▪
- 動画処理 ▪
- 動画計算機能の更新履歴 ▪
- 動画作成
テキスト
Wolfram Research (2020), VideoStream, Wolfram言語関数, https://reference.wolfram.com/language/ref/VideoStream.html (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_2026_videostream, author="Wolfram Research", title="{VideoStream}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/VideoStream.html}", note=[Accessed: 02-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_videostream, organization={Wolfram Research}, title={VideoStream}, year={2021}, url={https://reference.wolfram.com/language/ref/VideoStream.html}, note=[Accessed: 02-November-2026]}