[Libav-user] jpg over http(s)

Kent Friis leeloored at gmx.com
Mon Jul 11 22:08:10 EEST 2022


I'm writing a video player using libav*, and as a part of this, I need
to download and display thumbnails. I use SDL_Image for local jpg and
png files, but as I need to grab thumbnails from AVI files, and
libav* speaks http(s), I though it would be easier to use it for all
thumbnails that are outside of SDL_Image capabilities, even jpg.

However, twitch thumbnails don't work. They give the error:

Could not find codec parameters for stream 0 (Video: mjpeg,
none(bt470bg/unknown/unknown)): unspecified size Consider increasing
the value for the 'analyzeduration' (0) and 'probesize' (5000000)
options

I can reproduce the problem with ffplay:

ffplay 'https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/9a64ec577e42e15dde_monstercat_52314706864_4045032770/thumb/custom-4f1e250e-1c98-4a9c-b1c1-c0d01e631503-320x180.jpeg'

Curiously, if I combine ffplay with curl, it works:

curl 'https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/9a6864ec577e42e15dde_monstercat_52314706864_4045032770/thumb/custom-4f1e250e-1c98-4a9c-b1c1-c0d01e631503-320x180.jpeg' | ffplay -

That's surprising, because as far as I know, pipes are even more
restricted than http(s) connections.

I tried increasing both analyzeduration and probesize without any
difference (and the file is something like 16KB, so I find it unlikely
that should be the problem).

I cannot rule out that twitch may be doing something different
depending on whether it sees ffplay or curl, unfortunately these days
everything uses https making these things near impossible to debug.

The problem occurs with both ffmpeg 4.4.2 and 5.0.1.

Any ideas? Possible bug?


More information about the Libav-user mailing list