[FFmpeg-devel] rtmps connect block

Qiming Jin (qimijin) qimijin at cisco.com
Thu Sep 7 15:46:54 EEST 2017

Hi all
Please help check an issue:
When I sent date to rtmps server(facebook live).  Connection will block after sent 10 packet.
Below is the situation:
1 build: ./configure –enable-openssl && make && make install
2 connet to rtmp is ok. But rtmps is fail, BLOCK after sent out 10 packet.
3 if delete  this line :
ret = ffurl_read(rt->stream, &c, 1);
and add:
in function rtmp_write(), then every thing will be ok.
I also found this line was added at this commit:
4 my code is attached,  for your reference.

  I want to know if this is a bug, if not, how to fix this? Can I simply fix it as point3 said.

(gdb) bt
#0  0x00007ffff6657bb0 in __poll_nocancel () from /lib64/libc.so.6
#1  0x00000000005ae7a5 in ff_network_wait_fd (write=0, fd=8) at libavformat/network.c:79
#2  ff_network_wait_fd_timeout (fd=8, write=write at entry=0, timeout=0, int_cb=int_cb at entry=0x1c37e70)
    at libavformat/network.c:92
#3  0x00000000005b9fc6 in tcp_read (h=0x1c37e40, buf=0x1c45b93 "\027\003\003", size=5) at libavformat/tcp.c:219
#4  0x00000000005a2c86 in retry_transfer_wrapper (transfer_func=0x5b9f80 <tcp_read>, size_min=1, size=5,
    buf=0x1c45b93 "\027\003\003", h=0x1c37e40) at libavformat/avio.c:380
#5  ffurl_read (h=0x1c37e40, buf=0x1c45b93 "\027\003\003", size=5) at libavformat/avio.c:416
#6  0x00000000005ba901 in url_bio_bread (b=0x1c363c0, buf=<optimized out>, len=<optimized out>)
    at libavformat/tls_openssl.c:97
#7  0x00007ffff7494c4b in BIO_read () from /lib64/libcrypto.so.10
#8  0x00007ffff71787d4 in ssl3_read_n () from /lib64/libssl.so.10
#9  0x00007ffff7179acd in ssl3_read_bytes () from /lib64/libssl.so.10
#10 0x00007ffff7176d74 in ssl3_read_internal () from /lib64/libssl.so.10
#11 0x00000000005baaba in tls_read (h=0x1ce0c80, buf=0x7fffffffdcf0 "L\001\305\001", size=1)
    at libavformat/tls_openssl.c:306
#12 0x00000000005a2c86 in retry_transfer_wrapper (transfer_func=0x5baa80 <tls_read>, size_min=1, size=1,
    buf=0x7fffffffdcf0 "L\001\305\001", h=0x1ce0c80) at libavformat/avio.c:380
#13 ffurl_read (h=0x1ce0c80, buf=buf at entry=0x7fffffffdcf0 "L\001\305\001", size=size at entry=1) at libavformat/avio.c:416
#14 0x00000000005b540c in rtmp_write (s=s at entry=0x1caf500, buf=buf at entry=0x1c50140 "\b", size=size at entry=434)
    at libavformat/rtmpproto.c:3083
#15 0x00000000005a2fdb in retry_transfer_wrapper (transfer_func=0x5b5070 <rtmp_write>, size_min=434, size=434,
    buf=0x1c50140 "\b", h=0x1caf500) at libavformat/avio.c:380
#16 ffurl_write (h=0x1caf500, buf=0x1c50140 "\b", size=434) at libavformat/avio.c:434
#17 0x000000000047c5bd in writeout (len=434, data=<optimized out>, s=0x1cab1c0) at libavformat/aviobuf.c:154
#18 flush_buffer (s=0x1cab1c0) at libavformat/aviobuf.c:171
#19 avio_flush (s=0x1cab1c0) at libavformat/aviobuf.c:227
#20 0x0000000000510d45 in write_packet (pkt=0x7fffffffdec0, s=0x1c37260) at libavformat/mux.c:776
#21 av_interleaved_write_frame (s=0x1c37260, pkt=0x0) at libavformat/mux.c:1291
#22 0x0000000000464202 in main ()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m.cpp
Type: application/octet-stream
Size: 5572 bytes
Desc: m.cpp
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170907/2a631f66/attachment.obj>

More information about the ffmpeg-devel mailing list