'Calculate the duration of a single m4s segment in java

I've been working on a streaming project (Spring boot), where I need to create a m3u8 playlist from scratch containing the reference of m4s segments created within a specific time. Now, I need to know the duration of each m4s segment. Is it possible to calculate/get the duration of a single m4s segment in java (or any other way)? TIA



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source