video-streamingmp4mpeg-dashmp4parserfmp4

How to make video to start(decode) at specific time?(base media decode time)


I would like to make a video(fragmented mp4) to start at specific time.

For example, if the fragmented video segment is for 4sec timestamp, I would like the video(fmp4) to start at 4sec and no video before that time.

I think 'base media decode time' in moof/traf/tfdt atom path is the time when the fmp4 actually starts and I searched how to change the field but there was no information.

My question is,

Is there any way or tool to achieve what I need?


Solution

  • I've solved the problem by myself and posting the solution just for someone who has same problem like me.

    What I did was just read the video atom file in binary format. In fragmented video atoms, there are several header fields. Each field has its name, size and data.

    You can read the file in binary format and using the size of each field as offsets, you can easily read and write or modify the data of any field.

    I did simply with few lines of python code.

    In addition, if you change the 'base media decode time', you can make the video play at the specific time you want.