[FFmpeg-devel] Cannot remux a MXF file to Mpegts

Michael Niedermayer michaelni at gmx.at
Sat Mar 31 09:50:19 CEST 2012

On Fri, Mar 30, 2012 at 08:38:07PM -0700, Thierry Foucu wrote:
> Hello,
> When trying to remux a MXF file to Mpeg2Ts and we found out that the mpegts
> muxer require the first frame to have a valid  PTS
> How ever, the MXF demuxer will set only the DTS for video frame. And so, we
> cannot remux a MXF file to M2TS.
> You can duplicate the problem by this simple command and using one of your
> fate MXF sample file.
> ./ffmpeg -i  fate_sample/mxf/C0023S01.mxf -vcodec copy -acodec copy
>  /tmp/test.ts
> ....
> [mpegts @ 0x12be140] first pts value must set
> av_interleaved_write_frame(): Operation not permitted
> I'm not sure if this is the right solution, but by applying this change
> (patch at the end of this email) , we can then remux a MXF file to Mpeg2Ts.
> Or should we fix the MXF demuxer to set a PTS?
> What do you think if the right approach to fix the problem?

mpegts needs pts (or something from which pts can be calculated)
you can use "-fflags +genpts" to force pts calculation but this will
only work reliably with pre H.264 style codecs. Also genpts will
introduce a few frames delay.

If posible it would be best if the mxf demuxer could set pts, if there
is a way to do it, like by using some constant framerate knowledge.
Iam CC-ing this to our mxf maintainer, he should be able to give us
a definite awnser if there is sufficient information in the mxf file
or not to set pts correctly

as a 3rd option one could just store something random like done in the
patch but the mpegts files would then not be standard compliant except
by pure chance and would likely not play correctly on all players.
Also i think its better not to create/spread files that arent
spec compliant ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120331/7a69b86d/attachment.asc>

More information about the ffmpeg-devel mailing list