Read MWriter statistics with PropsGet. Values are returned as strings. Read them while the writer is processing a source, and compare successive observations to check progress.
A writer in the Running state does not by itself confirm that packets are reaching the destination. Use the per-stream muxer statistics to investigate processing, and check the output at the receiver.
Object statistics
| Name | Description |
|---|---|
| stat::writer_config | a current encoding configuration of an object |
| stat::elapsed | waiting for the next frame interval in msec |
| stat::reset_counter | a number of statistics resets |
| stat::breaks | a number of breaks - frames with "Break" flag, when a frame is expected but is not received from a source |
| stat::dups | a number of duplicated frames |
| stat::pauses | a number of frames processed while a source is paused |
| stat::skipped | a number of skipped frames |
| stat::added | a number of added frames to keep the overall frame rate stable |
| stat::tc_breaks | a number of timecode issues (when the current frame contains a timecode that is different from the previous more than for 1 frame, e.g. "01:23:45:12" and "01:23:45:15"). Grows fast for fast playback |
| stat::plugins.perf | performance of all the plugins that are added to the object (how long does it take to process a frame with all the plugins) |
| stat::audio_breaks | a number of frames with silence at the end (without audio) |
| stat::time_breaks | a number of issues when an end time of the previous frame doesn't match a start time of the current frame |
| stat::plugins.count | a number of plugins added to the object |
| stat::time_over_200 | a number of frames which processing takes more than 2 frame durations |
| stat::time_over_166 | a number of frames which processing takes between 1.66 and 2 times more than the frame duration |
| stat::time_over_133 | a number of frames which processing takes between 1.33 and 1.66 times more than the frame duration |
| stat::time_less_50 | a number of frames which processing takes less than 0.5 frame duration |
| stat::live | indicates whether a source is from a live feed (e.g. a camera) |
| stat::video | a video format width(raw_bytes)xheight(colorspace)@frame_rate (aspect_ratio) |
| stat::audio | an audio format channels,sample_rate,bits |
| stat::video_frames | a number of processed video frames |
| stat::video_time | a total duration of the processed video in seconds |
| stat::audio_samples | a total number or processed audio samples |
| stat::audio_time | a total duration of the processed audio in seconds |
| stat::av_sync | a difference between audio and video times in msec |
| stat::vt_sync | a difference between a video time and an internal system clock in msec |
| stat::vh_sync | a difference between a video time and a hardware timer of a source device (works for Blackmagic devices only) |
| stat::stat_perf | a time interval to grab the statistics in msec |
| stat::buffered | a number of buffered frames |
| stat::frames_in | a number of encoded frames |
| stat::fps | frame rate of the current encoding |
| stat::video_len | a duration of encoded video |
| stat::fps_desired | desired level of frame rate |
| stat::fps_avg | average frame rate |
| stat::jitter | a jitter interval for frames processing |
| stat::max_time | a maximal time to process a frame |
| stat::min_time | a minimal time to process a frame |
| stat::avg_sync_offset | ------------------------- |
| stat::stddev_sync_offset | ------------------------- |
| stat::max_time_offset | ------------------------- |
| stat::min_time_offset | ------------------------- |
| stat::total::switch_count | the total number of switches between encodings |
| stat::total::path | a path to encode a content to |
| stat::total::server_pid | a PID of MServer.exe process of the current encoding |
| stat::total::start_time | a start time of the encoding |
| stat::total::frames | a total number of encoded frames |
| stat::total::breaks | a total number of breaks |
| stat::total::fps | a total frame rate of encoding |
| stat::total::video_time | a total encoding video time |
| stat::total::video_len | a total encoded video duration |
| stat::total::samples | a total number of encoded audio samples |
| stat::total::audio_time | a total number of encoded audio |
| stat::total::av_sync_time | a total difference between audio and video in msec |
| stat::total::av_sync_len | a total difference between audio and video |
| stat::last::server_pid | a PID of the last processed (if an encoding is running then the current one) MServer.exe process |
| stat::last::start_time | a start time of the last encoding |
| stat::last::frames | a total number of encoded frames during the last encoding |
| stat::last::breaks | a total number of breaks during the last encoding |
| stat::last::video_time | a total encoding video time during the last encoding |
| stat::last::video_len | a total encoded video duration during the last encoding |
| stat::last::samples | a total number of encoded audio samples during the last encoding |
| stat::last::audio_time | a total number of encoded audio during the last encoding |
| stat::last::av_sync_time | a total difference between audio and video in msec during the last encoding |
| stat::last::av_sync_len | a total difference between audio and video during the last encoding |
| encoder::muxer::stat | live-time statistics of the encoder's muxer |
| stat::cc_counters | a number of processed CC packets and SCTE triggers |
| stat::timecode | a time code on Writer input |
| stat::timecode_out | a time code on Writer output (taking into account the specified 'start_timecode' parameter) |
| stat::writer_backend_requested | the recording backend requested with the writer.engine property: legacy or xmedia (since version 2.12.0.15000) |
| stat::writer_backend_active | the recording backend that is actually used for the current file: legacy or xmedia |
| stat::writer_backend_fallback_reason | a reason code why the requested xmedia backend was not used (for example local_file_outputs_only or legacy_feature_not_supported); absent when no fallback happened |
| xmedia.last_stage | the pipeline stage where the XMedia backend last failed (for example pipeline.sink_start); absent when there was no failure |
| xmedia.last_hr | the HRESULT of the last XMedia backend failure |
Per-stream muxer statistics
The following table covers the confirmed encoder::muxer::stat::stream.N family exposed by the legacy FFmpeg muxer. These values are read-only diagnostics. Their presence depends on the active backend and on packets reaching the relevant processing stage.
Replace N with the muxer's stream index. It is not the subtitle configuration index or the configured stream_id. For example, subtitle.1 is the second configured subtitle track, but its muxer statistics may be under stream.3 when other streams precede it. Read the type field to identify the media type and codec; do not assume fixed video, audio, or subtitle indexes.
| Public property | Meaning | Type / units | Availability |
|---|---|---|---|
encoder::muxer::stat::stream.N.type |
Media type and codec associated with incoming packets for this stream. | String: media type followed by a dot and codec name. | Written when the stream receives a packet. |
encoder::muxer::stat::stream.N.rate_in |
Summary of intervals between incoming packets: average, minimum, maximum and jitter. | Formatted string; intervals in milliseconds, with a calculated packet frequency labelled fps. | Updated during packet processing. The frequency is not necessarily the video frame rate. |
encoder::muxer::stat::stream.N.kbps |
Calculated bitrate of incoming packet data for this stream. | Number; kilobits per second. | Updated during packet processing. |
encoder::muxer::stat::stream.N.pkt_size_kb |
Packet size summary: average, minimum, maximum and jitter. | Formatted string; decimal kilobytes, where 1 kB is 1,000 bytes. | Updated during packet processing. |
encoder::muxer::stat::stream.N.write |
Summary of packet write processing time: average, minimum, maximum and jitter. | Formatted string; milliseconds, with a calculated frequency labelled fps. | Updated when packet write processing completes. |
encoder::muxer::stat::stream.N.pts_before_muxing |
Presentation timestamp of the most recent packet submitted for muxing. | 64-bit integer represented as a string; stream time-base ticks, reduced modulo 8,589,934,592. | Written before the packet is submitted to the muxer. |
encoder::muxer::stat::stream.N.pts_after_muxing |
Presentation timestamp reported by the muxer's output packet callback. | 64-bit integer represented as a string; stream time-base ticks, reduced modulo 8,589,934,592. | Written when the output packet callback runs. |
encoder::muxer::stat::stream.N.subtitle_decode_errors |
Number of subtitle packets dropped after a subtitle transcoding failure. | 64-bit integer counter represented as a string; packets. | Subtitle transcoding path. Published after the first failure; it need not be present as zero before a failure. |
encoder::muxer::stat::stream.N.subtitle_decode_error_last |
Text describing the last subtitle transcoding failure. | Unicode string. | Subtitle transcoding path. Published after a failure and retained until another different error is reported or the relevant stream is recreated. |
Read muxer progress
Call this C# helper periodically while a supported writer is running. Pass the muxer stream index that you want to inspect. Error fields may be empty before any subtitle failure; these properties are published by the legacy FFmpeg backend of MWriter.
void ReadMuxerStreamStats(MWriterClass writer, int muxerStreamIndex)
{
string prefix = $"encoder::muxer::stat::stream.{muxerStreamIndex}.";
writer.PropsGet(prefix + "type", out string type);
writer.PropsGet(prefix + "pts_before_muxing", out string before);
writer.PropsGet(prefix + "pts_after_muxing", out string after);
writer.PropsGet(prefix + "subtitle_decode_errors", out string errors);
writer.PropsGet(prefix + "subtitle_decode_error_last", out string lastError);
Console.WriteLine($"{type}: before={before}, after={after}");
Console.WriteLine($"Subtitle errors={errors}: {lastError}");
}For ongoing video or audio, compare PTS observations over time. Repeatedly unchanged timestamps can indicate a stalled processing stage. PTS values are not seconds and may wrap, so do not require them to increase forever. Subtitle timestamps normally change only when subtitle packets are processed; a gap between cues is not by itself a stall.
Check the destination as well. Advancing muxer timestamps do not confirm network delivery, receiver decoding, or correct subtitle text.
Subtitle packet errors
When subtitle packet transcoding fails, the legacy muxer drops that packet, increments subtitle_decode_errors, and records subtitle_decode_error_last. Processing can continue for subsequent packets and the other streams. The affected subtitle cue may be missing even while video and audio continue.
This handling applies to failures during packet transcoding. It does not guarantee recovery from invalid writer configuration or failure to initialize a subtitle converter.
- Identify the affected subtitle stream and read its error counter and last error text.
- Check the input subtitle file's encoding and contents. A text decoding error can result from a non-UTF-8 file being interpreted with the wrong encoding.
- Compare video and audio PTS before and after muxing while those streams are active.
- Check the receiver for continuing video and audio and for the expected subtitle cues.
Configure the input subtitle text encoding
Prefer UTF-8 for external SRT or ASS files. If a text subtitle track uses another encoding, configure that encoding in the writer's subtitle track options before starting the writer.
subtitle::sub_charenc is a configurable string naming the input text encoding, for example 'CP1251'. For another track, use its indexed prefix, such as subtitle.1::sub_charenc. This setting controls input text decoding during subtitle transcoding; language metadata and Teletext output character sets serve different purposes.
For example, add the following fragment to the complete writer configuration when the second input subtitle track contains Windows-1251 text and is encoded as bitmap DVB subtitles:
subtitle.1::codec='dvbsub'
subtitle.1::sub_charenc='CP1251'Pass the complete configuration, including format, video/audio settings, and subtitle track mapping, to WriterNameSet. Keep subtitle.1::stream_id matched to the corresponding input subtitle stream as explained in How to Insert ASS and SRT Subtitles as DVB, DVB Teletext. That guide also covers external subtitle attachment, multiple tracks, language metadata, formatting and Teletext character sets.
The subtitle transcoding path described here requires a 64-bit application using the legacy FFmpeg writer implementation. The encoding option is used when input subtitle packets are decoded and converted to another subtitle codec; it does not change packets copied without subtitle decoding.
Still have questions?
Tell us what didn’t work or what you’d like clarified.