[FFmpeg-devel] [PATCH v2] lavf/mxfenc: support creating s436m data tracks

Marton Balint cus at passwd.hu
Thu Jul 5 01:54:18 EEST 2018


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


More information about the ffmpeg-devel mailing list