Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP3 file creation date #229

Closed
vuurklip opened this issue Dec 30, 2019 · 8 comments
Closed

MP3 file creation date #229

vuurklip opened this issue Dec 30, 2019 · 8 comments

Comments

@vuurklip
Copy link

A simple script results in the snippet of the output below - but nowhere do I see the file's
creation date.

The code:
$filename = "albums/CapePoint/MVI_1657.MP4";
$ThisFileInfo = $getID3->analyze($filename);

The output:
Array
(
[GETID3_VERSION] => 1.9.19-201912131005
[filesize] => 90049761
[filepath] => C:/xampp/htdocs/gallery/albums/CapePoint
[filename] => MVI_1657.MP4
[filenamepath] => C:/xampp/htdocs/gallery/albums/CapePoint/MVI_1657.MP4
[avdataoffset] => 98312
[avdataend] => 90049761
[fileformat] => mp4
[audio] => Array

etc.

@JamesHeinrich
Copy link
Owner

Quicktime files have creation and modification time scattered through various atoms. In theory they could be different from each other, although in most cases I would expect them to be identical (or close). To simplify user access to these numbers, Quicktime files now return an array of timestamps in [quicktime][timestamps_unix][<type>][<atom-hierarchy>]:
timestamps

In general practice you can probably assume that the timestamps are either all the same, or just grab the earliest one, for example:
$timestamp = (!empty($info['quicktime']['timestamps_unix']['create']) ? min($info['quicktime']['timestamps_unix']['create'])) : false);

Fixed in 5967da6

@vuurklip
Copy link
Author

vuurklip commented Dec 30, 2019 via email

@vuurklip
Copy link
Author

vuurklip commented Dec 30, 2019 via email

@JamesHeinrich
Copy link
Owner

Accessing a specific set of subatoms, like $ThisFileInfo['quicktime']['moov']['subatoms']['2']['creation_time'] in your example, may be risky because the returned structure of Quicktime is notoriously variable. The moov atom should always be there, but it may not always have a third subatom and/or that subatom may not contain timestamps. I would recommend using the standardized data I just added for you in $info['quicktime']['timestamps_unix']['create'] instead.

@vuurklip
Copy link
Author

vuurklip commented Dec 30, 2019 via email

@vuurklip
Copy link
Author

vuurklip commented Dec 31, 2019 via email

@vuurklip
Copy link
Author

vuurklip commented Dec 31, 2019 via email

@JamesHeinrich
Copy link
Owner

Notice: Trying to access array offset on value of type bool in C:\xampp\htdocs\gallery\getID3\getid3\module.audio.mp3.php on line 1791

I'm curious about this. If you're able to send that sample file (or any sample file that produces this error) I would be interested in looking at it. Both for the error in the MP3 module (which is unexpected and shouldn't happen), and that it appears that the quicktime file does not contain any timestamps, which is also unusual.

You can attach here, or email to info@getid3.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants