ApPojken
9th August 2010, 18:03
Hi all,
I am writing a mp4/mov rewrapper (and possibly mux functionality). I got everything working but the 'ctts' atom (Composition Time to Sample Box). Currently, I am not inserting it which means that the playback of my rewapped 12-gop mpeg2 video is very stuttery.
I have been Googling for a couple of days but I can now confess that I am stuck. Can anyone explain how exactly this one works and how I should be inserting it? (Explain like I was a baby) ...or point to somewhere where I can read in fine detail.
The mp4 spec states "This box provides the offset between decoding time and composition time". Got it but the next line I don't get: "Since decoding time must be less
than the composition time, the offsets are expressed as unsigned numbers such that CT(n) = DT(n) +
CTTS(n) where CTTS(n) is the (uncompressed) table entry for sample n."
The ctts table in the mp4 looks like this:
Sample Count = 1, Offset = 3000
Sample Count = 2, Offset = 0
...repeated a lot of times
The ctts table in the Quicktime looks like this when properly rewrapped:
Sample Count = 1, Offset = 200
Sample Count = 2, Offset = -100
...repeated the same amount of times..
Why are they so different from eachother? The video content is identical in the mdat atom. ...and how can I translate one to the other when rewrapping? :confused:
I am writing a mp4/mov rewrapper (and possibly mux functionality). I got everything working but the 'ctts' atom (Composition Time to Sample Box). Currently, I am not inserting it which means that the playback of my rewapped 12-gop mpeg2 video is very stuttery.
I have been Googling for a couple of days but I can now confess that I am stuck. Can anyone explain how exactly this one works and how I should be inserting it? (Explain like I was a baby) ...or point to somewhere where I can read in fine detail.
The mp4 spec states "This box provides the offset between decoding time and composition time". Got it but the next line I don't get: "Since decoding time must be less
than the composition time, the offsets are expressed as unsigned numbers such that CT(n) = DT(n) +
CTTS(n) where CTTS(n) is the (uncompressed) table entry for sample n."
The ctts table in the mp4 looks like this:
Sample Count = 1, Offset = 3000
Sample Count = 2, Offset = 0
...repeated a lot of times
The ctts table in the Quicktime looks like this when properly rewrapped:
Sample Count = 1, Offset = 200
Sample Count = 2, Offset = -100
...repeated the same amount of times..
Why are they so different from eachother? The video content is identical in the mdat atom. ...and how can I translate one to the other when rewrapping? :confused: