You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a media file specifies both a date and a creation_time, the MediaInfo.CreationTime property ignores the date tag, instead being set to DateTime.Now plus the creation time.
Let's say that ffprobe E:\input.wav yields the following result:
will set mediaInfo.CreationTime to {01/15/2024 10:15:35}.
Suggested Fix
In FFprobeWrapper.SetProperties(), change creation_time to a TimeSpan and attempt to parse the date as well, adding them to each other. If only creation_time is specified, the old behaviour is kept:
if (!string.IsNullOrWhiteSpace(infos.format.tags?.creation_time) && TimeSpan.TryParse(infos.format.tags.creation_time, out var creationTime))
{
mediaInfo.CreationTime = !string.IsNullOrWhiteSpace(infos.format.tags?.date) && DateTime.TryParse(infos.format.tags.date, out var date)
? date.Add(creationTime)
: DateTime.Now.Add(creationTime);
}
The text was updated successfully, but these errors were encountered:
Issue
When a media file specifies both a date and a creation_time, the MediaInfo.CreationTime property ignores the date tag, instead being set to DateTime.Now plus the creation time.
Let's say that
ffprobe E:\input.wav
yields the following result:date : 2016-03-31
creation_time : 10:15:35
Using Xabe.FFMPEG as follows:
IMediaInfo mediaInfo = await FFmpeg.GetMediaInfo("E:\input.wav");
will set
mediaInfo.CreationTime
to{01/15/2024 10:15:35}
.Suggested Fix
In
FFprobeWrapper.SetProperties()
, change creation_time to a TimeSpan and attempt to parse the date as well, adding them to each other. If only creation_time is specified, the old behaviour is kept:The text was updated successfully, but these errors were encountered: