[FFmpeg-trac] #9010(avformat:new): ffmpeg built with schannel freezes when outputting HLS with http_persistent

FFmpeg trac at avcodec.org
Mon Sep 13 05:23:41 EEST 2021


#9010: ffmpeg built with schannel freezes when outputting HLS with http_persistent
-------------------------------------+-------------------------------------
             Reporter:  r1ch         |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  important    |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  hls          |               Blocked By:
  schannel regression                |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Steven Liu):

 Replying to [comment:6 ushadow]:
 > I can reproduce the same problem with a simple nginx HTTP server with
 similar setup as in #7975. HTTP works. HTTPS with schannel and '''no'''
 http_persistent on Windows works. But HTTPS with schannel and
 http_persistent on Windows doesn't work. Compiled ffmpeg from latest
 snapshopt. Here is the log:
 >
 > {{{
 > Log level: 48
 > Command line:
 > "C:\\cygwin64\\usr\\local\\bin\\ffmpeg.exe" -report -re -i
 bbb_sunflower_1080p_30fps_normal.ts -acodec copy -vcodec copy -g 60
 -hls_flags +append_list -hls_list_size 0 -hls_playlist_type event
 -hls_time 6 -keyint_min 60 -method PUT -http_persistent 1 -sc_threshold 0
 https://127.0.0.1/stream.m3u8
 > ffmpeg version N-103483-gf3f9041302 Copyright (c) 2000-2021 the FFmpeg
 developers
 >   built with gcc 11 (GCC)
 >   configuration: --arch=x86_64 --target-os=mingw32 --cross-
 prefix=x86_64-w64-mingw32- --prefix=/usr/local --pkg-config=pkg-config
 --pkg-config-flags=--static --extra-cflags=-static --extra-ldflags=-static
 --extra-libs='-lm -lz -fopenmp' --enable-static --disable-shared --enable-
 nonfree --enable-gpl --enable-libfdk-aac --enable-libfribidi --enable-
 libx264 --enable-schannel
 >   libavutil      57.  4.101 / 57.  4.101
 >   libavcodec     59.  7.100 / 59.  7.100
 >   libavformat    59.  5.100 / 59.  5.100
 >   libavdevice    59.  0.101 / 59.  0.101
 >   libavfilter     8.  7.100 /  8.  7.100
 >   libswscale      6.  0.100 /  6.  0.100
 >   libswresample   4.  0.100 /  4.  0.100
 >   libpostproc    56.  0.100 / 56.  0.100
 > Splitting the commandline.
 > Reading option '-report' ... matched as option 'report' (generate a
 report) with argument '1'.
 > Reading option '-re' ... matched as option 're' (read input at native
 frame rate; equivalent to -readrate 1) with argument '1'.
 > Reading option '-i' ... matched as input url with argument
 'bbb_sunflower_1080p_30fps_normal.ts'.
 > Reading option '-acodec' ... matched as option 'acodec' (force audio
 codec ('copy' to copy stream)) with argument 'copy'.
 > Reading option '-vcodec' ... matched as option 'vcodec' (force video
 codec ('copy' to copy stream)) with argument 'copy'.
 > Reading option '-g' ... matched as AVOption 'g' with argument '60'.
 > Reading option '-hls_flags' ... matched as AVOption 'hls_flags' with
 argument '+append_list'.
 > Reading option '-hls_list_size' ... matched as AVOption 'hls_list_size'
 with argument '0'.
 > Reading option '-hls_playlist_type' ... matched as AVOption
 'hls_playlist_type' with argument 'event'.
 > Reading option '-hls_time' ... matched as AVOption 'hls_time' with
 argument '6'.
 > Reading option '-keyint_min' ... matched as AVOption 'keyint_min' with
 argument '60'.
 > Reading option '-method' ... matched as AVOption 'method' with argument
 'PUT'.
 > Reading option '-http_persistent' ... matched as AVOption
 'http_persistent' with argument '1'.
 > Reading option '-sc_threshold' ... matched as AVOption 'sc_threshold'
 with argument '0'.
 > Reading option 'https://127.0.0.1/stream.m3u8' ... matched as output
 url.
 > Finished splitting the commandline.
 > Parsing a group of options: global .
 > Applying option report (generate a report) with argument 1.
 > Successfully parsed a group of options.
 > Parsing a group of options: input url
 bbb_sunflower_1080p_30fps_normal.ts.
 > Applying option re (read input at native frame rate; equivalent to
 -readrate 1) with argument 1.
 > Successfully parsed a group of options.
 > Opening an input file: bbb_sunflower_1080p_30fps_normal.ts.
 > [NULL @ 0000028ae8e09300] Opening 'bbb_sunflower_1080p_30fps_normal.ts'
 for reading
 > [file @ 0000028ae8e0a440] Setting default whitelist 'file,crypto,data'
 > [mpegts @ 0000028ae8e09300] Format mpegts probed with size=2048 and
 score=50
 > [mpegts @ 0000028ae8e09300] stream=0 stream_type=1b pid=100
 prog_reg_desc=
 > [mpegts @ 0000028ae8e09300] stream=1 stream_type=f pid=101
 prog_reg_desc=
 > [mpegts @ 0000028ae8e09300] Before avformat_find_stream_info() pos: 0
 bytes read:32768 seeks:0 nb_streams:2
 > [mpegts @ 0000028ae8e09300] probing stream 1 pp:2500
 > [mpegts @ 0000028ae8e09300] Probe with size=2758, packets=1 detected aac
 with score=51
 > [mpegts @ 0000028ae8e09300] probed stream 1
 > [extract_extradata @ 0000028aea8e5900] nal_unit_type: 9(AUD),
 nal_ref_idc: 0
 > [extract_extradata @ 0000028aea8e5900] nal_unit_type: 7(SPS),
 nal_ref_idc: 3
 > [extract_extradata @ 0000028aea8e5900] nal_unit_type: 8(PPS),
 nal_ref_idc: 3
 > [extract_extradata @ 0000028aea8e5900] nal_unit_type: 6(SEI),
 nal_ref_idc: 0
 > [extract_extradata @ 0000028aea8e5900] nal_unit_type: 5(IDR),
 nal_ref_idc: 3
 > [h264 @ 0000028ae8e0c040] nal_unit_type: 9(AUD), nal_ref_idc: 0
 > [h264 @ 0000028ae8e0c040] nal_unit_type: 7(SPS), nal_ref_idc: 3
 > [h264 @ 0000028ae8e0c040] nal_unit_type: 8(PPS), nal_ref_idc: 3
 > [h264 @ 0000028ae8e0c040] nal_unit_type: 6(SEI), nal_ref_idc: 0
 > [h264 @ 0000028ae8e0c040] nal_unit_type: 5(IDR), nal_ref_idc: 3
 > [h264 @ 0000028ae8e0c040] Format yuv420p chosen by get_format().
 > [h264 @ 0000028ae8e0c040] Reinit context to 1920x1088, pix_fmt: yuv420p
 > [h264 @ 0000028ae8e0c040] no picture
 > [mpegts @ 0000028ae8e09300] max_analyze_duration 5000000 reached at
 5013333 microseconds st:1
 > [mpegts @ 0000028ae8e09300] Packet had TEI flag set; marking as corrupt
 > [mpegts @ 0000028ae8e09300] After avformat_find_stream_info() pos: 0
 bytes read:938128 seeks:2 frames:389
 > Guessed Channel Layout for Input Stream #0.1 : 5.1
 > Input #0, mpegts, from 'bbb_sunflower_1080p_30fps_normal.ts':
 >   Duration: 00:10:34.62, start: 1.400000, bitrate: 3600 kb/s
 >   Program 1
 >     Metadata:
 >       service_name    : Big Buck Bunny, Sunflower version
 >       service_provider: FFmpeg
 >   Stream #0:0[0x100], 151, 1/90000: Video: h264 (High) ([27][0][0][0] /
 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30
 tbr, 90k tbn
 >   Stream #0:1[0x101](und), 238, 1/90000: Audio: aac (LC) ([15][0][0][0]
 / 0x000F), 48000 Hz, 5.1, fltp, 394 kb/s
 > Successfully opened the file.
 > Parsing a group of options: output url https://127.0.0.1/stream.m3u8.
 > Applying option acodec (force audio codec ('copy' to copy stream)) with
 argument copy.
 > Applying option vcodec (force video codec ('copy' to copy stream)) with
 argument copy.
 > Successfully parsed a group of options.
 > Opening an output file: https://127.0.0.1/stream.m3u8.
 > Successfully opened the file.
 > [mpegts @ 0000028aeb127d00] service 1 using PCR in pid=256,
 pcr_period=0ms
 > [mpegts @ 0000028aeb127d00] muxrate VBR, sdt every 1073741822000 ms,
 pat/pmt every 1073741822000 ms
 > [https @ 0000028aeac90a80] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 > [tcp @ 0000028aeaa80c80] Original list of addresses:
 > [tcp @ 0000028aeaa80c80] Address 127.0.0.1 port 443
 > [tcp @ 0000028aeaa80c80] Interleaved list of addresses:
 > [tcp @ 0000028aeaa80c80] Address 127.0.0.1 port 443
 > [tcp @ 0000028aeaa80c80] Starting connection attempt to 127.0.0.1 port
 443
 > [tcp @ 0000028aeaa80c80] Successfully connected to 127.0.0.1 port 443
 > [https @ 0000028aeac90a80] request: GET /stream.m3u8 HTTP/1.1
 > User-Agent: Lavf/59.5.100
 > Accept: */*
 > Range: bytes=0-
 > Connection: close
 > Host: 127.0.0.1
 > Icy-MetaData: 1
 >
 >
 > [hls muxer @ 0000028aeb137f80] Found playlist sequence number: 0
 > [AVIOContext @ 0000028aeac91e00] Statistics: 583 bytes read, 0 seeks
 > Output #0, hls, to 'https://127.0.0.1/stream.m3u8':
 >   Metadata:
 >     encoder         : Lavf59.5.100
 >   Stream #0:0, 0, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B),
 yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 30
 tbr, 90k tbn
 >   Stream #0:1(und), 0, 1/90000: Audio: aac (LC) ([15][0][0][0] /
 0x000F), 48000 Hz, 5.1, fltp, 394 kb/s
 > Stream mapping:
 >   Stream #0:0 -> #0:0 (copy)
 >   Stream #0:1 -> #0:1 (copy)
 > Press [q] to stop, [?] for help
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > [NULL @ 0000028ae8e0c040] nal_unit_type: 7(SPS), nal_ref_idc: 3
 > [NULL @ 0000028ae8e0c040] nal_unit_type: 8(PPS), nal_ref_idc: 3
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
 if it occurs once at the start per stream)
 > [hls @ 0000028aeae79040] Opening 'https://127.0.0.1/stream9.ts' for
 writingx
 > [https @ 0000028aea870cc0] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 > [tcp @ 0000028aeb16a940] Original list of addresses:
 > [tcp @ 0000028aeb16a940] Address 127.0.0.1 port 443
 > [tcp @ 0000028aeb16a940] Interleaved list of addresses:
 > [tcp @ 0000028aeb16a940] Address 127.0.0.1 port 443
 > [tcp @ 0000028aeb16a940] Starting connection attempt to 127.0.0.1 port
 443
 > [tcp @ 0000028aeb16a940] Successfully connected to 127.0.0.1 port 443
 > [https @ 0000028aea870cc0] request: PUT /stream9.ts HTTP/1.1
 > Transfer-Encoding: chunked
 > User-Agent: Lavf/59.5.100
 > Accept: */*
 > Connection: keep-alive
 > Host: 127.0.0.1
 > Icy-MetaData: 1
 >
 >
 >
 > Received windows signal 0
 >
 > Received windows signal 0
 > [tls @ 0000028aeb16a880] Unable to read from socket
 > [hls @ 0000028aeae79040] upload segment failed, will retry with a new
 http session.
 > [AVIOContext @ 0000028aeac920c0] Statistics: 0 seeks, 157 writeouts
 > [tls @ 0000028aeb16a880] Failed to send close message
 > [hls @ 0000028aeae79040] Opening 'https://127.0.0.1/stream9.ts' for
 writing
 > [https @ 0000028aea870cc0] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 > [tcp @ 0000028aeb16a940] Original list of addresses:
 > [tcp @ 0000028aeb16a940] Address 127.0.0.1 port 443
 > [tcp @ 0000028aeb16a940] Interleaved list of addresses:
 > [tcp @ 0000028aeb16a940] Address 127.0.0.1 port 443
 > [tcp @ 0000028aeb16a940] Starting connection attempt to 127.0.0.1 port
 443}}}
 >
 >
 >
 >
 >
 >
 Try this patch please:

 https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210913021204.22138-1-lq@chinaffmpeg.org/
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9010#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list