[FFmpeg-user] MP4 from MXP - Material Package Only

DeBacker, Bart Bart.Debacker at turner.com
Fri Feb 22 18:39:12 EET 2019

´╗┐On 2/20/19, 11:36 PM, "DeBacker, Bart" <Bart.Debacker at turner.com> wrote:

    On 2/20/19, 6:06 PM, "ffmpeg-user on behalf of Carl Eugen Hoyos" <ffmpeg-user-bounces at ffmpeg.org on behalf of ceffmpeg at gmail.com> wrote:
        2019-02-20 21:15 GMT+01:00, DeBacker, Bart <Bart.Debacker at turner.com>:
        > On 2/19/19, 2:15 PM, "ffmpeg-user on behalf of Carl Eugen Hoyos"
        >> 2019-02-18 22:53 GMT+01:00, Marton Balint <cus at passwd.hu>:
        >> >
        >> > On Mon, 18 Feb 2019, DeBacker, Bart wrote:
        >> >> I grabbed the latest snapshot and see the same behavior.  I don't
        >> >> think this is really a bug, since the frames exist and are valid, but
        >> >> the MXF metadata is specifying a start time that is a few frames
        >> >> in and I would like the MP4 to match that.  Hoping there is a flag
        >> >> I am missing.
        >> > I am afraid there is no magic option in ffmpeg to fix this at the
        >> > moment.
        >> Do we have such a sample?
        > Let me know if there is a better place to put these, but for now
        > I shared via DropBox.
        > Here is the hires file:
        > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_1ayniyk2c2vst3q_hires.mxf&d=DwIGaQ&c=W8uiIUydLnv14aAum3Oieg&r=aerhCAdngbrokymnbwblqp9K3ANfkoN5gSBjxf80t0U&m=eHX85AHQvBN_-60zzWasfP4uYiuEEk2ruLbZAuOnDHg&s=5F7qByydkP66k-2HJIFwopLISL2pf_skMT4LQIzc3X4&e=
        Thank you!
        Do we also know which "tag" (if this is the correct mxf term) we ignore?
        Carl Eugen
    I believe the 'Origin' key should be used.
    "Origin: The number of Edit Units of a Track which exist before the Zero Point of a Timeline Track. A positive
    value shall indicate that the Timeline Track starts before the Zero Point of the Package. A negative value shall
    indicate that the Timeline Track starts after the Zero Point of the Package."

In case someone else has the same issue, for now we are using the 'mediainfo' CLI tool to extract the various Timecodes.  We then process these to Timecodes to get an offset and pass that into ffmpeg with the '-ss' flag:

This is the MediaInfo call we use and our tool is Javascript so we parse the output and calculate the different in seconds.

mediainfo --Inform="Other;%Format%:%TimeCode_FirstFrame%|" hires.mxf
MXF TC:13:42:58;09|MXF TC:13:42:58;09|SMPTE TC:13:42:58;06|

Our ffmpeg call then looks like this (this was 3 frames off at 29.97 FPS):

ffmpeg -i hires.mxf  -s 960x540  -ss 0.1001 lores.mp4

Note that for growing MXF we have to put the seek argument after the input or we have issue.


More information about the ffmpeg-user mailing list