从源码看还是video驱动的问题,有时间继续看看:
/* Select the proper video driver */ index = 0; video = NULL; if (driver_name == NULL) { driver_name = SDL_getenv("SDL_VIDEODRIVER"); } if (driver_name != NULL) { for (i = 0; bootstrap[i]; ++i) { if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) { if (bootstrap[i]->available()) { video = bootstrap[i]->create(index); break; } } } } else { for (i = 0; bootstrap[i]; ++i) { if (bootstrap[i]->available()) { video = bootstrap[i]->create(index); if (video != NULL) { break; } } } } if (video == NULL) { if (driver_name) { return SDL_SetError("%s not available", driver_name); } return SDL_SetError("No available video device"); }
你好,请问一下,您的这个问题最后解决了吗?我现在遇到跟您一样的问题
]]>你用哪个编译器?
请问晕哥有没遇交叉编译SDL1.2.15时,编译器无法连接到libpulse.so和libpulse_simple.so这2个库的问题?
]]>应该是免配置的, 因为搜到的 ubuntu sdl2 ffplay 只要安装 sdl2 & directfb 包就可以跑。
或者你在这个地方跟踪进去, 看是什么原因导致错误:
directfb not available
从源码看还是video驱动的问题,有时间继续看看:
/* Select the proper video driver */
index = 0;
video = NULL;
if (driver_name == NULL) {
driver_name = SDL_getenv("SDL_VIDEODRIVER");
}
if (driver_name != NULL) {
for (i = 0; bootstrap[i]; ++i) {
if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) {
if (bootstrap[i]->available()) {
video = bootstrap[i]->create(index);
break;
}
}
}
} else {
for (i = 0; bootstrap[i]; ++i) {
if (bootstrap[i]->available()) {
video = bootstrap[i]->create(index);
if (video != NULL) {
break;
}
}
}
}
if (video == NULL) {
if (driver_name) {
return SDL_SetError("%s not available", driver_name);
}
return SDL_SetError("No available video device");
}
或者你在这个地方跟踪进去, 看是什么原因导致错误:
directfb not available
https://whycan.cn/t_1356.html#p6702
我这个勾选 directfb 之后, cairo 就可以跑了。
这能说明directfb正常工作了吧,看帖子里你用的是SDL1。。。
晕哥,编译后,directfb需要怎么配置吗,就是那个directfbrc文件,还是免配置直接运行的
]]>我这个勾选 directfb 之后, cairo 就可以跑了。
]]>https://www.ffmpeg.org/ffmpeg-devices.html
4.4.2 Examples
Play a file on framebuffer device /dev/fb0. Required pixel format depends on current framebuffer settings.ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
我用buildroot2017制作根文件系统,就是这荔枝派教程帖子里 https://whycan.cn/t_561.html ,目的是想用用ffplay。
所以选中ffmpeg和ffplay编译,因为ffplay需要SDL2支持,所以buildroot自动选中了SDL2。
buildroot编译成功后测试:ffplay xx.mp4
也是提示:Could not initialize SDL - No available video device。
一翻搜索,说是SDL2需要directfb。
buildroot选中directfb,继续编译测试。
设置export SDL_VIDEODRIVER=directfb,运行ffplay,显示:
Could not initialize SDL - directfb not available
(Did you set the DISPLAY variable?)
后面怎么破。。。
]]>刚刚下载 最新的 SDL 2.0 代码仔细研究, 发现居然没有 fbcon,
后来一番操作之后, 确认只有 1.2 版本才有 fbcon,
你用的应该是 2.0, 下载一个 1.2 版本再试一试.
谢谢晕哥,换了1.2.15的立马就出图像了,之前搞的晕死了,多谢大神
]]>后来一番操作之后, 确认只有 1.2 版本才有 fbcon,
你用的应该是 2.0, 下载一个 1.2 版本再试一试.
]]>http://sdl.beuc.net/sdl.wiki/SDL_envvars
#SDL_VIDEODRIVER=fbcon ./test
现在又显示SDL could not initialize! SDL_Error: fbcon not available
Failed to initialize!
我把SDL_FBDEV也设置了/dev/fb0
]]>