I discovered while testing that the first split would always be one GOP
too long (e.g. 1m2s instead of 1m) due to the fact that b-frames and
negative start DTSes were not accounted for.
This is now fixed by setting the start_time to the nonzero negative DTS
produced for the first packet. Additionally, a small tolerance of 1 ms
was also added to account for rounding issues present in the first GOP.
Originally, before file splitting was introduced, I made the choice to
simply ignore the last frame in the packet queue of the muxer, because
frame N+1 is required to properly determine the duration and I figured
nobody would notice if their recording is one frame short.
However, when using frame splitting this would result in the last frame
before the split being dropped. To fix this, we can simply reuse the
previous sample's duration for the final sample in a file. Since OBS
only does CFR, they should all be identical anyway.
Use the new `OBS_ENCODER_CAP_MULTITRACK_DYN_BITRATE` flag when
streaming with multiple tracks, instead of relying on the single-
track `OBS_ENCODER_CAP_DYN_BITRATE` flag. In multitrack cases where
multiple codecs are being used (e.g. mixed AVC and HEVC), all encoders
must support the multitrack capability flag otherwise the dynamic
bitrate (DBR) feature is disabled for the streaming session.
Chapters take their timestamp from the total video frame time. With
file splitting enabled in recording settings, the time offset since
the start of the current split was made needs to be considered before
submitting chapters to the muxer.
Change to subtract start_time of the current output from the chapter
timestamp.
The conversion to milliseconds rounds down. Rounding down DTS and CT
values independently results in a cumulative error that results in the
PTS (DTS + CT) being incorrect (off-by-one).
With the removal of all legacy code paths, obsconfig.h always exists and
the compile definition always gets set. As such, it's no longer
necessary to check for it.
As removing the definition itself could be seen as a breaking change,
this simply moves the definition to pc.in and cmake.in files for now to
preserve the value for plugins that might expect this to be set. We may
remove the definition entirely in a later release.
When network optimizations are enabled, `new_socket_loop` is enabled,
and an accurate total output bitrate is required. Include the audio
bitrates in this calculation.
Changes the MP4 muxer to attempt to use the path generation logic if
a path is not explicitly specified. This allows MP4 muxer outputs to
be configured with file splitting, without requiring both the `path`
and `directory`+`format` fields to be specified (saving effort on
the side of developers of custom plugins).
Clang 19 has become more strict about mixing different enum types, which
resulted in an error building multimedia/obs-studio on FreeBSD:
/wrkdirs/usr/ports/multimedia/obs-studio/work/obs-studio-30.2.3/plugins
/obs-outputs/flv-mux.c:659:37: error: bitwise operation between
different enumeration types ('enum multitrack_type_t' and 'enum
packet_type_t') [-Werror,-Wenum-enum-conversion]
MbedTLS changed a lot of internals with their LTS version 3.6.0, which
are incompatible with the find module currently shipped with
OBS Studio.
The solution requires several changes to be applied at once:
* Rename the generated target name to MbedTLS::mbedtls to match the
name used by MbedTLS' own CMake package
* Update find module to use the updated target name(s)
* Set CMAKE_FIND_PACKAGE_PREFER_CONFIG to TRUE before trying to find
MbedTLS to ensure that CMake package files are used with priority
(Those are shipped only with MbedTLS 3.6.0 in obs-deps).
* A deprecation warning is emitted if the find module is used with
MbedTLS 3.6.0 available