Class FFMPEGSourceTimestampEventArgs
- Namespace
- VisioForge.Core.Types.Events
- Assembly
- VisioForge.Core.dll
Provides data for events that deliver timestamp information from an FFmpeg source. This class is used to convey the current playback or processing time for different media types within an FFmpeg stream.
public class FFMPEGSourceTimestampEventArgs : EventArgsInheritance
Inherited Members
Examples
// Assume an event handler is registered for an FFmpeg source timestamp event.
public void OnFFMPEGTimestampReceived(object sender, FFMPEGSourceTimestampEventArgs e)
{
Console.WriteLine($"FFmpeg Timestamp Event: ");
Console.WriteLine($" Media Type: {e.MediaType}");
Console.WriteLine($" Current Timestamp: {e.Timestamp}");
Console.WriteLine($" Stream Start Time: {e.StreamStartTime}");
Console.WriteLine($" Demuxer Start Time: {e.DemuxerStartTime}");
// You can use this information for custom seeking, synchronization, or display purposes.
if (e.MediaType == FFMPEGSourceMediaType.Video)
{
// Update a video playback progress bar.
}
}
Remarks
This event argument is crucial for synchronizing operations with the media timeline, especially when dealing with complex FFmpeg sources that might have multiple streams (video, audio, data, subtitles). It provides timestamps relative to the media stream itself, as well as the demuxer's start time.
Constructors
FFMPEGSourceTimestampEventArgs(FFMPEGSourceMediaType, TimeSpan, TimeSpan, TimeSpan)
Initializes a new instance of the VisioForge.Core.Types.Events.FFMPEGSourceTimestampEventArgs class.
public FFMPEGSourceTimestampEventArgs(FFMPEGSourceMediaType mediaType, TimeSpan timestamp, TimeSpan demuxerStartTime, TimeSpan streamStartTime)Parameters
mediaTypeFFMPEGSourceMediaType-
The VisioForge.Core.Types.Events.FFMPEGSourceMediaType of the media.
timestampTimeSpan-
The current timestamp of the media.
demuxerStartTimeTimeSpan-
The start time of the demuxer.
streamStartTimeTimeSpan-
The start time of the specific stream.
Properties
DemuxerStartTime
Gets the start time of the demuxer, which is the component responsible for splitting the media container into individual streams.
public TimeSpan DemuxerStartTime { get; }Property Value
MediaType
Gets the type of the media stream associated with this timestamp.
public FFMPEGSourceMediaType MediaType { get; }Property Value
StreamStartTime
Gets the start time of the specific stream (e.g., video stream, audio stream) within the media file.
public TimeSpan StreamStartTime { get; }Property Value
Timestamp
Gets the current timestamp of the media stream. This represents the current position in the media playback or processing.
public TimeSpan Timestamp { get; }