How to run ffplay as a window-less process?

点点圈 提交于 2019-12-10 14:15:49

问题


I am running ffplay as a background process which supplies image data to my main UI process. I have set "SDL_VIDEODRIVER = dummy" to suppress the ffplay video being shown in a SDL window.

The issue is that the ffplay process still appears as an application window (dock, CMD+TAB entries etc.) even if the video output window is not displayed. How can I avoid that?


回答1:


The option -nodisp worked fine for me (together with -autoexit).

Tested in a Ubuntu 18.04, ffmpeg 3.4.6:

ffplay -f lavfi -i "sine=frequency=1000:duration=5" -autoexit -nodisp

Source: [FFmpeg-user] ffplay for audio only




回答2:


The dock entry was being added by SDLMain.m which needs to be compiled into ffplay for it to play on a Mac. After commenting the following lines in SDLMain.m, ffplay is running as a window-less process.

//#ifdef SDL_USE_CPS
//    {
//        CPSProcessSerNum PSN;
//        /* Tell the dock about us */
//        if (!CPSGetCurrentProcess(&PSN))
//            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
//                if (!CPSSetFrontProcess(&PSN))
//                    [NSApplication sharedApplication];
//    }
//#endif /* SDL_USE_CPS */

/* Set up the menubar */
//[NSApp setMainMenu:[[NSMenu alloc] init]];
//setApplicationMenu();
//setupWindowMenu();

Edit This only affects Mac since we don't need the SDLMain.m wrapper around int main() on other platforms



来源:https://stackoverflow.com/questions/11831214/how-to-run-ffplay-as-a-window-less-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!