FFmpeg does not add query string parameter to subsequent request URL

When processing HLS/Dash playlist (where query-param used for auth) - ffmpeg doesn't add those query-strings in data chunk requests, which results in 403 forbidden error form the server.

Example:

ffmpeg -i "http://example.com/playlist.m3u8?auth=foo" out.mp4

chunk request is like: http://example.com/chunk1.ts - instead of http://example.com/chunk1.ts?auth=foo

Is there any option to circumvent that or is it not supported, or a bug?


Solution 1:

HLS works this way: The query string parameters (if any) are used to query the M3U8 chunklist, which in turn contains the URLs for the chunks. If these URLs from the chunklist (i.e. that you have no control over) do not contain query parameters, then none will be used to query them.

You can work around this by proxying the M3U8 through a web service you control, that adds the query parameters to the chunk list.