ffmpeg打开流时,报错,url打印出来没有问题,但是在ffmpeg中乱码了。
Failed to resolve hostname 192: The name does not resolve for the supplied parameters
初步猜测是html传输url,可能编码格式不一样,导致的乱码。
原因:
int byte_url(int cam_id,char* url){
if (avformat_open_input(&pFormatCtx, url, NULL, &options) != 0) {
}
}
char* url做参数会引起乱码,改为std::string好像就好了。
本文探讨了在使用FFmpeg打开流时遇到的乱码问题,初步分析为html传输url编码不一致所致。通过将参数类型从char*改为std::string成功解决了乱码问题。
2730

被折叠的 条评论
为什么被折叠?



