STK Graphics PrimitivesSend comments on this topic.
IAgStkGraphicsVideoStream Interface

Description

A raster stream that streams from a video. The video can be read from a file, or streamed from an HTTP, RTP, UDP, or TCP source. See the Video Streams Overview for a list of supported video formats and Uri usage.

Public Methods

Public Method CloseCloses the video stream and any associated resources.
Public Method PausePauses the video when the Playback property is set to RealTime.
Public Method PlayBegins playing the video when the Playback property is set to RealTime.
Public Method ReinitializeWithStringUriReinitializes the video stream from a Uri, which can be a file, HTTP, RTP, UDP, or TCP source. See the Video Streams Overview for a list of supported video formats and Uri usage.
Public Method ResetSeeks the video to its first frame and begins playing the video when the Playback property is set to RealTime.
Public Method StopStops the video when the Playback property is set to RealTime. Stopping the video will seek to the first frame and pause playback. Use the Play method to begin playing the video again.

Public Properties

Public Property AllowFrameDropGets or sets a value indicating if frames should be dropped if video processing can not keep up with a video stream. If this is set to false, the video quality may degrade when the processing load is too high. Alternatively, when set to true, frames will be dropped, but each frame that is processed should have an improved visual quality.
Public Property AudioUriGets the Uri of the audio.
Public Property EnableAudioGets or sets a value indicating if the encoded audio stream should be synchronized to video playback If this is set to false, the audio stream will be disabled. If true, the audio stream will be sampled from the video source and synchronized with the video stream.
Public Property EndFrameGets or sets the end frame of the video. Changing the End Frame property also changes the End Time property to the time in the video that corresponds to the specified frame.
Public Property EndTimeGets or sets the end time of the video in seconds. Changing the End Time property also changes the End Frame property to the frame in the video that corresponds to the specified time.
Public Property FrameRateGets or sets the frame rate of the video when the Playback property is set to RealTime. If this property is not set, the internal framerate of the video is used.
Public Property IntervalEndTimeGets or sets the Scene Manager time at which the video will stop playing when the Playback property is set to Time Interval.
Public Property IntervalStartTimeGets or sets the Scene Manager time at which the video will begin playing when the Playback property is set to Time Interval.
Public Property IsPlayingGets whether or not the video is playing. Use the Play, Pause, Stop, and Reset methods to control the playback of the video when the Playback property is set to RealTime.
Public Property LoopGets or sets whether the video will loop when it reaches its last frame when the Playback property is set to RealTime.
Public Property PacketAcquirementYieldTimeGets or sets the thread processing yield time for asynchronous streaming of video over common protocols like udp. Setting a high value may increase performance, but may cause frames or packets to drop, effecting visual quality. A lower value will ensure high priority processing of the stream, and thus less visual degradation, but may affect performance.
Public Property PacketBufferLimitGets or sets a value indicating the buffering limit for packets when processing a video stream. Increasing this value will provide more buffering of the video stream when frame processing cannot keep up, but has memory implications and may result in the video falling behind, or eventual visual degradation, if the frame processing load is not lessened.
Public Property PlaybackGets or sets the Video Playback mode of the video.
Public Property StartFrameGets or sets the start frame of the video. Changing the Start Frame property also changes the Start Time property to the time in the video that corresponds to the specified frame.
Public Property StartTimeGets or sets the start time of the video in seconds. Changing the Start Time property also changes the Start Frame property to the frame in the video that corresponds to the specified time.
Public Property UriGets the Uri of the video.

Interfaces

CoClasses that Implement IAgStkGraphicsVideoStream

Example

Draw a new Video Stream primitive
[MATLAB]
% IAgScenario scenario: Scenario object
manager = scenario.SceneManager;
% Extract "C:\Program Files\AGI\STK 12\CodeSamples\CodeSamples.zip" to "C:\Temp\CodeSamples"
video = manager.Initializers.VideoStream.InitializeWithStringUri('c:\Temp\CodeSamples\CustomApplications\Data\HowTo\Videos\ShenzhouVII_BX1.wmv');
% Playback options are 'eStkGraphicsVideoPlaybackTimeInterval'
% 'eStkGraphicsVideoPlaybackRealTime'
video.Playback = 'eStkGraphicsVideoPlaybackRealTime';
video.Loop = true;
overlay = manager.Initializers.TextureScreenOverlay.InitializeWithXYWidthHeight(0, 0, video.Width / 3, video.Height / 3);
overlay.MaintainAspectRatio = true;
overlay.Translucency = 0;
overlay.BorderSize = 1;
overlay.BorderTranslucency = .25;
overlay.Origin = 'eStkGraphicsScreenOverlayOriginTopRight';
overlay.Texture = scenario.SceneManager.Textures.FromRaster(video);
manager.ScreenOverlays.Overlays.Add(overlay);
% Render the Scene
manager.Render();


        

See Also

© 2024 Analytical Graphics, Inc. All Rights Reserved.