ffmpeg – How to “unconcatenate” MP4 file?

I used Losseless Cut (which uses ffmpeg) to concatenate a bunch of MP4 files using ffmpeg concat demuxer. Unfortunately I didn’t check the result before deleting the source clips. The first clip had different format than the rest. The resulting clip has all the audio and video from the first clip. Rest of the video gives decoding errors.

I’m looking for a way how to “unconcatenate” the file and get back the original video. I believe it’s in the container, just incorrectly labeled as 1920x1080x50 hevc video.

I believe I should export the audio and video streams, cut away the first frames from both streams up to the point where the first clip ends, then change the format of the video stream and finally put them back into container.

I’m not sure what tools and commands to use the cut the video stream and what commands and tools to use force the correct video format on the stream.

I’ve read ffmpeg documentation but it’s vast and my use case isn’t directly covered. I’m planning to play around with different tools, but I’m new to the subject and thought to ask first.

Read more here: Source link