ffmpeg - How to pass http headers?

前端 未结 3 1648
别那么骄傲
别那么骄傲 2021-01-30 23:36

I need to pass http headers (user agent and ip) to an ffmpeg command.

I use the following command:

ffmpeg  -y -timeout 5000000 -map 0:0 -an -sn -f md5 -          


        
3条回答
  •  时光取名叫无心
    2021-01-31 00:06

    For set x:1 and y:2 for header ffmpeg request, use this:

    ffmpeg -headers $'x:1\r\ny:2\r\n' -i 'http://sample.com' -y 'sample.mp4' -v debug
    

    Result:

    [http @ 0x358be00] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
    [http @ 0x358be00] request: GET / HTTP/1.1
    User-Agent: Lavf/57.76.100
    Accept: */*
    Range: bytes=0-
    Connection: close
    Host: example.com
    Icy-MetaData: 1
    x:1
    y:2
    

提交回复
热议问题