Via libvlc, commandline, or combination of the two, is there a way to read/estimate the number of audio samples a file contains?
I am attempting to estimate the number of audio samples based on the duration of the audio in a variety of file containers.
I have been using libvlc_media_get_duration and libvlc_media_player_get_length after parsing to get the duration but it does not seem to be accurate for some file types.
- Most .ogg test files have had duration = 0
- Also the duration was inaccurate for other test files: .avi, .aac, .aiff, .etc
When using ffmpeg, I can use 'ffmpeg -i sample.ogg' to retrieve the duration. Is there a way I can come across the same information using VLC?
For context, the application I am working on uses (minus typos) : 'vlc -I dummy -vvv --no-sout-video --no-sout-smem-time-sync --sout-audio --sout #transcode{acodec=s16l}:smem{audio-postrender-callback={0},audio-pretender-callback={1}'.
Ultimately, I am attempting to estimate the size of the transcoded audio prior to completely processing the file, but I welcome any suggestions even if they included an additional instance of vlc.
Thanks!