23

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?

Xantium
  • 11,201
  • 10
  • 62
  • 89
S B
  • 8,134
  • 10
  • 54
  • 108

2 Answers2

27

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

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
0

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

Community
  • 1
  • 1
S B
  • 8,134
  • 10
  • 54
  • 108