mIRC Home    About    Download    Register    News    Help

Print Thread
length of an mp4 file in seconds #266646 10/01/20 02:41 AM
Joined: Dec 2019
Posts: 30
Q
quartz Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Dec 2019
Posts: 30
(maximum of 60 seconds)

is there any $file extension that will do this?

Re: length of an mp4 file in seconds [Re: quartz] #266647 10/01/20 03:55 AM
Joined: Jul 2014
Posts: 34
S
SykO Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2014
Posts: 34
You can use
Code
$sound().length
which will return the length in milliseconds. You can use
Code
$calc
to turn that into seconds. Finally, you can use
Code
$duration
to return a more readable output.

Note: The $sound documentation says that the file should be mp3, ogg, or wma, but I have tested this with an mp4 and it has return the correct value. So, I would recommend looking up some dll or other alternatives, if this does not work for you.

Last edited by SykO; 10/01/20 03:56 AM.