[FFmpeg-user] How to reassemble raw packet data back into a new MP4 file?

Ferdi Scholten ferdi at sttc-nlp.nl
Sat Sep 21 12:13:51 EEST 2024



On 21-09-2024 10:57, Alan Chen via ffmpeg-user wrote:
> I try on another MP4 file with H264 codec video, but still get the same
> result.
> _______________________________________________
>
Your file needs to conform to te specifications in either part 12 and/or 
14 of the standard in which the .MP4 container is described. It is not 
only a collection of packets, it is also a program, metadata, stream, 
and a lot of other structures that are needed.

The packets do not necessarily have to be in order that is why you have 
dts and pts and other descriptive information on when to display which 
packets of what stream combined with what audio from which stream 
augmented by which data from yet another stream, possibly with subtitles 
from yet another stream etc. etc.

There is no simple answer to your question, read and learn the 
specification in order to create a valid .MP4 file, the "useless data" 
you removed is most likely needed and not useless at all. In order to 
recreate the file you'll have to add the "useless data" back in.


More information about the ffmpeg-user mailing list