<p>If I understand you correctly, you want the MOOV atom to be stored at the end of the MP4 (after the media payload). If so, this is the typical scheme used by ffmpeg unless flagged otherwise. So, copy your current MP4 into a new container via ffmpeg:</p>

<pre><code>ffmpeg -i input.mp4 -c copy output.mp4
</code></pre>

CC BY-SA 3.0
2015-11-19T09:13:36.527Z
At first,thanks ! And I know how bad my English is :).
aicco
CC BY-SA 3.0
2015-11-19T09:15:45.803Z
Your answer help me.And I also want to know can I move the media payload to another file? I mean 1.mp4 only contains metadata and 2.mp4 only stores media payload. If I can, is there a tool?
aicco
CC BY-SA 3.0
2015-11-19T09:50:16.610Z
Let me clarify: some of the metadata is related to the data structure of the payload in the file i.e. chunk offsets and the like, for the media player to map out the media itself. And then there's information stored like a rotation flag or XMP fields..etc These latter are of the key=value form. The former will be generated by ffmpeg when you create a new MP4. For the latter, MP4Box should be able to transfer those - https://gpac.wp.mines-telecom.fr/mp4box/
Gyan
CC BY-SA 3.0
2015-11-19T10:11:36.777Z
Sorry,I didn't get it clearly.The reason I want to split it into 2 parts is that in the ISO/IEC 14496 Part 12, it says that 'dref' box indicates the location of media payload. And the definition of 'dref' shows that we can place the payload into another file.
aicco
CC BY-SA 3.0
2015-11-19T10:28:01.077Z
Ah, that's beyond my ken. Best place to ask that is the GPAC forum at https://github.com/gpac/gpac/issues
Gyan
CC BY-SA 3.0
2015-11-20T09:53:55.987Z
https://github.com/gpac/gpac/issues/326#issuecomment-158327529  Concolato gives me an alternative way to move the 'moov' :).
aicco
CC BY-SA 3.0
2015-11-20T10:05:58.087Z
Yes, that's using MP4Box, which works as well. But see if you can reopen the thread and get an answer to your original question i.e. moov and mdat in separate files.
Gyan
CC BY-SA 3.0
2015-11-18T04:38:57.900Z
2015-11-18T04:38:57.900Z
Gyan
<p>When media data is stored in the end of the mp4 file(it always be there),it is very difficult to extend or delete metadata infos,because metadata will use absolutely offset of this mp4 file to locate media data,so is there a tool can help me to split metadata and mediadata into 2 file?Or,is there a tool can move 'mdat' box so I can let metadata stored behind the mediadata?
All I want to get is I can freely modify the metadata related boxes and don't worry about the offset.
Thanks.</p>

<mp4>
Is there a way to split a mp4 into 2 mp4, one is metadata.mp4 and another is mediadata.mp4
aicco
# Is there a way to split a mp4 into 2 mp4, one is metadata.mp4 and another is mediadata.mp4

(Asked by: username_0 on 2015-11-18)

When media data is stored in the end of the mp4 file(it always be there),it is very difficult to extend or delete metadata infos,because metadata will use absolutely offset of this mp4 file to locate media data,so is there a tool can help me to split metadata and mediadata into 2 file?Or,is there a tool can move 'mdat' box so I can let metadata stored behind the mediadata?
All I want to get is I can freely modify the metadata related boxes and don't worry about the offset.
Thanks.

**Tags:** mp4


---

## 1 answers

### Answer by username_1 on 2015-11-18. Score: 0 | Accepted answer

If I understand you correctly, you want the MOOV atom to be stored at the end of the MP4 (after the media payload). If so, this is the typical scheme used by ffmpeg unless flagged otherwise. So, copy your current MP4 into a new container via ffmpeg:
ffmpeg -i input.mp4 -c copy output.mp4

> **Comments:**
> **username_0**: At first,thanks ! And I know how bad my English is :).  
> **username_0**: Your answer help me.And I also want to know can I move the media payload to another file? I mean 1.mp4 only contains metadata and 2.mp4 only stores media payload. If I can, is there a tool?  
> **username_1**: Let me clarify: some of the metadata is related to the data structure of the payload in the file i.e. chunk offsets and the like, for the media player to map out the media itself. And then there's information stored like a rotation flag or XMP fields..etc These latter are of the key=value form. The former will be generated by ffmpeg when you create a new MP4. For the latter, MP4Box should be able to transfer those - https://gpac.wp.mines-telecom.fr/mp4box/  
> **username_0**: Sorry,I didn't get it clearly.The reason I want to split it into 2 parts is that in the ISO/IEC 14496 Part 12, it says that 'dref' box indicates the location of media payload. And the definition of 'dref' shows that we can place the payload into another file.  
> **username_1**: Ah, that's beyond my ken. Best place to ask that is the GPAC forum at https://github.com/gpac/gpac/issues  
> **username_0**: https://github.com/gpac/gpac/issues/326#issuecomment-158327529  Concolato gives me an alternative way to move the 'moov' :).  
> **username_1**: Yes, that's using MP4Box, which works as well. But see if you can reopen the thread and get an answer to your original question i.e. moov and mdat in separate files.  

---

