Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opusinfo: Add total playback samples to output (#40) #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

opusinfo: Add total playback samples to output (#40) #41

wants to merge 1 commit into from

Conversation

anthumchris
Copy link

@anthumchris anthumchris commented Oct 20, 2018

Adds "Playback samples" used to calculate the total duration in output.

closes #40

$ opusinfo trimmed.opus
Processing file "trimmed.opus"...

New logical stream (#1, serial: 1c033e62): type opus
Encoded with libopus 1.1
User comments section follows...
  ENCODER=opusenc from opus-tools 0.1.9
  ENCODER_OPTIONS=--hard-cbr --bitrate 64
Opus stream 1:
  Pre-skip: 312
  Playback gain: 0 dB
  Channels: 2
  Original sample rate: 48000 Hz
  Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
  Page duration:   1000.0ms (max),  888.6ms (avg),  220.0ms (min)
  Total data length: 51101 bytes (overhead: 2.62%)
  Playback samples: 297910
  Playback length: 0m:06.206s
  Average bitrate: 65.87 kbit/s, w/o overhead: 64.14 kbit/s (hard-CBR)
Logical stream 1 ended

@mark4o
Copy link
Collaborator

mark4o commented Oct 20, 2018

Thanks for the pull request.

Opus can decode at different sample rates, and the number of samples that you get would depend on the decoded sample rate. In the Ogg container timestamps use granule position which measures in units of 1/48000 s, and the difference in granule position is what you are displaying here. So this is really a time, just with units that are different than what most people are used to. How about just extending the existing playback time to 5 digits after the decimal point so that no precision is lost? That should be more clear, and also more concise than adding another line of output to show the same thing with more precision.

@anthumchris
Copy link
Author

Good point...I've been living in libopusfile land which always outputs 48k and forgot about the other sample rates. I wrote the sample output for some internal testing I'm doing, but we can skip the merge if most people won't need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show total samples used to calculate duration in opusinfo
2 participants