How to run ffplay as a window-less process?
Solution 1
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
Solution 2
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
Related videos on Youtube
S B
Updated on June 29, 2022Comments
-
S B almost 2 years
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?