2009-04-27, 11:20
I've almost finished commercial skip support for myth://. The last confusing part is converting from the frame offsets stored in MythTV to time offsets for XBMC.
I'm using the following code to get the FPS of the video to then use for the conversion from frame markers to time. For some test files this code is returning 50.000 FPS. However, after comparing the frame markers to the time that the commercial breaks are being skipped to when using mythfrontend, MythTV seems to have used 25.000 FPS.
The following is the code snippet I'm using within DVDPlayer.cpp
Have I misunderstood what the iFpsRate and iFpsScale fields hold, or is something else fishy going on. MythTV seems to think the content is 25 FPS. ffmpeg seems to think it's 50 FPS.
I'm using the following code to get the FPS of the video to then use for the conversion from frame markers to time. For some test files this code is returning 50.000 FPS. However, after comparing the frame markers to the time that the commercial breaks are being skipped to when using mythfrontend, MythTV seems to have used 25.000 FPS.
The following is the code snippet I'm using within DVDPlayer.cpp
Code:
double dFramesPerSecond = 25.0; // Default to 25 FPS if demux stream is not available.
CDemuxStream* pStream = m_pDemuxer->GetStream(m_CurrentVideo.id);
if (pStream && pStream->type == STREAM_VIDEO)
{
CDemuxStreamVideo* pVideoStream = (CDemuxStreamVideo*)pStream;
if (pVideoStream->iFpsRate && pVideoStream->iFpsScale)
dFramesPerSecond = (double)pVideoStream->iFpsRate / (double)pVideoStream->iFpsScale;
}
Have I misunderstood what the iFpsRate and iFpsScale fields hold, or is something else fishy going on. MythTV seems to think the content is 25 FPS. ffmpeg seems to think it's 50 FPS.