TL;DR

  • No sound problem is due to mismatching sampling frequency index.

Why

On previous post, Stream by OBS have a problem, no sound playable. OBS's setting is correct that I checked by Recording. is occured by my mistake. It occured due to hard-coded frequency index in ADTS writer.

In RTMP protocol, Sampling Frequency Index was passing by AudioSpecificConfig. But, It fixed 0x1 in my tcpdump on OBS and ffmpeg.

So, I don’t care about it and just hard-coding for ADTS writer for matching output.

How

List of Frequency related packets from RTMP is below.

  • Data message that named @setDataFrame onMetaData
  • RTMP Audio message’s control
  • AAC AudioSpecificConfig

But, last two way’s are unavailable. due to following reason.

  • RTMP Audio message’s control’s frequency related variable is always 3 on AAC.
  • AAC AudioSpecificConfig packet is always 0x1 on my whole observation.

So, Correct solution is only consider @setDataFrame onMetaData’s metadata.

Discussions

  • Split video/audio track in HLS playlist?
    • Passing audio ADTS directly
    • Need to check about synchronous related features