[FFmpeg-user] filter ffmetadata does not output all metadata and is missing in documentation

Ulf Zibis Ulf.Zibis at gmx.de
Wed Mar 4 02:51:37 EET 2020


Am 04.03.20 um 00:34 schrieb James Darnley:
> On 2020-03-04 00:16, James Darnley wrote:
>> It is clearly present in the input file's metadata so how is it not
>> copied into the output file?

Even with normal transcoding "creation_time" is listed in the OUTPUT
metadata, but in the resulting output file it is missing.

$ ~/Projects/ffmpeg/ffmpeg-git-20200211-amd64-static/ffmpeg -i
20200205_165401.mp4 -vf scale=w=iw/2:h=ih/2 20200205_165401_2_git.mp4
ffmpeg version N-51730-gf15007afa9-static
https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2020 the FFmpeg
developers
   built with gcc 8 (Debian 8.3.0-6)
[.....]
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20200205_165401.mp4':
[.....]
Output #0, mp4, to '20200205_165401_2_git.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     com.android.version: 8.0.0
     location        : -00.7655-047.1715/
     location-eng    : -00.7655-047.1715/
     encoder         : Lavf58.38.100
     Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661),
yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc
(default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z        <-- HERE <--
       handler_name    : VideoHandle
       encoder         : Lavc58.68.102 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 128 kb/s (default)
     Metadata:
       creation_time   : 2020-02-05T19:55:01.000000Z        <-- HERE <--
       handler_name    : SoundHandle
       encoder         : Lavc58.68.102 aac
[.....]

> Here's the answer.
>
>> commit e377208d43
>> Author: Michael Niedermayer <michaelni at gmx.at>
>> Date:   Thu Jun 28 17:09:36 2012 +0200
>>
>>      ffmpeg: dont copy creation_time as the destination file is not created at that time
Linux command "mediainfo" distinguishes between "Encoded date" and
"Tagged date", don't know which is meant to be "creation_time".
In jpeg EXIF we find "DateTimeOriginal" and "DateTimeDigitized".


>>
>>      Fixes Ticket1439
>>
>>      Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
>>
>> diff --git a/ffmpeg.c b/ffmpeg.c
>> index f6ce70b8f2..aa16e05f7e 100644
>> --- a/ffmpeg.c
>> +++ b/ffmpeg.c
>> @@ -5242,6 +5242,7 @@ loop_end:
>>                        AV_DICT_DONT_OVERWRITE);
>>           if(o->recording_time != INT64_MAX)
>>               av_dict_set(&oc->metadata, "duration", NULL, 0);
>> +        av_dict_set(&oc->metadata, "creation_time", NULL, 0);
>>       }
>>       if (!o->metadata_streams_manual)
>>           for (i = output_files[nb_output_files - 1]->ost_index; i < nb_output_streams; i++) {
> Trac ticket cause: http://trac.ffmpeg.org/ticket/1439
That may make sense for normal transcoding, but not for:
ffmpeg -i INPUT.mp4 -f ffmetadata INPUT.meta

> I would say: use ffprobe to get the metadata of files.

But how to transfer it to the output video?

-Ulf



More information about the ffmpeg-user mailing list