[rtmpdump] RTMP Audio / Video detection + HTTP Header

Howard Chu hyc at highlandsun.com
Sun Jan 31 09:17:48 CET 2010

Adam Malcontenti-Wilson wrote:
> Hi everyone,
> I can't be certain but it appears that the streams.c file/application assumes
> that the content is audio+video (0x05) when writing the FLV header, rather
> than checking the RTMP object type. Is it possible to do such a check to
> produce a "Audio" FLV response (0x04) when connecting to an audio-only RTMP
> stream (or could someone tell me how to code it to)?

I guess this problem is because most of this code was just copy/pasted from 
the rtmpdump.c source. In rtmpdump it always writes an audio+video header 
first, and then seeks back to the beginning to overwrite it with the correct 
value after the stream is completely downloaded. You can't just set the type 
based on the first few packets because audio/video streams tend to use a mix 
of audio and video packets. There's no way to really know the correct header 
type until you've gotten to the end.

At least, that's what I understand of it so far. If anyone knows of a reliable 
way to determine this up front, speak up...

More information about the rtmpdump mailing list