Quick Command for Finding Date/Time Metadata in Many Video Files
The following command has served me well in finding date/time metadata on various AVI/MP4 videos:
ffmpeg -i /path/to/video.mp4 -dump
Note: as mentioned in other answers, there is no guarantee that such information is available in all video files or available in a specific format.
Abbreviated Sample Output for Some AVI File
Metadata:
Make : FUJIFILM
Model : FinePix AX655
DateTime : 2014:08:25 05:19:45
JPEGInterchangeFormat: 658
JPEGInterchangeFormatLength: 1521
Copyright :
DateTimeOriginal: 2014:08:25 05:19:45
DateTimeDigitized: 2014:08:25 05:19:45
Abbreviated Sample Output for Some MP4 File
Metadata:
major_brand : mp41
minor_version : 538120216
compatible_brands: mp41
creation_time : 2018-03-13T15:43:24.000000Z
Answer from Chriki on Stack OverflowQuick Command for Finding Date/Time Metadata in Many Video Files
The following command has served me well in finding date/time metadata on various AVI/MP4 videos:
ffmpeg -i /path/to/video.mp4 -dump
Note: as mentioned in other answers, there is no guarantee that such information is available in all video files or available in a specific format.
Abbreviated Sample Output for Some AVI File
Metadata:
Make : FUJIFILM
Model : FinePix AX655
DateTime : 2014:08:25 05:19:45
JPEGInterchangeFormat: 658
JPEGInterchangeFormatLength: 1521
Copyright :
DateTimeOriginal: 2014:08:25 05:19:45
DateTimeDigitized: 2014:08:25 05:19:45
Abbreviated Sample Output for Some MP4 File
Metadata:
major_brand : mp41
minor_version : 538120216
compatible_brands: mp41
creation_time : 2018-03-13T15:43:24.000000Z
There doesn't seem to be a well defined standard for video metadata (compared to photos and audio files, which have EXIF and ID3/etc. respectively)
Some tags exists like e.g. Title, Composer etc. You can see those if you select a movie file in Windows 7 (perhaps earlier versions also) explorer or right click and view properties. I have not found a tag for recording date unfortunately - the closest thing available is Year (integer) :-(
Programatically, you can read and write most of these tags in .NET using Taglib Sharp from the mono project. Source and binaries are available on the banshee FTP server. It has a pretty impressive list of formats it supports (but still, make sure you catch exceptions when trying to read or write tags - it will throw whenever it finds a file it cannot understand, something which happened to me several times for my modest collection of home recordings.)
To read tags:
using (var f = TagLib.File.Create(@"c:\Path\To\MyVideo.mp4"))
{
if (f.Tag != null)
{
string title = f.Tag.Title;
Size resolution = new Size(f.Properties.VideoWidth, f.Properties.VideoHeight);
int year = f.Tag.Year;
// etc.
}
}
And similarly, to write metadata back to the file:
using (var f = TagLib.File.Create(@"c:\Path\To\MyVideo.mp4"))
{
f.Tag.Title = "My Awesome Movie";
f.Tag.Year = (uint)2011;
f.Save();
}
Videos
Is it displayed in the local time of the uploader, your local time, or perhaps in just one timezone, PST or UTC?
I post missing person and true crime videos based on recent articles of recent crimes / missing persons.
On the Recording Date & Location section, i've been selecting todays date - but the crime would not necessarily have occured on todays date, could have happened recently or perhaps years ago.
I've also not been selecting my address but the address (city) of where the crime occurred or where the missing person is missing from etc.
This means that when I post multiple videos (shorts / longs) on the same day, as is frequently the case, they'll have widely varied locations mentioned.
Is this the right approach? Is there the potential that this causes issues, that youtube feels i'm not using that section correctly and might punish me for it?
Where possible I try to have a hashtag of the location in the video title, and in keyword tags
Jesper has already given you short answers to your questions.
The no-arg method LocalDate.html#now obtains the current date from the system clock in the default (system) time-zone. Therefore, when you print LocalDate.now() in Madrid, India and New York, at the same time, you may get different results (depending on what time you do it).
Demo:
import java.time.LocalDate;
import java.time.ZoneId;
public class Main {
public static void main(String[] args) {
System.out.println(LocalDate.now(ZoneId.of("Europe/Madrid")));
System.out.println(LocalDate.now(ZoneId.of("Asia/Kolkata")));
System.out.println(LocalDate.now(ZoneId.of("America/New_York")));
}
}
Output:
2022-09-28
2022-09-29
2022-09-28
Note: to understand this difference, check the output of the following program:
import java.time.LocalDateTime;
import java.time.ZoneId;
public class Main {
public static void main(String[] args) {
System.out.println(LocalDateTime.now(ZoneId.of("Europe/Madrid")));
System.out.println(LocalDateTime.now(ZoneId.of("Asia/Kolkata")));
System.out.println(LocalDateTime.now(ZoneId.of("America/New_York")));
}
}
Result:
2022-09-28T21:03:56.438167
2022-09-29T00:33:56.443577
2022-09-28T15:03:56.444049
However, a LocalDate object does not store the time-zone information. Therefore, when you print an object of LocalDate (i.e. LocalDate#toString), the printed value will remain the same irrespective of the system time-zone.
A java.util.Date object too does not store the time-zone information. It stores the number of milliseconds from January 1, 1970, 00:00:00 GMT. However, when you print an object of java.util.Date (i.e. Date#toString), it uses the default (system) time-zone to print the value i.e. if you print an object of java.util.Date on systems with different time-zones set to them, you will get different results.
I don't think Question # 4 was answered well. I think it is obvious to Jasper and others but not so obvious to me and I think OP.
LocalDateTime.now() will use either system clock or provided timezone to determine what "now" is, but then removes the time zone reference. It is impossible to determine what original time zone was used to create the LocalDateTime object.
That had me wondering how does LocalDateTime.atZone(ZoneId.of("Europe/Madrid")) properly convert the LocalDateTime to Europe/Madrid timezone if there is no time zone reference point to convert from? For example, if LocalDateTime is 2022-09-28T21:03:56, how can it then convert that to Europe/Madrid when it does not understand what time zone the date/time it holds originated from?
The solution is obvious now. It doesn't convert and it does not try to figure out what timezone it originated from. It just appends the timezone specified to the date/time it has.
So if a LocalDateTime object has a value of 2022-09-28T21:03:56, then LocalDateTime.atZone(ZoneId.of("Europe/Madrid")) instantiates a ZonedDateTime object with a value of 2022-09-28T21:03:56+01:00. Notice there is no change other than adding the +01:00 offset in use by the people of that time zone at that moment.
If that particular time-of-day does not exist in that time zone at that moment, such as during a Daylight Saving Time (DST) cutover, the time-of-day in the new ZonedDateTime is adjusted logically.
After I understood those two points it was all really clear how it worked.
Hope this helps someone else that this was not that obvious for.