specifying header for http post

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

specifying header for http post

FFmpeg-users mailing list
Hello

I am trying to add an authorization header to a http post output, but somehow cant seem to succeed.

my request looks like this:

ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -vframes 1  -headers "Authorization: foo" -f image2 -chunked_post 0 https://foo <https://foo/>.org/endpoint -loglevel trace


but the trace doesnt mention the auth header at all or respect the chunked_post 0. am I missing something?

Best

Daniel Oberhoff

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: specifying header for http post

Gyan Doshi-2


On 2021-03-30 20:44, Daniel Oberhoff via ffmpeg-user wrote:

> Hello
>
> I am trying to add an authorization header to a http post output, but somehow cant seem to succeed.
>
> my request looks like this:
>
> ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -vframes 1  -headers "Authorization: foo" -f image2 -chunked_post 0 https://foo <https://foo/>.org/endpoint -loglevel trace
>
>
> but the trace doesnt mention the auth header at all or respect the chunked_post 0. am I missing something?

You need to use the image2 option protocol_opts to pass on these options.

See the last example at http://www.ffmpeg.org/ffmpeg-formats.html#Options-7

Regards,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: specifying header for http post

FFmpeg-users mailing list


> On Mar 30, 2021, at 7:46 PM, Gyan Doshi <[hidden email]> wrote:
>
>
>
> On 2021-03-30 20:44, Daniel Oberhoff via ffmpeg-user wrote:
>> Hello
>>
>> I am trying to add an authorization header to a http post output, but somehow cant seem to succeed.
>>
>> my request looks like this:
>>
>> ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -vframes 1  -headers "Authorization: foo" -f image2 -chunked_post 0 https://foo <https://foo/>.org/endpoint -loglevel trace
>>
>>
>> but the trace doesnt mention the auth header at all or respect the chunked_post 0. am I missing something?
>
> You need to use the image2 option protocol_opts to pass on these options.
>
> See the last example at http://www.ffmpeg.org/ffmpeg-formats.html#Options-7
Hmm, that doesnt seem to work.

-protocol_opts headers="Authorization: feb6c4ec3562a15e450fe07568e62e2f”

gave me

Error setting option protocol_opts to value headers="Authorization: feb6c4ec3562a15e450fe07568e62e2f".
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --


:(

Best

Daniel

ps: also tried escaping quotes and so on...

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: specifying header for http post

FFmpeg-users mailing list


> On Mar 31, 2021, at 12:00 AM, Daniel Oberhoff <[hidden email]> wrote:
>
>
>
>> On Mar 30, 2021, at 7:46 PM, Gyan Doshi <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>
>>
>> On 2021-03-30 20:44, Daniel Oberhoff via ffmpeg-user wrote:
>>> Hello
>>>
>>> I am trying to add an authorization header to a http post output, but somehow cant seem to succeed.
>>>
>>> my request looks like this:
>>>
>>> ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -vframes 1  -headers "Authorization: foo" -f image2 -chunked_post 0 https://foo <https://foo/> <https://foo/ <https://foo/>>.org/endpoint -loglevel trace
>>>
>>>
>>> but the trace doesnt mention the auth header at all or respect the chunked_post 0. am I missing something?
>>
>> You need to use the image2 option protocol_opts to pass on these options.
>>
>> See the last example at http://www.ffmpeg.org/ffmpeg-formats.html#Options-7 <http://www.ffmpeg.org/ffmpeg-formats.html#Options-7>
>
> Hmm, that doesnt seem to work.
>
> -protocol_opts headers="Authorization: feb6c4ec3562a15e450fe07568e62e2f”
>
> gave me
>
> Error setting option protocol_opts to value headers="Authorization: feb6c4ec3562a15e450fe07568e62e2f".
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
> Error initializing output stream 0:0 --
>
>
> :(
ok, figured it out: i need to escape the colon :)

best

daniel


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment