To transcode a file or a playlist with MWriter object, or a file with MFWriter object, you should process the frames the fastest way.
MPlatform SDK
You should initialize your source (e.g. fill a playlist with files), and disable active frame rate control for the source object:
m_objPlaylist.PropsSet("active_frc", "false");
Make sure that a source file or playlist is not in a loop state:
m_objPlaylist.PropsSet("loop", "false");
If you use a preview, you should allow drop frames on a preview, so the preview could skip frames during a playback:
m_objPlaylist.PropsSet("preview.drop_frames", "true");
And it is the encoder which should control the frame rate:
m_objWriter.PropsSet("rate_control", "true");
m_objWriter.PropsSet("pull_mode", "false");
Once the encoding is configured, you start the encoding and playback at the same time. For this, you should set a playlist position to 0:
m_objPlaylist.PlaylistPosSet(0, 0, 0)
then start the MWriter object:
m_objWriter.ObjectStart(m_objPlaylist);
and only after this, start the playlist:
m_objPlaylist.FilePlayStart();
To properly stop the encoding, you should listen to EOL event for your MPlaylist object and close the MWriter once "EOL" event is raised:
void m_objPlaylist_OnEventSafe(string bsChannelID, string bsEventName, string bsEventParam, object pEventObject)
{
if (bsEventName != "EOL") return;
try
{
m_objWriter.ObjectClose();
}
catch { }
}