it will make GET request to the specified URL which might be quite
undesirable (e.g. consider website behind Cloudflare).
Of course it's not panacea, it might be still possible to come with
header which would be accepted by DetectMIME() but cause some strange
FFmpeg's demuxer behavior because we're calling avformat_open_input()
when dumping frame anyway. So another improvement would be to pass
desired demuxer from processVideo().
Probing user-specified files with FFmpeg might be rather dangerous. For example if you pass it similar input:
it will make GET request to the specified URL which might be quite undesirable (e.g. consider website behind Cloudflare).
Of course it's not panacea, it might be still possible to come with header which would be accepted by DetectMIME() but cause some strange FFmpeg's demuxer behavior because we're calling avformat_open_input() when dumping frame anyway. So another improvement would be to pass desired demuxer from processVideo().
More details regarding FFmpeg's HLS handling: https://news.ycombinator.com/item?id=10893301