Opened 5 years ago

Closed 5 years ago

#7535 closed defect (needs_more_info)

FFMpeg freezes without any error message on incomplete encrypted segment received

Reported by: Mirko Tomic Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I noticed an issue in FFMpeg, while streaming AES encrypted HLS stream as input.
If there is connection problem, and chunk download ends prematurely, without any server error, FFMpeg will freeze and reports no error messages.

I used http debugging proxy to trace the connections to hls stream, and I noticed that FFMpeg became frozen when downloaded chunk was incomplete.

Content length, in the response header was 3009520, and because of connection issue that happened, received HTTP body size was only ~175KB.

I tried both latest nightly build and stable on both Mac and Windows.

Same issue occurs on all versions and platforms that I tested.

Obviously, on live stream, this happens randomly, only when connection issue like this occurs.

How to reproduce:

This is bit tricky to reproduce, but doable. You need to create a specially serviced HLS Stream with keys and chunks that will deliberately cut the response body for some of the chunks, to any length.

Stream probably has to be AES encrypted, but to be honest I didn't try with unencrypted stream.

I didn't test if the same happens in ffplay.

Proposal for the fix:

Add an option to try to resume transfer automatically if Content-Length differs from body size and if HTTP server supports resume.

Change History (2)

comment:1 by Carl Eugen Hoyos, 5 years ago

Component: ffmpegundetermined
Priority: criticalnormal

Please provide the command line you tested together with the complete, uncut console output and a backtrace to make this a valid ticket.

comment:2 by Carl Eugen Hoyos, 5 years ago

Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.