video - Debugging an MP4 opened by VLC but not by ffplay -


i'm writing code creates mp4 files. check i've created mp4 file.

the file played correctly vlc , firefox, not ffplay or chrome. guess file contains error vlc can cope more aggressive mp4 reader cannot.

i've thought repairing file , check differences fix code. tried programs repair mp4 files, without success until now.

can reccommend way debug problem, or tool fix mp4 files? file fragmented mp4 contains both init section (ftyp, moov boxes) , 1 fragment section (moof , empty sidx).

here video file:

https://www.dropbox.com/s/rojxzvkfxfj31u8/400k00001-3_serialized.mp4?dl=0

edit: doesn't work in firefox, when using media source extensions in example: http://people.mozilla.org/~jyavenard/tests/mse_mp4/paper.html

(don't forget enable mse on firefox, explained here: http://www.linuxveda.com/2015/04/02/enable-mse-native-html5-support-firefox-linux/)

edit2: in chrome://media-internals, see following error above example: append: stream parsing failed. data size=131072 append_window_start=0 append_window_end=inf

(change url file , change codec 'avc1.4d401f' instead of 'avc1.64000d,mp4a.40.2').

finally solved problem fixing errors in file. here fixes if encounters similar problems:

  • duration in mvhd box should zero.
  • mehd box should contained in mvex box. mehd box contains fragment_duration field.
  • sample_flags (in trex box) should 6 reserved msbits should '1' instead of '0'.
  • volume field in tkhd box should 0 instead of 1 (1 audio).
  • dimensions wrong, both in tkhd , stsd boxes.
  • codec parameters in avcc box wrong. same error third comment in: https://stackoverflow.com/a/11869227/2463642. see answer correct parsing: html5 video tag codecs attribute
  • mfhd contained sequence_number of zero. should start 1.
  • tfdt box missing. should contained in traf box , indicate base_media_decode_time of each fragment.
  • trun missing data_offset field. caused ffmpeg think data starts @ beginning of moof box.
  • sample_flags wrong in trun box. samples marked "difference frame", no key frame start at... here explanation flags: https://msdn.microsoft.com/en-us/library/ff469599.aspx

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -