Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1512,9 +1512,14 @@ namespace TwkMovie
{
AVRational tcRate = {tsStream->time_base.den, tsStream->time_base.num};

if (isMOVformat(formatContext))
bool isMxf = formatContext && formatContext->iformat && formatContext->iformat->name
&& strstr(formatContext->iformat->name, "mxf") != nullptr;
if (isMOVformat(formatContext) || isMxf)
{
tcRate = tsStream->avg_frame_rate;
if (tsStream->avg_frame_rate.num > 0 && tsStream->avg_frame_rate.den > 0)
{
tcRate = tsStream->avg_frame_rate;
}
}

return tcRate;
Expand Down Expand Up @@ -1581,7 +1586,11 @@ namespace TwkMovie
for (unsigned int s = 0; s < m_avFormatContext->nb_streams; ++s)
{
AVStream* tsStream = m_avFormatContext->streams[s];
tcRate = getTimecodeRate(tsStream, m_avFormatContext);
if (tsStream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
{
tcRate = getTimecodeRate(tsStream, m_avFormatContext);
break;
}
}
AVTimecode avTimecode;
av_timecode_init_from_string(&avTimecode, tcRate, fmtTcEntry->value, m_avFormatContext);
Expand Down
Loading