[FFmpeg-devel] [PATCH] avformat/mov: remove hack breaking creation time parsing

"zhilizhao(赵志立)" quinkblack at foxmail.com
Wed Apr 12 11:38:29 EEST 2023



> On Apr 12, 2023, at 16:10, Bernd Dürrer <Bernd.Duerrer at gmx.de> wrote:
> 
> On Tue, 11 Apr 2023, Marton Balint wrote:
>  
>>> As defined in ISO/IEC 14496-12, clause 8.2, "creation_time is an integer
>>> that declares the creation time of the presentation (in seconds since
>>> midnight, Jan. 1, 1904, in UTC time)". This is the date when the content
>>> was created (which may have been on photographic film), and not when it
>>> was encoded as a digital file.
>> 
>> I don't think that is true, it is not clear from the specs at best. The
>> creation time of the presentation can just as easily refer to the file
>> itself, not the content. Feel free to reencode something with a commercial
>> encoder, I would be suprised if creation time was kept.
> 
> I agree that it may be debated for what purpose the creation_time tag has been intended by the authors of the standard, and that this tag may be used inconsistently by different encoders. However, it remains a fact that ffmpeg does not support the date range defined in the standard, and that ffmpeg writes an incorrect date to the file if a date before 1970 is provided. This is a bug that should be amended.

FFmpeg muxer has no problem outputs mp4 with date before 1970.
You can check it with mediainfo on the output file. It’s the
demuxer try to workaround bugs of thirdparty mp4 muxers which
use 1970 as the start point of creation_time. So for date before
1970, it will become date + 1970 - 1904.

The ISO spec isn’t clear on creation_time, quicktime spec hints
it’s the creation time of the file. I’m also agree it’s a reasonable
usecase for users to tweak it as the time when a movie was filmed.

Creation time
A 32-bit integer that specifies the calendar date and time (in seconds since midnight, January 1, 1904)
when the movie atom was created. It is strongly recommended that this value should be specified using
coordinated universal time (UTC).

> 
> Kind regards,
> 
> Bernd
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list