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

2024-09-22 Thread Vincent Deconinck
> I have tried the following commands > > ffmpeg -err_detect ignore_err -i old.mp4 -c copy new.mp4 > ... > [mov,mp4,m4a,3gp,3g2,mj2 @ 00158b00] stream 1, contradictionary STSC and > STCO > [mov,mp4,m4a,3gp,3g2,mj2 @ 00158b00] error reading header Hmm, I see. Maybe one last "cheap" attempt: if yo

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

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

2024-09-22 Thread Ferdi Scholten
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 l

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 Gia Ferrari
On 9/22/24 09:22, Alan Chen via ffmpeg-user wrote: > 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

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 Vincent Deconinck
> > 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? > Tha

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-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 Oliver Fromme
Alan Chen via ffmpeg-user wrote: > ffprobe -print_format json -show_packets -show_streams -show_entries > packet=pts,duration,size,codec_type,pos test.mp4 > test.mp4.info You need to provide more information. What are the contents of test.mp4? What codecs? > I extract the raw data of the pack

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

2024-09-21 Thread Ferdi Scholten
On 21-09-2024 12:32, Alan Chen via ffmpeg-user wrote: 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

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

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

2024-09-21 Thread Ferdi Scholten
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

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-21 Thread Ferdi Scholten
On 21-09-2024 04:39, Alan Chen via ffmpeg-user wrote: 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, suc