Skip to content

Commit

Permalink
[muxerMp4] Set average frame rate to fix too short video track durati…
Browse files Browse the repository at this point in the history
…on in the edit list
  • Loading branch information
eumagga0x2a committed Oct 13, 2022
1 parent 3946881 commit 43eb004
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion avidemux_plugins/ADM_muxers/muxerMp4/muxerMP4.cpp
Expand Up @@ -211,7 +211,18 @@ bool MOVCLASS::open(const char *file, ADM_videoStream *s, uint32_t nbAudioTrack,
}else
rescaleFps(s->getAvgFps1000(),&(c->time_base));
myTimeBase=video_st->time_base=c->time_base;
ADM_info("Video stream time base :%d,%d\n",video_st->time_base.num,video_st->time_base.den);
// set average frame rate else the track duration in the edit list may be too short
rescaleFps(s->getAvgFps1000(), &video_st->avg_frame_rate);
// swap numerator and denominator
if(video_st->avg_frame_rate.num && video_st->avg_frame_rate.den)
{
int den = video_st->avg_frame_rate.num;
video_st->avg_frame_rate.num = video_st->avg_frame_rate.den;
video_st->avg_frame_rate.den = den;
}
ADM_info("Video stream time base :%d / %d, average frame rate: %d / %d\n",
video_st->time_base.num, video_st->time_base.den,
video_st->avg_frame_rate.num, video_st->avg_frame_rate.den);
c->gop_size=15;

if(true==muxerConfig.forceAspectRatio)
Expand Down

0 comments on commit 43eb004

Please sign in to comment.