I am generating audio-only fmp4 files for playback on the web with DRM and hoping to support both Widevine and FairPlay however I am having trouble getting cbcs encryption scheme to work:

I prepare the mp4 file as follows:
```
ffmpeg -y -i SOURCE -map 0:a:0 -ac 2 -c:a aac -b:a 128k -movflags default_base_moof+empty_moov+faststart -map_metadata -1 -frag_duration 2000000 -f mp4 TRANSCODED.mp4
```

And then feed it into mp4dash:
```
mp4dash --no-split --force --hls --hls-master-playlist-name=gYFzjPBgaRg_master.m3u8 --hls-media-playlist-name=gYFzjPBgaRg.m3u8 --encryption-cenc-scheme=cbcs --encryption-key=KID:KEY:IV --eme-signaling=pssh-v1 --widevine --widevine-header="provider:intertrust#content_id:2a" ./TRANSCODED.mp4 --output-dir output
```

Using the cenc protection scheme works perfectly on Chrome, however changing to cbcs results in a decode error. Interestingly Chrome reports this in the debug logs:
```
Selected FFmpegAudioDecoder for audio decoding, config: codec: aac, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 44100, sample_format: Float 32-bit planar, bytes_per_frame: 8, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true
FFmpegDemuxer: av_read_frame(): Invalid data found when processing input
```

There doesn't seem to be any clear lead in the resulting file, at least if I try play it with ffplay directly it complains about `Incorrect number of samples in encryption info`.

Running `mp4info` I can see that it does describe the encryption correctly:
```
File:
  major brand:      iso5
  minor version:    200
  compatible brand: iso5
  compatible brand: iso6
  compatible brand: mp41
  fast start:       yes

Movie:
  duration:   0 (media timescale units)
  duration:   0 (ms)
  time scale: 1000
  fragments:  yes

Found 1 Tracks
Track 1:
  flags:        3 ENABLED IN-MOVIE
  id:           1
  type:         Audio
  duration: 0 ms
  language: und
  media:
    sample count: 0
    timescale:    44100
    duration:     0 (media timescale units)
    duration:     0 (ms)
    bitrate (computed): 128.827 Kbps
    sample count with fragments: 8053
    duration with fragments:     8245888
    duration with fragments:     186982 (ms)
  Sample Description 0
    [ENCRYPTED]
      Coding:         enca
      Scheme Type:    cbcs
      Scheme Version: 65536
      Scheme URI:     
    Coding:       mp4a (MPEG-4 Audio)
    Codec String: mp4a.40.2
    Stream Type: Audio
    Object Type: MPEG-4 Audio
    Max Bitrate: 128000
    Avg Bitrate: 0
    Buffer Size: 0
    MPEG-4 Audio Object Type: 2 (AAC Low Complexity)
    MPEG-4 Audio Decoder Config:
      Sampling Frequency: 44100
      Channels: 2
      Extension:
        Object Type: Spectral Band Replication
        SBR Present: no
        PS Present:  no
        Sampling Frequency: 0
    Sample Rate: 44100
    Sample Size: 16
    Channels:    2
```


troubleshooting cbcs mp4 audio
This is a GitHub Issue
repo:Bento4
owner:axiomatic-systems
Title : troubleshooting cbcs mp4 audio
Issue date:

--- start body ---
I am generating audio-only fmp4 files for playback on the web with DRM and hoping to support both Widevine and FairPlay however I am having trouble getting cbcs encryption scheme to work:

I prepare the mp4 file as follows:
```
ffmpeg -y -i SOURCE -map 0:a:0 -ac 2 -c:a aac -b:a 128k -movflags default_base_moof+empty_moov+faststart -map_metadata -1 -frag_duration 2000000 -f mp4 TRANSCODED.mp4
```

And then feed it into mp4dash:
```
mp4dash --no-split --force --hls --hls-master-playlist-name=gYFzjPBgaRg_master.m3u8 --hls-media-playlist-name=gYFzjPBgaRg.m3u8 --encryption-cenc-scheme=cbcs --encryption-key=KID:KEY:IV --eme-signaling=pssh-v1 --widevine --widevine-header="provider:intertrust#content_id:2a" ./TRANSCODED.mp4 --output-dir output
```

Using the cenc protection scheme works perfectly on Chrome, however changing to cbcs results in a decode error. Interestingly Chrome reports this in the debug logs:
```
Selected FFmpegAudioDecoder for audio decoding, config: codec: aac, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 44100, sample_format: Float 32-bit planar, bytes_per_frame: 8, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true
FFmpegDemuxer: av_read_frame(): Invalid data found when processing input
```

There doesn't seem to be any clear lead in the resulting file, at least if I try play it with ffplay directly it complains about `Incorrect number of samples in encryption info`.

Running `mp4info` I can see that it does describe the encryption correctly:
```
File:
  major brand:      iso5
  minor version:    200
  compatible brand: iso5
  compatible brand: iso6
  compatible brand: mp41
  fast start:       yes

Movie:
  duration:   0 (media timescale units)
  duration:   0 (ms)
  time scale: 1000
  fragments:  yes

Found 1 Tracks
Track 1:
  flags:        3 ENABLED IN-MOVIE
  id:           1
  type:         Audio
  duration: 0 ms
  language: und
  media:
    sample count: 0
    timescale:    44100
    duration:     0 (media timescale units)
    duration:     0 (ms)
    bitrate (computed): 128.827 Kbps
    sample count with fragments: 8053
    duration with fragments:     8245888
    duration with fragments:     186982 (ms)
  Sample Description 0
    [ENCRYPTED]
      Coding:         enca
      Scheme Type:    cbcs
      Scheme Version: 65536
      Scheme URI:     
    Coding:       mp4a (MPEG-4 Audio)
    Codec String: mp4a.40.2
    Stream Type: Audio
    Object Type: MPEG-4 Audio
    Max Bitrate: 128000
    Avg Bitrate: 0
    Buffer Size: 0
    MPEG-4 Audio Object Type: 2 (AAC Low Complexity)
    MPEG-4 Audio Decoder Config:
      Sampling Frequency: 44100
      Channels: 2
      Extension:
        Object Type: Spectral Band Replication
        SBR Present: no
        PS Present:  no
        Sampling Frequency: 0
    Sample Rate: 44100
    Sample Size: 16
    Channels:    2
```


--- end body ---
