-
Notifications
You must be signed in to change notification settings - Fork 244
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
Comments
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 In general practice you can probably assume that the timestamps are either all the same, or just grab the earliest one, for example: Fixed in 5967da6 |
Thanks! I did look at creation_time and creation_time_unix
e.g.
$ct = $ThisFileInfo['quicktime']['moov']['subatoms']['2']['creation_time'];
but the time returned is the script's run time! So very time I run the
script, I get a different value.
…On Mon, Dec 30, 2019 at 6:13 PM James Heinrich ***@***.***> wrote:
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>]:
[image: timestamps]
<https://user-images.githubusercontent.com/3483435/71590067-330c0000-2af5-11ea-82c3-2d1f87664bf2.png>
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
<5967da6>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229?email_source=notifications&email_token=AEOKG2TNTAGC2QZFMDUD7GTQ3IM2ZA5CNFSM4KBNYNKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2UHAQ#issuecomment-569721730>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOKG2W7Z4LBJT2XSUTLCZDQ3IM2ZANCNFSM4KBNYNKA>
.
--
-------------------------------------
Franz Dullaart
vuurklip@gmail.com
021 782 6688
072 834 1211 (Cell)
|
Oops! Sorry. Please ignore the previous comment. My conversion of the time
stamp to a readable format had a bug in it.
But thanks for your time and help. Much appreciated!
…On Mon, Dec 30, 2019 at 6:13 PM James Heinrich ***@***.***> wrote:
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>]:
[image: timestamps]
<https://user-images.githubusercontent.com/3483435/71590067-330c0000-2af5-11ea-82c3-2d1f87664bf2.png>
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
<5967da6>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229?email_source=notifications&email_token=AEOKG2TNTAGC2QZFMDUD7GTQ3IM2ZA5CNFSM4KBNYNKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2UHAQ#issuecomment-569721730>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOKG2W7Z4LBJT2XSUTLCZDQ3IM2ZANCNFSM4KBNYNKA>
.
--
-------------------------------------
Franz Dullaart
vuurklip@gmail.com
021 782 6688
072 834 1211 (Cell)
|
Accessing a specific set of subatoms, like |
Thanks!
…On Mon, Dec 30, 2019 at 7:09 PM James Heinrich ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229?email_source=notifications&email_token=AEOKG2TKMTH2WPXR4YXLMVLQ3ITKXA5CNFSM4KBNYNKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2X3FY#issuecomment-569736599>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOKG2RTRGNPF7K6TKTC4XTQ3ITKXANCNFSM4KBNYNKA>
.
--
-------------------------------------
Franz Dullaart
vuurklip@gmail.com
021 782 6688
072 834 1211 (Cell)
|
Sorry if I'm being dumb, but I can't get this to work: $info['quicktime']['
timestamps_unix']['create']
This simplified demo.basic.php:
require_once('getID3/getid3/getid3.php');
$getID3 = new getID3;
$filename = "albums/CapePoint/MVI_1657.MP4";
$ThisFileInfo = $getID3->analyze($filename);
$x = $ThisFileInfo['quicktime']['timestamps_unix']['create'];
echo("x=$x<br>");
$y = $ThisFileInfo['quicktime']['creation_time_unix']['create'];
echo("y=$x<br>");
echo '<pre>'.htmlentities(print_r($ThisFileInfo, true),
ENT_SUBSTITUTE).'</pre>';
results in this output:
*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*
*Notice*: Undefined index: timestamps_unix in
*C:\xampp\htdocs\gallery\demo.basic.php* on line *10*
*Notice*: Trying to access array offset on value of type null in
*C:\xampp\htdocs\gallery\demo.basic.php* on line *10*
x=
*Notice*: Undefined index: creation_time_unix in
*C:\xampp\htdocs\gallery\demo.basic.php* on line *13*
*Notice*: Trying to access array offset on value of type null in
*C:\xampp\htdocs\gallery\demo.basic.php* on line *13*
y=
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
(
…On Mon, Dec 30, 2019 at 7:09 PM James Heinrich ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229?email_source=notifications&email_token=AEOKG2TKMTH2WPXR4YXLMVLQ3ITKXA5CNFSM4KBNYNKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2X3FY#issuecomment-569736599>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOKG2RTRGNPF7K6TKTC4XTQ3ITKXANCNFSM4KBNYNKA>
.
--
-------------------------------------
Franz Dullaart
vuurklip@gmail.com
021 782 6688
072 834 1211 (Cell)
|
Hi James
Will try not to waste any moire of your time!
I've written s simple recursive function to traverse the $fileinfo arrays
and in the process to pick out those bits I require for my application.
Thanks again for your time and for a very useful method to get meta data.
Regards
Franz
…On Mon, Dec 30, 2019 at 6:13 PM James Heinrich ***@***.***> wrote:
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>]:
[image: timestamps]
<https://user-images.githubusercontent.com/3483435/71590067-330c0000-2af5-11ea-82c3-2d1f87664bf2.png>
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
<5967da6>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229?email_source=notifications&email_token=AEOKG2TNTAGC2QZFMDUD7GTQ3IM2ZA5CNFSM4KBNYNKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2UHAQ#issuecomment-569721730>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOKG2W7Z4LBJT2XSUTLCZDQ3IM2ZANCNFSM4KBNYNKA>
.
--
-------------------------------------
Franz Dullaart
vuurklip@gmail.com
021 782 6688
072 834 1211 (Cell)
|
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 |
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.
The text was updated successfully, but these errors were encountered: