diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bdfe21f9..6e4a67175 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ endif() project(obs-studio) option(BUILD_CAPTIONS "Build captions" FALSE) +option(DEBUG_FFMPEG_MUX "Debug FFmpeg muxer subprocess" FALSE) set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index 3702875e8..9a58322f9 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -11,6 +11,10 @@ if (NOT "${FFMPEG_AVCODEC_LIBRARIES}" STREQUAL "") list(REMOVE_ITEM FFMPEG_LIBRARIES ${FFMPEG_AVCODEC_LIBRARIES}) endif() +if(DEBUG_FFMPEG_MUX) + add_definitions(-DSHOW_SUBPROCESSES) +endif() + if(UNIX) if (NOT APPLE) find_package(X11 REQUIRED) diff --git a/libobs/util/pipe-windows.c b/libobs/util/pipe-windows.c index ad8247987..18c177911 100644 --- a/libobs/util/pipe-windows.c +++ b/libobs/util/pipe-windows.c @@ -57,11 +57,15 @@ static inline bool create_process(const char *cmd_line, HANDLE stdin_handle, si.hStdOutput = stdout_handle; si.hStdError = stderr_handle; + DWORD flags = 0; +#ifndef SHOW_SUBPROCESSES + flags = CREATE_NO_WINDOW; +#endif + os_utf8_to_wcs_ptr(cmd_line, 0, &cmd_line_w); if (cmd_line_w) { success = !!CreateProcessW(NULL, cmd_line_w, NULL, NULL, true, - CREATE_NO_WINDOW, NULL, NULL, &si, - &pi); + flags, NULL, NULL, &si, &pi); if (success) { *process = pi.hProcess; diff --git a/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt b/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt index 2f91e09b2..754a1ab58 100644 --- a/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt +++ b/plugins/obs-ffmpeg/ffmpeg-mux/CMakeLists.txt @@ -1,5 +1,9 @@ project(obs-ffmpeg-mux) +if(DEBUG_FFMPEG_MUX) + add_definitions(-DDEBUG_FFMPEG) +endif() + find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat) include_directories(${FFMPEG_INCLUDE_DIRS})