[FFmpeg-user] Error with mp4 files moov atom (\moov\trak\mdia\minf\stbl\sgpd)

Karen Norton nortok00 at gmail.com
Fri Dec 14 00:03:00 EET 2018

On Thu, Dec 13, 2018 at 3:40 PM Moritz Barsnick <barsnick at gmx.net> wrote:

> Hi Karen,
> On Thu, Dec 13, 2018 at 15:04:15 -0500, Karen Norton wrote:
> > I only see the error when opening the output files with MP4 Inspector
> > otherwise the files play fine (ex: in VLC) and show no issues in
> > mediainfo.
> So basically, it's not an issue at all, *except* for MP4 Inspector?
> > I wouldn't have even know this was an issue because everything appears
> fine
> > with V90893. I only discovered this because I just downloaded MP4
> Inspector
> > to try.
> See what I mean. ;-)
> > The exact error in MP4 Inspector is:
> > Failed on reading box header, parent box path
> > "\moov\trak\mdia\minf\stbl\sgpd", stream position "0x1C7362678B6399",
> > reason "The box size 0 exceeds the remaining file length
> > -8,008,165,506,864,740." (I have attached a screenshot of the error).
> I don't want to seem rude - but why would you trust a tool which
> reports negative file sizes?
> In other words: Why should MP4 Inspector be more correct than ffmpeg?
> Perhaps they have a bugfix release? ;-)
> Now, seriously:
> > ffmpeg 90893 (not working in MP4 Inspector):
> > Command: ffmpeg -i inputs01e01.mp4 -metadata media_type="10" -metadata
> > title="Law & Order" -metadata show="Prescription For Death" -metadata
> > season_number="1" -metadata genre="Crime, Drama, Mystery" -metadata
> > episode_id="66209" -metadata episode_sort="1" -metadata:s:a:0
> language=eng
> > -c:v libx264 -vf hflip -c:a copy outputs01e01.mp4
> Can you create such files ("broken" for MP4 Inspector) with arbitrary
> input? I.e. with
> $ ffmpeg -f lavfi -i testsrc -t 1 -c:v libx264 output.mp4
> Or does it depend on your particular input?
> Too bad MP4 Inspector doesn't run under Wine, otherwise I'd try to
> reproduce...
> Cheers,
> Moritz

Hey Moritz,

Thanks for the speedy reply. I guess I should have said that this isn't
necessarily an ffmpeg issue it's just that ffmpeg N-85588 seems to fix that
atom (whether it's supposed to or not) but N-90893 doesn't so I'm curious
as to what has changed between the versions in so far as how the moov atom
is handled or is the error not even moov related?

It's hard for me to know exactly what is going on with the broken files
because MP4 Inspector won't even open them. In the few tests I ran with
different files where the input file already has the error I found that all
of them still have the error in the output file using N-90893. If I take
the same input files and run the same command under N-85588 then the moov
atom seems to be fixed and the output files open fine in MP4 Inspector.

I have only recently started going deep into video files to understand how
they are constructed and it was recommended in some posts on other forums
that MP4 Inspector is a good app to see the innards of the files which is
why I started to use it. There was another app that was mentioned in the
forums called atomic parsley. I haven't tried that yet.

You  mentioned whether I can create broken files. I'm assuming I was
supposed to try that command line exactly as you provided? If so the output
file opens fine when created under N-90893.



More information about the ffmpeg-user mailing list