I’m trying to set the framerate of the media player so the frames sync up.
Here’s what I have so far:
for (UMediaPlayer* MediaPlayer : MediaPlayers)
{
if (!Streams[i].is360) {
FString Fs = FString(UTF8_TO_TCHAR(Streams[i].full_url.c_str()));
MediaPlayer->OpenUrl(
Fs
);
FTimespan range = MediaPlayer->GetDuration();
FTimespan delay = FTimespan(0, 0, 0,0,400);
FIntPoint dimensions = MediaPlayer->GetVideoTrackDimensions(INDEX_NONE, INDEX_NONE);
FIntPoint dimensions2 = MediaPlayer->GetVideoTrackDimensions(2, 0);
MediaPlayer->SetVideoTrackFrameRate(0, 1,Streams[i].fps);
MediaPlayer->SetVideoTrackFrameRate(0, 0, Streams[i].fps);
MediaPlayer->SetVideoTrackFrameRate(1, 1, Streams[i].fps);
MediaPlayer->SetVideoTrackFrameRate(1, 0, Streams[i].fps);
MediaPlayer->SetTimeDelay(delay);
}
//MediaPlayer->Play();
i = (i + 1 )% streamLength;
}
I’m assuming the track is the one provided by ffmpeg, and the type is audio for 0 and video for 1. I’m not sure, I can’t find documentation on the Track Type or the other one.
Help on setting the frame rate would be appreciated - so the frames play with the audio. I’m using VLCMediaPlayer Plugin on an RMTP stream.