ffmpeg find segments of same video recording

2019-08-28 00:57发布

Here's how my camera operates:

When taking a video recording, the camera will automatically segment into a new file chapter once it has reached a certain size. These files when put together with editing software will play seamlessly as if they were never chaptered, and when played back from the camera directly will also play through as one continuation.

Which results in the video being split into three video files:

$ ls -1
GH010119.MP4
GH020119.MP4
GH030119.MP4

Which may be placed in a directory alongside segments from another video. For example:

$ ls -1
GH010119.MP4
GH010120.MP4
GH010126.MP4
GH010127.MP4
GH020119.MP4
GH020126.MP4
GH020127.MP4
GH030119.MP4

In order to use ffmpeg to concatenate the same continuous segments, I need to write a file listing the filenames of the videos I want to concatenate. So I'm finding the files with the same last four characters:

find . -name "*0119*" -execdir echo '{}' ';' | xargs -n1 echo file > concat_list.txt

But is there a way to figure out, from the videos' data or metadata, which of these files are segments of the same video?

标签: bash ffmpeg
0条回答
登录 后发表回答