[FFmpeg-user] ffmpeg hangs when encoding rtmp input stream

Junior wpajunior at gmail.com
Sat Aug 13 20:43:25 EEST 2016


Just as addendum, VLC is always able to play the stream which FFmpeg is
getting stucked.

Thanks,

Junior

On Sat, Aug 13, 2016 at 2:33 PM, Junior <wpajunior at gmail.com> wrote:

> Thanks for your prompt reply, Carl. Yes, it was reproductible with the
> current FFmpeg head. Below you can see more information:
>
>
> /root/build/FFmpeg/ffmpeg_g -loglevel debug -i rtmp://localhost/publish/if_livestream\
> live=1\ buffer=0 -c:a libfdk_aac -b:a 64k -c:v libx264 -b:v 136K -f flv
> rtmp://localhost/live/if_livestream_lo\ live=1\ timeout=0\ buffer=0 -c:a
> libfdk_aac -b:a 64k -c:v libx264 -b:v 436K -f flv rtmp://localhost/live/if_livestream_hi\
> live=1\ timeout=0\ buffer=0
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> ffmpeg version N-81335-g3a81775 Copyright (c) 2000-2016 the FFmpeg
> developers
>   built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
>   configuration: --pkg-config-flags=--static --enable-gpl --enable-nonfree
> --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
> --enable-libvorbis --enable-libvpx --enable-libx264 --enable-debug
> --arch=amd64
>   libavutil      55. 28.100 / 55. 28.100
>   libavcodec     57. 51.102 / 57. 51.102
>   libavformat    57. 46.101 / 57. 46.101
>   libavdevice    57.  0.102 / 57.  0.102
>   libavfilter     6. 51.100 /  6. 51.100
>   libswscale      4.  1.100 /  4.  1.100
>   libswresample   2.  1.100 /  2.  1.100
>   libpostproc    54.  0.100 / 54.  0.100
> Splitting the commandline.
> Reading option '-loglevel' ... matched as option 'loglevel' (set logging
> level) with argument 'debug'.
> Reading option '-i' ... matched as input file with argument
> 'rtmp://localhost/publish/if_livestream live=1 buffer=0'.
> Reading option '-c:a' ... matched as option 'c' (codec name) with argument
> 'libfdk_aac'.
> Reading option '-b:a' ... matched as option 'b' (video bitrate (please use
> -b:v)) with argument '64k'.
> Reading option '-c:v' ... matched as option 'c' (codec name) with argument
> 'libx264'.
> Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
> -b:v)) with argument '136K'.
> Reading option '-f' ... matched as option 'f' (force format) with argument
> 'flv'.
> Reading option 'rtmp://localhost/live/if_livestream_lo live=1 timeout=0
> buffer=0' ... matched as output file.
> Reading option '-c:a' ... matched as option 'c' (codec name) with argument
> 'libfdk_aac'.
> Reading option '-b:a' ... matched as option 'b' (video bitrate (please use
> -b:v)) with argument '64k'.
> Reading option '-c:v' ... matched as option 'c' (codec name) with argument
> 'libx264'.
> Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
> -b:v)) with argument '436K'.
> Reading option '-f' ... matched as option 'f' (force format) with argument
> 'flv'.
> Reading option 'rtmp://localhost/live/if_livestream_hi live=1 timeout=0
> buffer=0' ... matched as output file.
> Finished splitting the commandline.
> Parsing a group of options: global .
> Applying option loglevel (set logging level) with argument debug.
> Successfully parsed a group of options.
> Parsing a group of options: input file rtmp://localhost/publish/if_livestream
> live=1 buffer=0.
> Successfully parsed a group of options.
> Opening an input file: rtmp://localhost/publish/if_livestream live=1
> buffer=0.
> [rtmp @ 0x5b9b680] No default whitelist set
> [rtmp @ 0x5b9b680] Detected librtmp style URL parameters, these aren't
> supported by the libavformat internal RTMP handler currently enabled. See
> the documentation for the correct way to pass parameters.
> [tcp @ 0x5b9bc60] No default whitelist set
> [rtmp @ 0x5b9b680] Handshaking...
> [rtmp @ 0x5b9b680] Type answer 3
> [rtmp @ 0x5b9b680] Server version 13.14.10.13
> [rtmp @ 0x5b9b680] Proto = rtmp, path = /publish/if_livestream, app =
> publish, fname = if_livestream
> [rtmp @ 0x5b9b680] Server bandwidth = 5000000
> [rtmp @ 0x5b9b680] Client bandwidth = 5000000
> [rtmp @ 0x5b9b680] New incoming chunk size = 4096
> [rtmp @ 0x5b9b680] Creating stream...
> [rtmp @ 0x5b9b680] Sending play command for 'if_livestream'
>
>
> And here is the backtrace:
>
> (gdb) bt
> #0  0x00006d71987ed680 in __poll_nocancel () from /lib64/libc.so.6
> #1  0x000000000066a9f2 in ff_network_wait_fd (write=0, fd=7) at
> libavformat/network.c:78
> #2  ff_network_wait_fd_timeout (fd=7, write=write at entry=0, timeout=0,
> int_cb=0x5b9bc90) at libavformat/network.c:90
> #3  0x00000000006c4ab6 in tcp_read (h=<optimized out>, buf=0x77e9e386528f
> "", size=1) at libavformat/tcp.c:207
> #4  0x00000000005ca204 in retry_transfer_wrapper (transfer_func=0x6c4a90
> <tcp_read>, size_min=1, size=1, buf=0x77e9e386528f "", h=0x5b9bc60)
>     at libavformat/avio.c:378
> #5  ffurl_read (h=h at entry=0x5b9bc60, buf=buf at entry=0x77e9e386528f "",
> size=size at entry=1) at libavformat/avio.c:411
> #6  0x0000000000707dda in ff_rtmp_packet_read (h=0x5b9bc60, p=p at entry=0x77e9e3865330,
> chunk_size=4096, prev_pkt=prev_pkt at entry=0x5b9b750,
>     nb_prev_pkt=nb_prev_pkt at entry=0x5b9b760) at libavformat/rtmppkt.c:164
> #7  0x000000000068eb22 in get_packet (s=s at entry=0x5b9b680, for_header=0)
> at libavformat/rtmpproto.c:2406
> #8  0x00000000006932f1 in rtmp_open (s=0x5b9b680, uri=<optimized out>,
> flags=<optimized out>) at libavformat/rtmpproto.c:2837
> #9  0x00000000005c9876 in ffurl_connect (uc=0x5b9b680,
> options=options at entry=0x77e9e386b540) at libavformat/avio.c:209
> #10 0x00000000005c9f3a in ffurl_open_whitelist (puc=puc at entry=0x77e9e386b4a8,
> filename=<optimized out>, flags=<optimized out>,
>     int_cb=<optimized out>, options=0x77e9e386b540, whitelist=0x0,
> blacklist=blacklist at entry=0x0, parent=parent at entry=0x0) at
> libavformat/avio.c:347
> #11 0x00000000005d2bc0 in ffio_open_whitelist (s=0x5b9ade0,
> filename=<optimized out>, flags=<optimized out>, int_cb=<optimized out>,
>     options=<optimized out>, whitelist=<optimized out>, blacklist=0x0) at
> libavformat/aviobuf.c:1046
> #12 0x000000000067d8b5 in io_open_default (s=<optimized out>,
> pb=<optimized out>, url=<optimized out>, flags=<optimized out>,
>     options=<optimized out>) at libavformat/options.c:112
> #13 0x00000000006d82a3 in init_input (options=0x77e9e386b540,
> filename=0x77e9e386c830 "rtmp://localhost/publish/if_livestream live=1
> buffer=0",
>     s=0x5b9adc0) at libavformat/utils.c:383
> #14 avformat_open_input (ps=ps at entry=0x77e9e386b608,
>     filename=filename at entry=0x77e9e386c830 "rtmp://localhost/publish/if_livestream
> live=1 buffer=0", fmt=fmt at entry=0x0, options=0x5b9a868)
>     at libavformat/utils.c:497
> #15 0x000000000048d18d in open_input_file (o=o at entry=0x77e9e386b710,
> filename=<optimized out>) at ffmpeg_opt.c:982
> #16 0x0000000000490c5f in open_files (inout=0x137fc26 "input",
> open_file=0x48b9f0 <open_input_file>, l=<optimized out>, l=<optimized out>)
>     at ffmpeg_opt.c:3069
> #17 ffmpeg_parse_options (argc=argc at entry=27, argv=argv at entry=0x77e9e386c4b8)
> at ffmpeg_opt.c:3106
> #18 0x000000000047eb0d in main (argc=27, argv=0x77e9e386c4b8) at
> ffmpeg.c:4325
>
> Thanks again,
>
> Junior
>
> On Sat, Aug 13, 2016 at 7:21 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
> wrote:
>
>> Hi!
>>
>> 2016-08-12 15:57 GMT+02:00 Junior <wpajunior at gmail.com>:
>>
>> > ffmpeg version 3.1.2 Copyright (c) 2000-2016 the FFmpeg developers
>>
>> Is the issue reprodicible with current FFmpeg git head?
>>
>> Please provide a backtrace of FFmpeg when it hangs.
>>
>> Carl Eugen
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
>
>


More information about the ffmpeg-user mailing list