Skip to content

udtacopy seems to mangle metadata on the video file, instead of copying things over? #1531

@victorhooi

Description

@victorhooi

I'm attempting to use udtacopy, to help trim some GoPro video files - and instead of copying the udta atoms over, it seems to mangling the metadata on the video files instead?

The source video was taken on a GoPro Hero 11.

I've used the following ffmpeg command-line, to trim my video:

ffmpeg -i GX010870.MP4 -ss 00:00:10 -t 00:11:20 -c copy -map 0:0 -map 0:1 -map 0:3 output_trimmed.mp4

(I believe this should be copying over video (track 0), audio (track 1), skipping the timecode (track 2), and copying over the GPMF data (track 3).

Here are links to gists, with the output from ffprobe, exiftool and Bento4 mp4dump for the original source video file:

And here are the corresponding ones for the output file from ffmpeg, before running udtacopy:

I then run udtacopy on the file, like so:

victorhooi@ampere-01 /a/v/g/testing_gpmf> ~/code/labs/docs/control/chapters/src/udtacopy GX010870.MP4 output_trimmed.mp4

And now the outputs again:

In this case they're actually quite short - I've pasted them below as well - as you can see, it's almost like they've been corrupted or mangled somehow?

        [.too] size=8+28
          [data] size=8+20
            type = 1
            lang = 0
            value = Lavf61.7.100
victorhooi@ampere-01 /a/v/g/testing_gpmf> ~/code/labs/docs/control/chapters/src/udtacopy GX010870.MP4 output_trimmed.mp4
victorhooi@ampere-01 /a/v/g/testing_gpmf [1]> ffprobe output_trimmed.mp4
ffprobe version 7.1.2-1+b1 Copyright (c) 2007-2025 the FFmpeg developers
  built with gcc 15 (Debian 15.2.0-4)
  configuration: --prefix=/usr --extra-version=1+b1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --disable-libmfx -
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.101 / 61. 19.101
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xaaaafe7b82d0] Detected moov in a free or hoov atom.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output_trimmed.mp4':
  Metadata:
    minor_version   : 512
    major_brand     : isom
    compatible_brands: isomiso2mp41
    encoder         : Lavf61.7.100
    firmware        : H22.01.02.32.00
  Duration: 00:11:20.69, start: 0.000000, bitrate: 60042 kb/s
  Stream #0:0[0x1](eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 5312x2988 [SAR 1:1 DAR 16:9], 59852 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
      Metadata:
        handler_name    : GoPro H.265
        vendor_id       : [0][0][0][0]
        encoder         : GoPro H.265 encoder
        timecode        : 09:03:49:00
      Side data:
        displaymatrix: rotation of -180.00 degrees
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
      Metadata:
        handler_name    : GoPro AAC
        vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](eng): Data: bin_data (gpmd / 0x646D7067), 54 kb/s (default)
      Metadata:
        handler_name    : GoPro MET
  Stream #0:3[0x4](eng): Data: none (tmcd / 0x64636D74)
      Metadata:
        handler_name    : GoPro H.265
        timecode        : 09:03:49:00
Unsupported codec with id 98314 for input stream 2
Unsupported codec with id 0 for input stream 3
victorhooi@ampere-01 /a/v/g/testing_gpmf> exiftool output_trimmed.mp4
ExifTool Version Number         : 13.25
File Name                       : output_trimmed.mp4
Directory                       : .
File Size                       : 5.1 GB
File Modification Date/Time     : 2025:10:15 13:08:24+11:00
File Access Date/Time           : 2025:10:14 15:05:57+11:00
File Inode Change Date/Time     : 2025:10:15 13:08:24+11:00
File Permissions                : -rw-rw-r--
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MP4 Base Media v1 [IS0 14496-12:2003]
Minor Version                   : 0.2.0
Compatible Brands               : isom, iso2, mp41
Media Data Size                 : 5108312483
Media Data Offset               : 44
victorhooi@ampere-01 /a/v/g/testing_gpmf> ~/code/Bento4/cmakebuild/mp4dump output_trimmed.mp4
[ftyp] size=8+20
  major_brand = isom
  minor_version = 200
  compatible_brand = isom
  compatible_brand = iso2
  compatible_brand = mp41
[mdat] size=16+5108312483
[free] size=8+510966

I'm happy to supply the source video file (GX010870.MP4) directly with somebody if that would help with the debugging - let me know if there's a good way to share that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions