Log in

View Full Version : Are my mp4 files standard compilant?


wereHamster
20th June 2006, 10:01
I have raw YUV images stored together with their timestamps in my own file format (each fram is simply a 64bit timestamp followed by YUV420P image data). I hacked a x264 demuxer for my files and I'm storing the video in lossless mode (--qp 0) in mp4 files. But, since my sources contain VFR video, I had to hack the mp4 muxer in x264 to produce correct timestamps. Correct only as far as I can test with mplayer, WMP, vlc and totem.

How can I test if my timestamps are indeed correct? I'm using 'MP4Box -dts' to dump the timestamps, that sometimes shows me errors, but I'm not quite sure if no errors means standard compilant.

With the timestamps, I make no difference when encoding with or without B-Frames. That means my mp4 containers will have a CTS offset table even if the stream doesn't contain any B-Frames. the CTS are simply shifted by one frame time. If the stream really contains B-Frames I think my timestamps are correct, but before deleting the raw sources I'd like to be sure that they really are.

Until I'll have the chance to upload the mp4 video files to my server, you could tell me what tools you use to check the validity of mp4 files and what I should look for. :)

here they are:
http://www.dbservice.com/ftpdir/tom/clip-bframes.mp4
http://www.dbservice.com/ftpdir/tom/clip-no-bframes.mp4

I'll also try to post the C code I'm using in x264 for review ;) .. here it is:
http://www.dbservice.com/ftpdir/tom/x264.c
of course, the last few frames in the buffer are flushed before I close the file.

bond
21st June 2006, 23:20
if mp4box -dts shows you errors your file is not correct

wereHamster
22nd June 2006, 07:21
if mp4box -dts shows you errors your file is not correct

I know that.. my question was: If mp4box doesn't shows any errors, does that mean my file IS standard compilant?

bond
22nd June 2006, 18:44
I know that.. my question was: If mp4box doesn't shows any errors, does that mean my file IS standard compilant?no, when using -dts mp4box checks whether the times set in the file are correct. you can propably also have an incompliant file when f*ing up something else than the times

wereHamster
22nd June 2006, 20:59
you can propably also have an incompliant file when fucking up something else than the times

I only changed the timestamp code.. so I guess I am on the safe side now ;)