Re: [FFmpeg-devel] [PATCH v2] lavf/mxfenc: support creating s436m data tracks
On Mon, Sep 24, 2018 at 1:55 PM Baptiste Coudurier < baptiste.coudur...@gmail.com> wrote: > On Thu, Jul 19, 2018 at 2:32 PM Michael Niedermayer > wrote: > >> On Wed, Jul 04, 2018 at 03:06:54PM -0700, Baptiste Coudurier wrote: >> > --- >> > libavformat/mxf.c| 1 + >> > libavformat/mxfdec.c | 2 ++ >> > libavformat/mxfenc.c | 41 + >> > libavformat/utils.c | 6 +- >> > 4 files changed, 45 insertions(+), 5 deletions(-) >> [...] >> > diff --git a/libavformat/utils.c b/libavformat/utils.c >> > index c9cdd2b470..36a32ad9c2 100644 >> > --- a/libavformat/utils.c >> > +++ b/libavformat/utils.c >> > @@ -1003,6 +1003,10 @@ FF_ENABLE_DEPRECATION_WARNINGS >> > *pnum = frame_size; >> > *pden = sample_rate; >> > break; >> > +case AVMEDIA_TYPE_DATA: >> > +*pnum = st->time_base.num; >> > +*pden = st->time_base.den; >> > +break; >> > default: >> > break; >> > } >> > @@ -1405,7 +1409,7 @@ static void compute_pkt_fields(AVFormatContext >> *s, AVStream *st, >> > presentation_delayed, delay, av_ts2str(pkt->pts), >> av_ts2str(pkt->dts), av_ts2str(st->cur_dts)); >> > >> > /* update flags */ >> > -if (is_intra_only(st->codecpar->codec_id)) >> > +if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || >> is_intra_only(st->codecpar->codec_id)) >> > pkt->flags |= AV_PKT_FLAG_KEY; >> > #if FF_API_CONVERGENCE_DURATION >> > FF_DISABLE_DEPRECATION_WARNINGS >> >> This should be a seperate patch. >> Also i think forcing duration=1 is not correct for all AVMEDIA_TYPE_DATA >> for example there are ID3 and fonts. These would i guess if they have a >> timebase set apply to more than 1 "unit" >> > > I applied the separate patch. > Will apply this patch shortly, addressing Marton comment. > > Thanks! > Applied. -- Baptiste Coudurier ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] lavf/mxfenc: support creating s436m data tracks
On Thu, Jul 19, 2018 at 2:32 PM Michael Niedermayer wrote: > On Wed, Jul 04, 2018 at 03:06:54PM -0700, Baptiste Coudurier wrote: > > --- > > libavformat/mxf.c| 1 + > > libavformat/mxfdec.c | 2 ++ > > libavformat/mxfenc.c | 41 + > > libavformat/utils.c | 6 +- > > 4 files changed, 45 insertions(+), 5 deletions(-) > [...] > > diff --git a/libavformat/utils.c b/libavformat/utils.c > > index c9cdd2b470..36a32ad9c2 100644 > > --- a/libavformat/utils.c > > +++ b/libavformat/utils.c > > @@ -1003,6 +1003,10 @@ FF_ENABLE_DEPRECATION_WARNINGS > > *pnum = frame_size; > > *pden = sample_rate; > > break; > > +case AVMEDIA_TYPE_DATA: > > +*pnum = st->time_base.num; > > +*pden = st->time_base.den; > > +break; > > default: > > break; > > } > > @@ -1405,7 +1409,7 @@ static void compute_pkt_fields(AVFormatContext *s, > AVStream *st, > > presentation_delayed, delay, av_ts2str(pkt->pts), > av_ts2str(pkt->dts), av_ts2str(st->cur_dts)); > > > > /* update flags */ > > -if (is_intra_only(st->codecpar->codec_id)) > > +if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || > is_intra_only(st->codecpar->codec_id)) > > pkt->flags |= AV_PKT_FLAG_KEY; > > #if FF_API_CONVERGENCE_DURATION > > FF_DISABLE_DEPRECATION_WARNINGS > > This should be a seperate patch. > Also i think forcing duration=1 is not correct for all AVMEDIA_TYPE_DATA > for example there are ID3 and fonts. These would i guess if they have a > timebase set apply to more than 1 "unit" > I applied the separate patch. Will apply this patch shortly, addressing Marton comment. Thanks! -- Baptiste ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] lavf/mxfenc: support creating s436m data tracks
On Wed, Jul 04, 2018 at 03:06:54PM -0700, Baptiste Coudurier wrote: > --- > libavformat/mxf.c| 1 + > libavformat/mxfdec.c | 2 ++ > libavformat/mxfenc.c | 41 + > libavformat/utils.c | 6 +- > 4 files changed, 45 insertions(+), 5 deletions(-) [...] > diff --git a/libavformat/utils.c b/libavformat/utils.c > index c9cdd2b470..36a32ad9c2 100644 > --- a/libavformat/utils.c > +++ b/libavformat/utils.c > @@ -1003,6 +1003,10 @@ FF_ENABLE_DEPRECATION_WARNINGS > *pnum = frame_size; > *pden = sample_rate; > break; > +case AVMEDIA_TYPE_DATA: > +*pnum = st->time_base.num; > +*pden = st->time_base.den; > +break; > default: > break; > } > @@ -1405,7 +1409,7 @@ static void compute_pkt_fields(AVFormatContext *s, > AVStream *st, > presentation_delayed, delay, av_ts2str(pkt->pts), > av_ts2str(pkt->dts), av_ts2str(st->cur_dts)); > > /* update flags */ > -if (is_intra_only(st->codecpar->codec_id)) > +if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || > is_intra_only(st->codecpar->codec_id)) > pkt->flags |= AV_PKT_FLAG_KEY; > #if FF_API_CONVERGENCE_DURATION > FF_DISABLE_DEPRECATION_WARNINGS This should be a seperate patch. Also i think forcing duration=1 is not correct for all AVMEDIA_TYPE_DATA for example there are ID3 and fonts. These would i guess if they have a timebase set apply to more than 1 "unit" [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] lavf/mxfenc: support creating s436m data tracks
Hi Marton, Yes, changed. Michael, are you OK with the utils.c changes ? To be able to remux data tracks. Thanks! -- Baptiste Coudurier ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] lavf/mxfenc: support creating s436m data tracks
On Wed, 4 Jul 2018, Baptiste Coudurier wrote: --- libavformat/mxf.c| 1 + libavformat/mxfdec.c | 2 ++ libavformat/mxfenc.c | 41 + libavformat/utils.c | 6 +- 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 8376a2b9bf..451cbcfb2c 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -28,6 +28,7 @@ const MXFCodecUL ff_mxf_data_definition_uls[] = { { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_VIDEO }, { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_AUDIO }, +{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x03,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_DATA }, { { 0x80,0x7D,0x00,0x60,0x08,0x14,0x3E,0x6F,0x6F,0x3C,0x8C,0xE1,0x6C,0xEF,0x11,0xD2 }, 16, AVMEDIA_TYPE_VIDEO }, /* LegacyPicture Avid Media Composer MXF */ { { 0x80,0x7D,0x00,0x60,0x08,0x14,0x3E,0x6F,0x78,0xE1,0xEB,0xE1,0x6C,0xEF,0x11,0xD2 }, 16, AVMEDIA_TYPE_AUDIO }, /* LegacySound Avid Media Composer MXF */ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AVMEDIA_TYPE_DATA }, diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index b76beb962f..575126d639 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -3299,6 +3299,8 @@ static int mxf_set_pts(MXFContext *mxf, AVStream *st, AVPacket *pkt) return ret; } else if (track) { track->sample_count++; +pkt->dts = pkt->pts = track->sample_count; +pkt->duration = 1; You probably need to set pts before increasing sample_count. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel