Opened 8 days ago

Last modified 8 days ago

#7535 new defect

FFMpeg freezes without any error message on incomplete encrypted segment received

Reported by: mirkokg 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 (1)

comment:1 Changed 8 days ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Priority changed from critical to normal

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

Note: See TracTickets for help on using tickets.