ExifTool Forum

General => Metadata => Topic started by: scr255 on February 01, 2025, 08:03:01 AM

Title: Issue with GoPro Hero 12 and Video Continuations
Post by: scr255 on February 01, 2025, 08:03:01 AM
Hi, I'm trying to rename media files based on their timestamps using ExifTool and Python. You can find the repository here: https://github.com/scr255/Rename-By-Metadata

It works as expected for all my videos, except those captured with the GoPro Hero 12.

The issue arises when a video exceeds the chapter size (~12GB). In such cases, the camera closes the first file and starts a new one. This behavior is common in older GoPros as well. However, older models recorded the QuickTime:CreateDate in the correct order, whereas on the GoPro Hero 12, the second file (i.e., the continuation) is sometimes recorded before the first one.

Since I'm relying on ExifTool for metadata extraction, I believe this issue originates from GoPro itself. As a workaround, I'm looking for a metadata tag that indicates whether a file is a continuation or has a continuation.
Title: Re: Issue with GoPro Hero 12 and Video Continuations
Post by: greybeard on February 01, 2025, 08:42:27 AM
I know nothing about these files at all but the first thing to do with this type of problem would be to run the following exiftool command against sample files (the first and second in a continuation set):

exiftool -a -G1 -u firstFile -diff secondFile

you can then look for a tag that is unique to either the first or second file (it might throw up too many differences but would be somewhere to start)
Title: Re: Issue with GoPro Hero 12 and Video Continuations
Post by: scr255 on February 01, 2025, 09:25:54 AM
By looking at the diff, I noticed a tag called QuickTime:GoPro_CPIN, which provides the progressive number associated with different chapters (separate files) in a continuous capture.

I wasn't retrieving that tag in Python, so I updated the code as follows:

# ---------------------------------------------------------------------
# 2) Extract metadata with ExifTool
# ---------------------------------------------------------------------
abs_paths = [os.path.join(self.dir_sc, f) for f in collected_files]
metadata_list = []

with exiftool.ExifTool() as et:
    for path_chunk in tqdm(abs_paths, desc="Extracting metadata"):
        metadata_list.extend(
            et.execute_json("-ee", "-G1", "-u", "-api", "largefilesupport=1", path_chunk)
        )

df = pd.DataFrame(metadata_list)

Thank you for your help!
Title: Re: Issue with GoPro Hero 12 and Video Continuations
Post by: Phil Harvey on February 01, 2025, 10:52:05 AM
I'll add support for extracting this tag as ChapterNumber in ExifTool 13.18, so you'll have to change your Python code for this version.

- Phil
Title: Re: Issue with GoPro Hero 12 and Video Continuations
Post by: scr255 on February 01, 2025, 02:25:49 PM
Do you intend for the new tag ChapterNumber to replace QuickTime:GoPro_CPIN, or is it meant to be a more universal tag that can be used with various video cameras, not just GoPro?
Keep up the amazing work!
Title: Re: Issue with GoPro Hero 12 and Video Continuations
Post by: Phil Harvey on February 01, 2025, 09:56:15 PM
The unknown GoPro_CPIN tag will become a known tag named ChapterNumber.  There are other ChapterNumber tags in other types of metadata already, but none that I know written by cameras.

- Phil