Quick reference

The following commands were run in order so you can see the results. Here is how to check the dates on a file.

$ mediainfo video.mp4 | grep date
 Encoded date    : UTC 2019-12-15 09:11:47
 Tagged date     : UTC 2019-12-15 09:11:47
 Encoded date    : UTC 2019-12-15 09:11:47
 Tagged date     : UTC 2019-12-15 09:11:47
 Encoded date    : UTC 2019-12-15 09:11:47
 Tagged date     : UTC 2019-12-15 09:11:47

How to change the date on a file

ffmpeg -i video.mp4 -c copy -map 0 -metadata creation_time="2015-10-21 04:20:00" output.mp4

Now the date is changed

$ mediainfo output.mp4 | grep date
 Encoded date    : UTC 2015-10-21 08:20:00
 Tagged date     : UTC 2015-10-21 08:20:00
 Encoded date    : UTC 2015-10-21 08:20:00
 Tagged date     : UTC 2015-10-21 08:20:00
 Encoded date    : UTC 2015-10-21 08:20:00
 Tagged date     : UTC 2015-10-21 08:20:00

More info

When I use my Samsung Smart TV to watch video files hosted on my UPnP media server, the file browser is incredible awkward. One of the least awkward ways to browse the files is by date, since the TV allows you to view them by year. But sometimes videos that go together don't have the same year.

You can view and correct the year on video files using the above commands.