ffmpeg editing metadata major_brand
Asked Answered
C

1

6

Hello I have an MP4 video, I want to change the creation_time using ffmepg, without changing the rest of metadata. but I am facing some problems..

The major_brand and more stuff are changed. I want those to be the same. if I put it in ffprobe.exe this is what I see:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '6.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    creation_time   : 2013-03-23 16:25:53
  Duration: 00:00:06.55, start: 0.000000, bitrate: 919 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x480,
862 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc
    Metadata:
      creation_time   : 2013-03-23 16:25:53
      handler_name    : Core Media Video
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 k
b/s
    Metadata:
      creation_time   : 2013-03-23 16:25:53
      handler_name    : Core Media Audio

I want to change the creation_time of the video, when I run :

ffmpeg.exe -i 6.mp4 -metadata creation_time="2013-06-22 15:00:00" -acodec copy -vcodec copy output.mp4

I get:

Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    creation_time   : 2013-06-22 15:00:00
    encoder         : Lavf55.12.102
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 480x480, q=
2-31, 862 kb/s, 29.97 fps, 19200 tbn, 600 tbc
    Metadata:
      creation_time   : 2013-03-23 16:25:53
      handler_name    : Core Media Video
    Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, 62 kb
/s
    Metadata:
      creation_time   : 2013-03-23 16:25:53
      handler_name    : Core Media Audio
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  194 fps=0.0 q=-1.0 Lsize=     738kB time=00:00:06.61 bitrate= 913.9kbits
/s

According to the output and because I chose "-acodec copy -vcodec copy" everything should stay the same. But when I run ffprobe for the newly created .mp4 file. Here is the output:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2013-06-22 15:00:00
    encoder         : Lavf55.12.102
  Duration: 00:00:06.62, start: 0.000000, bitrate: 913 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x480,
862 kb/s, 29.97 fps, 30 tbr, 19200 tbn, 38400 tbc
    Metadata:
      creation_time   : 2013-06-22 15:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 k
b/s
    Metadata:
      creation_time   : 2013-06-22 15:00:00
      handler_name    : SoundHandler

As you see everything has changed, even though i chose to keep everything the same.

Please help me on this. Thanks!

Carolinian answered 26/7, 2013 at 16:31 Comment(1)
Not sure that you can find a tool to change only the creation date. in your case the stream copy work fine, but it's just that the muxer don't use exactly the same marker than in the original file. But Creation Date is easy to find and I think an in-place update is possible with a simple program...Corley
C
5

A solution in-place exist using a python script.

  1. Setup Python 3.3.2 (it may work with the last of the 2.7 series but not tested)

  2. download movmd.py from GitHub

movmd.py can change all the date in your mp4 in-place (really fast)

   python movmd.py mp4File.mp4 "2013-07-29 00:00:00"

Extracted the mp4 info with ffmpeg, i got:

ffmpeg version N-53818-gfca435f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun  4 2013 01:41:53 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-lib
vpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 15.100 / 55. 15.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 74.101 /  3. 74.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C_est_pas_Sorcier_Les_Volcans_partie_1 - Copie.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2013-07-28 23:00:00
  Duration: 00:14:19.06, start: 0.000000, bitrate: 611 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 509 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
    Metadata:
      creation_time   : 2013-07-28 23:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
    Metadata:
      creation_time   : 2013-07-28 23:00:00
      handler_name    : (C) 2007 Google Inc. v08.13.2007.
Corley answered 29/7, 2013 at 19:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.