Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: Merging multiple MP4 H264 encoded files with camera_api and Qt

Okay then.. yah, it was pointed out that I may have not answered your question, so wanted to confirm with you first.

The clarification for the inter-frame delta I got was:

 

He seems to be referring to my 'stts' recommendation where I told him he can consider adding a small time delta in between the two clips.  This was only a minor optimization I was suggesting where he could insert a fixed amount of time such that the first frame of the next segment does not play almost immediately after the last frame of the previous segment.  The amount to add would depend on his programmed frame rate.  Assuming he is doing 30 fps, you need to add roughly 33 ms which is 1600 in terms of 48000 timeScale (moov.mvhd.timeScale); but he is free to add as much as he wants if wants extra time in between the different segments.  Note that he does not need to make this change as most likely no one would notice the difference unless you play it out at really slow motion.

 

If you want us to take a look at new clips, please start a new folder on dropbox.. that old one is getting crowded Smiley Happy

 

Although, speak of the devil.. looks like Christian may have found the clip anyhow:

 

Quickly looked at his new clip and found that his 'stss' still does not look sane:

      type stss (moov.trak.mdia.minf.stbl.stss)
       version = 0 (0x00)
       flags = 0 (0x000000)
       entryCount = 7 (0x00000007)
        sampleNumber = 1 (0x00000001)
        sampleNumber[1] = 31 (0x0000001f)
        sampleNumber[2] = 32 (0x00000020)
        sampleNumber[3] = 62 (0x0000003e)
        sampleNumber[4] = 43 (0x0000002b)
        sampleNumber[5] = 73 (0x00000049)
        sampleNumber[6] = 103 (0x00000067)

They should not go backwards like this, should always be increasing values.  I did not look at the segments to figure out what it should be, but I do know that this looks wrong.

 

Cheers,

Sean

Highlighted
Developer
Posts: 147
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: Bonbon

Re: Merging multiple MP4 H264 encoded files with camera_api and Qt

OK, all clear on inter-frame delta. Smiley Happy

Right... I'll check STSS again, I was overexcited when this merger class was finally working so I probably made a mistake. Those really shouldn't go backwards. Smiley Very Happy

 

I'll report back in 12 hours. Celebration is ongoing now, you put me out of my misery after a month of learning MP4 structure and 1400 lines of code. 

 

What, can I say besides thank you. 

Will report back soon. Smiley Very Happy

BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: Merging multiple MP4 H264 encoded files with camera_api and Qt

hey, learning all about mp4 is not wasted effort at least Smiley Happy

you'll be well set up to do almost any approach you want now!

 

Cheers,

Sean

Developer
Posts: 147
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: Bonbon

Re: Merging multiple MP4 H264 encoded files with camera_api and Qt

I can confirm all is well now. Finally Smiley Very Happy

Fixed all offsets and merging is a success every time.

Because of the chop bug, I'll have to work with mdats only, but that will be implemented in a near future update.

Thanks million times. Smiley Happy

BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: Merging multiple MP4 H264 encoded files with camera_api and Qt

awesome!