Opened 8 years ago
Last modified 5 years ago
#6453 new defect
RTMP handshake fails with some encoders
Reported by: | Ruben Sanchez Castellano | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | RTMP |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
Run a RTMP server using libavformat (I run a custom one) and try to stream to that server with Wirecast, Amazon's Elemental LIVE or iOS app wich uses VideoCore library.
Then you will see how the encoder do not start the stream or even crashes (Wirecast does). Wireshark shows a RST TCP packet when server sends S1 and waits for C2.
The root cause of this is the implementation of the RTMP protocol. These encoders send C0 and C1 packets together and they expect S0 and S1 sent together also. So, sending S0 and S1 on different packets results on the encoder closing the connection with the server.
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
Change History (4)
comment:2 by , 8 years ago
Reproduced by developer: | unset |
---|
comment:3 by , 5 years ago
Above works to fix handshake for elemental encoders for release builds, but when some debug flags turned on the url context gets corrupted and crashes. This can be fixed by changing "uint8_t dummy_uint;" to "uint32_t dummy_uint;"
comment:4 by , 5 years ago
Keywords: | handshake removed |
---|---|
Priority: | important → normal |
Please understand that patches are ignored on this bug tracker, send the patch - made with git format-patch
- to the FFmpeg development mailing list.
I implemented the following fix. Basically it sends S0 and S1 using the same buffer and receives C0 and C1 on another resized buffer. I noticed the C2 packet has a 0x00 byte at the beginning so the array for C2 needs to be resized also.