当前位置: 动力学知识库 > 问答 > 编程问答 >

pyffmpeg - set useragent in ffmpeg

问题描述:

How to set useragent in ffmpeg ?.

I implemented SWF verification in Media server and allowed some user agents for not to check SWF. But Problem is, I'm unable to set useragent in FFMPEG. As I need to repubish one of my stream with low bit rate to core server using ffmpeg.

FFMPEG Version : ffmpeg version 1.2.6-7:1.2.6-1~trusty1

SWF verification enabled in 172.20.1.10 server

Tried formats :

ffmpeg -re -i "rtmp://10.11.12.13/live/mystreams -c copy -f flv "rtmp://172.20.1.10/live/testnew -headers "UserAgent: 'FMLE/3.0 (compatible; FMSc/1.0)'"

ffmpeg -re -i "rtmp://10.11.12.13/live/mystreams -c copy -f flv "rtmp://172.20.1.10/live/testnew -user_agent 'FMLE/3.0 (compatible; FMSc/1.0)'"

ffmpeg -re -i "rtmp://10.11.12.13/live/mystreams -c copy -f flv "rtmp://172.20.1.10/live/testnew -user-agent 'FMLE/3.0 (compatible; FMSc/1.0)'"

网友答案:
-headers 'User-Agent: "FMLE/3.0 (compatible; FMSc/1.0)"'

User agent - Wikipedia

Also, you might need to include CRLF:

-headers $'User-Agent: "FMLE/3.0 (compatible; FMSc/1.0)"\r\n'

How to enable cookies in ffmpeg HLS

网友答案:

this worked for me:

-user-agent "Mozilla/5.0 (compatible; Companybot/1.0; +http://www.Thecompany.com)"
分享给朋友:
您可能感兴趣的文章:
随机阅读: