Zend certified PHP/Magento developer

is there any way to change the metadata of a file without COPYING (not reencoding!) in ffmpeg

as title. I’ve seen an absolute ton of posts that discuss changing metadata without reencoding, but I’m trying to mass output files to reset their rotation values. Is there any way to do this without needing to copy bits over to another file; instead just changing the file’s metadata?

I’ve tried the following:

ffmpeg -i 0003.MP4 -c copy -metadata:s:v:0 rotate=0 0003_fixed.MP4

and while this mostly works for my use case, I’m trying to perform this a lot faster than re-copying an entire file.

additionally, in comparing the output file of this fixed file vs the output file of a file I didn’t have to rotate, there are a bit of differences in metadata somehow:

unchanged file:

  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0002.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:41:41.62, start: 0.000000, bitrate: 45201 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 45000 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : GoPro AVC
      encoder         : GoPro AVC encoder
      timecode        : 17:01:09:16
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      handler_name    : GoPro AAC
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : GoPro AVC
      timecode        : 17:01:09:16

changed file:

  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0003_fixed.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:35:23.14, start: 0.000000, bitrate: 45201 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 45000 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : GoPro AVC
      timecode        : 17:43:43:04
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      handler_name    : GoPro AAC
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : GoPro AVC
      timecode        : 17:43:43:04

notice here that it seems to remove the encoder: GoPro AVC encoder piece of metadata. could someone give a way for me to use this utility in a way that doesn’t remove any other metadata except for the rotation flag, and also doesn’t require an entire copy (i.e. does it inplace)? thanks y’all!

I’m hoping to find a solution to this that