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

2024-09-21 Thread Alan Chen via ffmpeg-user
Thank you. In that case, what are some video editor software does with the videos? They can cut some frames from the original video and create a new MP4 file. Are these software just decode and uncompress everything, then remove some frames, then re-encode and re-compress the remaining video? ___

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

2024-09-21 Thread Alan Chen via ffmpeg-user
> > > > > So, how to reassemble the raw packet data back to a new MP4 file? > > That's not possible in general, because your raw packets do not > contain sufficient information to create an MP4 file. > > I suggest that you explain why you are actually doing all of that. > What is the purpose, what

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

2024-09-22 Thread Alan Chen via ffmpeg-user
Hi, Gia Thank you very much. The only issue is that the tool needs a similar video to fix the truncated one. For most of the cases, it is rather difficult to do so. So I still hope to be able to reassemble a new MP4 with all the existing boxes and packets in the original MP4 without a reference,

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

2024-09-22 Thread Alan Chen via ffmpeg-user
Hi, Vincent, Thank you for your suggestion. Let me explain the real case: I have many MP4 files which lost some data in the tail, which make them not playable. I analyze these files manually and find the ftyp and moov boxes and their child boxes are all OK. But part of the data in mdat box are lo

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

2024-09-21 Thread Alan Chen via ffmpeg-user
What I remove is the last video and audio packet in each stream. All the meta data are still there, together with all remaining packet data as separate files. But I don't know how to utilize them in the commandline to reassemble the packets. ___ ffmpeg-us

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

2024-09-20 Thread Alan Chen via ffmpeg-user
I am using ffmpeg. I use the following command to get all packet info: ffprobe -print_format json -show_packets -show_streams -show_entries packet=pts,duration,size,codec_type,pos test.mp4 > test.mp4.info Then based on each packet info, such as the one below: { "codec_type":

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

2024-09-21 Thread Alan Chen via ffmpeg-user
I try on another MP4 file with H264 codec video, but still get the same result. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org

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

2024-09-22 Thread Alan Chen via ffmpeg-user
Thank you but it produces the same result as before. I have tried the following commands ffmpeg -err_detect ignore_err -i old.mp4 -c copy new.mp4 ffmpeg -i old.mp4 -map 0:v -c copy video_only.mp4 ffmpeg -i old.mp4 -map 0:a -c copy audio_only.aac ffmpeg -i old.mp4 -fflags +genpts -c copy new.mp