You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used to use ff-probe to gather the duration of a media file. However, I've noticed that some reported durations are incorrect. I've read that having a variable bit-rate might be one of the issues.
Anywho, I was using
FFprobe ffprobe = new FFprobe(props.getProperty(FFPROBE_BIN_KEY));
return ffprobe.probe(link);
Running a similar command on the terminal ffprobe -i Audio.file returns a similar output. I can see that there is disclaimer in the output [mp3 @ 0x559ca5e87320] Estimating duration from bitrate, this may be inaccurate.
As I was looking around, I did find a terminal-based solution that can correctly find the duration of the audio file. ffmpeg -i -v quiet -stats Audio.mpga -f null -
The input may be a remote link. From a few tests I ran, it may take up to 30 seconds for a 1-hr media to render the correct duration. The output will be like:
I need to then extract the time component from the output.
I was having a difficult trying to convert that command like ffmpeg -i -v quiet -stats Audio.link -f null - to a compatible code and parse the duration. So far, I have got the code to work (turned on the log level to see the command issued and hit-and-trial my way around to get it to work). But still have no idea about how to parse once it is done.
I used to use ff-probe to gather the duration of a media file. However, I've noticed that some reported durations are incorrect. I've read that having a variable bit-rate might be one of the issues.
Anywho, I was using
Running a similar command on the terminal
ffprobe -i Audio.file
returns a similar output. I can see that there is disclaimer in the output[mp3 @ 0x559ca5e87320] Estimating duration from bitrate, this may be inaccurate
.As I was looking around, I did find a terminal-based solution that can correctly find the duration of the audio file.
ffmpeg -i -v quiet -stats Audio.mpga -f null -
The input may be a remote link. From a few tests I ran, it may take up to 30 seconds for a 1-hr media to render the correct duration. The output will be like:
I need to then extract the time component from the output.
I was having a difficult trying to convert that command like
ffmpeg -i -v quiet -stats Audio.link -f null -
to a compatible code and parse the duration. So far, I have got the code to work (turned on the log level to see the command issued and hit-and-trial my way around to get it to work). But still have no idea about how to parse once it is done.So, this code works. The input is a remote audio file. The console output is:
I need to extract the time from the output. How can I get this?
The text was updated successfully, but these errors were encountered: