Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Graphics, Flash and Multimedia _ Display video time/date stamp right on the video

Posted by: DaveNemo Jul 16 2020, 11:06 AM

I'm trying to find code to display a video's time and date stamp (from the video's metadata) right on the video in a browser. Is that possible? I'm using MP4 videos.
DaveNemo

Posted by: Christian J Jul 16 2020, 12:00 PM

Haven't tried, but maybe this could work? https://www.phpclasses.org/package/10183-PHP-Extract-metadata-from-audio-and-video-files.html

Not sure if browsers' video players allow you to position the resulting data in front of the video.

Posted by: DaveNemo Jul 19 2020, 10:00 AM

Thanks for the info. I looked at the data that it can get and it seems that it gets media length but not file date/time stamp. Anybody else got a lead on how to get file date/time stamp????

Posted by: Christian J Jul 19 2020, 12:32 PM

Oh, I thought you meant the creation date in the video's EXIF data. In contrast, the actual file's last-modifed timestamp is defined as when it's uploaded to the server. You can get that with PHP as well: https://www.php.net/manual/en/function.filemtime.php or with javascript https://developer.mozilla.org/en-US/docs/Web/API/Document/lastModified

Of course the content could have been created long before the file was uploaded. Also note that if your web host decides to migrate to new server software (or you change web host) the last-modified timestamp will be reset.

Posted by: Christian J Jul 19 2020, 12:41 PM

A more reliable approach might be to specify the date explicitly in some way. For example, you might use it as part of the file name; or if you use a database, use a column for dates.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)