From: Joseph A. <jo...@mi...> - 2012-11-21 12:50:21
|
On 21/11/2012 10:18, Burkhard Plaum wrote: > ... > > > I would make it depend on the codec_id because it also applied to IMX. > For CODEC_ID_MPEG2VIDEO (and probably others) set time_base to the framerate > like you did earlier, and increase PTS by one for each frame. > > Just found this snippet in my other libavcodec frontend: > > static void set_framerate(ffmpeg_video_stream_t * st) > { > if(st->format.framerate_mode == GAVL_FRAMERATE_CONSTANT) > { > st->stream->codec->time_base.den = st->format.timescale; > st->stream->codec->time_base.num = st->format.frame_duration; > } > else > { > st->stream->codec->time_base.den = st->format.timescale; > st->stream->codec->time_base.num = 1; > } > } Are you proposing making time_base.num = 1 for everything but CODEC_ID_MPEG2VIDEO? I think that would cause problems with other codecs. For instance, ffmpeg's dnxhd encoder chooses encoding profile by matching bitrate, frame rate and frame size. What I was proposing is introducing a pts divisor/multiplier that will be 1 except for XDCAM, where it will be equal to time scale. -- Joseph Artsimovich Senior C++ Applications Developer MirriAd Ltd |