How does nodejs get the playback time of audio and video files?

for example, I have a MP3 or MP4 file. I want to get the total playback time of this file. How can I do this?

Nov.12,2021

try Node.js to call ffmpeg to handle it;
reference:

https://zhidao.baidu.com/question/1836092286638950260.html

Menu