[FFmpeg-trac] #7975(avformat:new): HLS HTTP PUT fails with http_persistent and connection closed

FFmpeg trac at avcodec.org
Fri Jun 28 16:34:52 EEST 2019


#7975: HLS HTTP PUT fails with http_persistent and connection closed
------------------------------------+------------------------------------
             Reporter:  ianklassen  |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:  hls http    |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by ianklassen):

 The default requests per connection for nginx is 100
 (http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests)
 so the bug wouldn't have been triggered in your test. First set
 "keepalive_requests 10;" and then retry.

 Here's my output.

 {{{
 [https @ 0000025e52f46000] HTTP error 404 Not Found
 [hls @ 0000025e4f6930c0] Opening
 'http://www.sampletestsite.com/stream0.ts' for writing
 Output #0, hls, to 'http://www.sampletestsite.com/stream.m3u8':
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream1.ts' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream2.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream3.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream4.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream5.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream6.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream7.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream8.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream9.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream10.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream11.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream12.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [https @ 0000025e52f3d940] Opening
 'http://www.sampletestsite.com/stream13.ts' for writing
 [https @ 0000025e538beac0] Opening
 'http://www.sampletestsite.com/stream.m3u8' for writing
 [tls @ 0000025e515f0c80] Error in the push function.
 av_interleaved_write_frame(): I/O error
 frame= 2348 fps= 30 q=15.0 Lsize=N/A time=00:01:18.39 bitrate=N/A dup=4
 drop=2 speed=0.992x
 video:6393kB audio:1075kB subtitle:0kB other streams:0kB global
 headers:0kB muxing overhead: unknown
 [aac @ 0000025e4f6ac640] Qavg: 10125.062
 Conversion failed!
 }}}

 What's interesting is that multiple PUT requests seem to be merged
 together as you can see in my Apache log. The value after the IP address
 is the request sequence in the current connection.

 {{{
 127.0.0.1 (0) [28/Jun/2019:08:16:45 -0500] (0s) "GET /stream.m3u8
 HTTP/1.1" 404 45 "Lavf/58.28.100"
 127.0.0.1 (0) [28/Jun/2019:08:16:51 -0500] (1s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (1) [28/Jun/2019:08:16:46 -0500] (10s) "PUT /stream0.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (1) [28/Jun/2019:08:16:50 -0500] (5s) "PUT /stream1.ts HTTP/1.1"
 200 - "Lavf/58.28.100"
 127.0.0.1 (1) [28/Jun/2019:08:16:56 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (2) [28/Jun/2019:08:17:02 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (3) [28/Jun/2019:08:16:56 -0500] (12s) "PUT /stream2.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (3) [28/Jun/2019:08:17:02 -0500] (5s) "PUT /stream3.ts HTTP/1.1"
 200 - "Lavf/58.28.100"
 127.0.0.1 (3) [28/Jun/2019:08:17:08 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (4) [28/Jun/2019:08:17:08 -0500] (5s) "PUT /stream4.ts HTTP/1.1"
 200 - "Lavf/58.28.100"
 127.0.0.1 (4) [28/Jun/2019:08:17:14 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (5) [28/Jun/2019:08:17:20 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (6) [28/Jun/2019:08:17:26 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (7) [28/Jun/2019:08:17:14 -0500] (18s) "PUT /stream5.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (7) [28/Jun/2019:08:17:20 -0500] (12s) "PUT /stream6.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (7) [28/Jun/2019:08:17:26 -0500] (6s) "PUT /stream7.ts HTTP/1.1"
 200 - "Lavf/58.28.100"
 127.0.0.1 (7) [28/Jun/2019:08:17:32 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (8) [28/Jun/2019:08:17:38 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (9) [28/Jun/2019:08:17:44 -0500] (2s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (10) [28/Jun/2019:08:17:32 -0500] (18s) "PUT /stream8.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (10) [28/Jun/2019:08:17:38 -0500] (12s) "PUT /stream9.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (10) [28/Jun/2019:08:17:44 -0500] (6s) "PUT /stream10.ts
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (10) [28/Jun/2019:08:17:50 -0500] (1s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 127.0.0.1 (0) [28/Jun/2019:08:18:03 -0500] (0s) "PUT /stream.m3u8
 HTTP/1.1" 200 - "Lavf/58.28.100"
 }}}

 You can see that the last segment seen by the web server was stream10.ts.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7975#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list