From: Burkhard P. <pl...@ip...> - 2012-11-22 10:19:15
|
Hi, Am 21.11.2012 13:50, schrieb Joseph Artsimovich: > 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? For everything which supports variable framerates. > 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. I think for DV it's the same. This would mean that at least dnxhd, DV and MPEG-2 are constant frame rate while most others might be more flexible. Burkhard |