Audio-video stream with PCM audio over RTMP not working unless preceded by Audio-video stream with AAC audio
Closed this issue · 1 comments
Version:
ossrs/srs:6.0-d5
Steps to Reproduce:
-
Push an audio-video stream with AAC audio to the application at rtmp://192.168.1.212:1935/live/what_the_hell_3 → in ffplay, both video and AAC audio are shown.
-
Stop pushing.
-
Push an audio-video stream with PCM audio to the same stream key (rtmp://192.168.1.212:1935/live/what_the_hell_3) → in ffplay, both video and PCM audio are shown.
-
If you either:
-
Restart the application and push the same audio-video stream with PCM directly to rtmp://192.168.1.212:1935/live/what_the_hell_3, or
-
Without restart and push the same audio-video stream with PCM directly to a different stream key (e.g. rtmp://192.168.1.212:1935/live/another_key)
→ in ffplay, only the video stream is shown, no audio stream.
Expected behavior:
Audio-video stream with PCM audio should play correctly when pushed directly, even if no audio-video stream with AAC audio has been pushed before.
Actual behavior:
When pushing PCM directly (without AAC first or on a new stream key), ffplay only shows the video stream, no audio stream.
Notes:
This makes it look like the application requires AAC as a “primer” before it can handle PCM.
Is PCM officially supported in RTMP/FLV, or is this unintended behavior?
Screenshot:

PCM audio codec is not supported in SRS. Only AAC, MP3, and Opus are supported.
Fix: Changed behavior to return explicit error instead of silently ignoring unsupported codecs.
Solution for users:
ffmpeg -i input -c:v copy -c:a aac -f flv rtmp://server/live/stream