Author Topic: Reading YouTube Audio Streams  (Read 294 times)

Hanuman

  • Posts: 85
Reading YouTube Audio Streams
« on: 7 Aug '22 - 07:44 »
When I download YouTube audio streams, I save the raw stream to a file and then open it. BASS is able to read the Opus stream but Bitrate returns 12 ??

Code: [Select]
Bass.ChannelGetAttribute(chan, ChannelAttribute.Bitrate)
As for the AAC stream, it simply fails to read it.

It's a raw stream with no container; can BASS do something with it, or I need to muxe it into a container with FFmpeg first?

Hanuman

  • Posts: 85
Re: Reading YouTube Audio Streams
« Reply #1 on: 7 Aug '22 - 08:12 »
By muxing the stream into a MKV container, BASS can now read the AAC stream; but the Opus stream still returns a bitrate of 12! Muxing into a .opus file works.
« Last Edit: 7 Aug '22 - 08:29 by Hanuman »

Ian @ un4seen

  • Administrator
  • Posts: 24589
Re: Reading YouTube Audio Streams
« Reply #2 on: 8 Aug '22 - 12:45 »
When I download YouTube audio streams, I save the raw stream to a file and then open it. BASS is able to read the Opus stream but Bitrate returns 12 ??

Are you using the BASSOPUS add-on? If not, please try with that loaded via BASS_PluginLoad. If the issue persists, also check the stream's "ctype" value with BASS_ChannelGetInfo to confirm what decoder is being used.

As for the AAC stream, it simply fails to read it.

It's a raw stream with no container; can BASS do something with it, or I need to muxe it into a container with FFmpeg first?

AAC data will indeed need to be some container, eg. ADTS or MP4.