[FFmpeg-trac] #4930(avformat:open): FFmpeg fails to detect video stream on Encrypted HLS

FFmpeg trac at avcodec.org
Tue Jul 26 14:54:32 EEST 2016


#4930: FFmpeg fails to detect video stream on Encrypted HLS
-------------------------------------+-------------------------------------
             Reporter:               |                    Owner:  anssi
  gorilla.maguila                    |                   Status:  open
                 Type:  defect       |                Component:  avformat
             Priority:  normal       |               Resolution:
              Version:  git-master   |               Blocked By:
             Keywords:  hls bounty   |  Reproduced by developer:  1
             Blocking:               |
Analyzed by developer:  1            |
-------------------------------------+-------------------------------------
Changes (by anssi):

 * analyzed:  0 => 1


Comment:

 This is because the HLS demuxer clears AVFMTCTX_NOHEADER for the mpegts
 subdemuxer, which prevents the usual "look a bit more in case more streams
 are found" behavior of avformat_find_stream_info(), causing the video
 stream to sometimes not be found with the HLS stream of this ticket.

 Thanks to mpegts improvements (6eda91ad54fd321461 "mpegts: stop analyzing
 when pmt for all programs have been found") made in the meantime I think
 it should be okay to remove that now, thus allowing all streams to be
 found.

 The following patch fixes this issue, and I expect to push that within a
 day unless any problems surface in my testing:
 https://github.com/anssih/FFmpeg/commit/2fd2c0bf7478ec481792eab7f42085af0f9e109d

 There is also a related issue in avformat_find_stream_info() affecting
 FFmpeg 3.1 and later which causes some needlessly-long probing of the
 sample in comment 5, which should be fixed by this patch (which I have
 submitted for review on ffmpeg-devel@):
 https://github.com/anssih/FFmpeg/commit/be52a0d8c1ae244411091d57a72fc3e773872f6b

 Related: My first solution involved adding support for dynamic streams
 into the HLS demuxer (propagate new streams from subdemuxer), but as that
 ultimately turned out to not be necessary I won't be applying that at this
 time (as it adds complexity and risks regressions without having any
 sample it helps with). In case that feature or parts of it turn out to be
 useful in the future I've put the code here:
 https://github.com/anssih/FFmpeg/commit/68eac58088b27593b28eba33632167ed2ebb23f5

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


More information about the FFmpeg-trac mailing list