mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
07d504e5c7
Introduce support for delivering BPM (Broadcast Performance Metrics) over SEI (for AVC/H.264 and HEVC/H.265) and OBU (for AV1) unregistered messages. Metrics being sent are the session frame counters, per-rendition frame counters, and RFC3339-based timestamping information to support end-to-end latency measurement. SEI/OBU messages are generated and sent with each IDR frame, and the frame counters are diff-based, meaning the counts reflect the diff between IDRs, not the running totals. BPM documentation is available at [1]. BPM relies on the recently introduced encoder packet timing support and the packet callback mechanism. BPM injection is enabled for an output by registering the `bpm_inject()` callback via `obs_output_add_packet_callback()` function. The callback must be unregistered using `obs_output_remove_packet_callback()` and `bpm_destroy()` must be used by the caller to release the BPM structures. It is important to measure the number of frames successfully encoded by the obs_encoder_t instances, particularly for renditions where the encoded frame rate differs from the canvas frame rate. The encoded_frames counter and `obs_encoder_get_encoded_frames()` API is introduced to measure and report this in the encoded rendition metrics message. [1] https://d50yg09cghihd.cloudfront.net/other/20240718-MultitrackVideoIntegrationGuide.pdf
138 lines
3.3 KiB
CMake
138 lines
3.3 KiB
CMake
cmake_minimum_required(VERSION 3.22...3.25)
|
|
|
|
legacy_check()
|
|
|
|
add_subdirectory(obs-frontend-api)
|
|
|
|
option(ENABLE_UI "Enable building with UI (requires Qt)" ON)
|
|
|
|
if(NOT ENABLE_UI)
|
|
target_disable_feature(obs "User Interface")
|
|
return()
|
|
else()
|
|
target_enable_feature(obs "User Interface")
|
|
endif()
|
|
|
|
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
|
|
find_package(CURL REQUIRED)
|
|
|
|
if(NOT TARGET OBS::json11)
|
|
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/json11" "${CMAKE_BINARY_DIR}/deps/json11")
|
|
endif()
|
|
|
|
if(NOT TARGET OBS::bpm)
|
|
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/bpm" "${CMAKE_BINARY_DIR}/shared/bpm")
|
|
endif()
|
|
|
|
add_executable(obs-studio)
|
|
add_executable(OBS::studio ALIAS obs-studio)
|
|
|
|
target_link_libraries(
|
|
obs-studio
|
|
PRIVATE
|
|
CURL::libcurl
|
|
FFmpeg::avcodec
|
|
FFmpeg::avutil
|
|
FFmpeg::avformat
|
|
OBS::bpm
|
|
OBS::libobs
|
|
OBS::frontend-api
|
|
OBS::json11
|
|
)
|
|
|
|
include(cmake/ui-qt.cmake)
|
|
include(cmake/ui-elements.cmake)
|
|
include(cmake/ui-windows.cmake)
|
|
include(cmake/feature-importers.cmake)
|
|
include(cmake/feature-browserpanels.cmake)
|
|
|
|
if(NOT OAUTH_BASE_URL)
|
|
set(OAUTH_BASE_URL "https://auth.obsproject.com/" CACHE STRING "Default OAuth base URL")
|
|
mark_as_advanced(OAUTH_BASE_URL)
|
|
endif()
|
|
include(cmake/feature-twitch.cmake)
|
|
include(cmake/feature-restream.cmake)
|
|
include(cmake/feature-youtube.cmake)
|
|
include(cmake/feature-whatsnew.cmake)
|
|
|
|
add_subdirectory(frontend-plugins)
|
|
|
|
configure_file(ui-config.h.in ui-config.h)
|
|
|
|
target_sources(
|
|
obs-studio
|
|
PRIVATE
|
|
api-interface.cpp
|
|
auth-base.cpp
|
|
auth-base.hpp
|
|
auth-listener.cpp
|
|
auth-listener.hpp
|
|
auth-oauth.cpp
|
|
auth-oauth.hpp
|
|
display-helpers.hpp
|
|
ffmpeg-utils.cpp
|
|
ffmpeg-utils.hpp
|
|
multiview.cpp
|
|
multiview.hpp
|
|
obf.c
|
|
obf.h
|
|
obs-app-theming.cpp
|
|
obs-app-theming.hpp
|
|
obs-app.cpp
|
|
obs-app.hpp
|
|
obs-proxy-style.cpp
|
|
obs-proxy-style.hpp
|
|
platform.hpp
|
|
qt-display.cpp
|
|
qt-display.hpp
|
|
ui-config.h
|
|
ui-validation.cpp
|
|
ui-validation.hpp
|
|
)
|
|
|
|
target_sources(
|
|
obs-studio
|
|
PRIVATE
|
|
goliveapi-censoredjson.cpp
|
|
goliveapi-censoredjson.hpp
|
|
goliveapi-network.cpp
|
|
goliveapi-network.hpp
|
|
goliveapi-postdata.cpp
|
|
goliveapi-postdata.hpp
|
|
models/multitrack-video.hpp
|
|
multitrack-video-error.cpp
|
|
multitrack-video-error.hpp
|
|
multitrack-video-output.cpp
|
|
multitrack-video-output.hpp
|
|
system-info.hpp
|
|
)
|
|
|
|
if(OS_WINDOWS)
|
|
include(cmake/os-windows.cmake)
|
|
elseif(OS_MACOS)
|
|
include(cmake/os-macos.cmake)
|
|
elseif(OS_LINUX)
|
|
include(cmake/os-linux.cmake)
|
|
elseif(OS_FREEBSD OR OS_OPENBSD)
|
|
include(cmake/os-freebsd.cmake)
|
|
endif()
|
|
|
|
foreach(graphics_library IN ITEMS opengl metal d3d11)
|
|
string(TOUPPER ${graphics_library} graphics_library_U)
|
|
if(TARGET OBS::libobs-${graphics_library})
|
|
target_compile_definitions(
|
|
obs-studio
|
|
PRIVATE
|
|
DL_${graphics_library_U}="$<$<IF:$<PLATFORM_ID:Windows>,TARGET_FILE_NAME,TARGET_SONAME_FILE_NAME>:OBS::libobs-${graphics_library}>"
|
|
)
|
|
else()
|
|
target_compile_definitions(obs-studio PRIVATE DL_${graphics_library_U}="")
|
|
endif()
|
|
endforeach()
|
|
|
|
get_property(obs_module_list GLOBAL PROPERTY OBS_MODULES_ENABLED)
|
|
list(JOIN obs_module_list "|" SAFE_MODULES)
|
|
target_compile_definitions(obs-studio PRIVATE "SAFE_MODULES=\"${SAFE_MODULES}\"")
|
|
|
|
set_target_properties_obs(obs-studio PROPERTIES FOLDER frontend OUTPUT_NAME "$<IF:$<PLATFORM_ID:Windows>,obs64,obs>")
|