Add and register an obs_output_info struct called
ffmpeg_hls_muxer. It uses ffmpeg's HLS muxer to stream output.
Add threading and buffer to reduce skipped frames.
Also add frame drop logic when there are too many packets in the
buffer for congestion control.
(Jim) Allows the ability to use stream keys with ffmpeg-mux -- this will
enable the ability to use it with certain services (such as YouTube)
which allow different protocols (such as HLS)
(Jim) Allows the ability to specify mux settings directly on the
output's structure itself rather than just via settings. This is useful
for network-based muxer outputs (such as HLS).
(Jim) printable_file allows the ability to keep a separate string for
logging which will not contain things like stream keys when used with
outputs such as HLS.
The frontend API event OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED was not
being triggered when hotkeys were used because it was only set to
trigger when the replay buffer button was clicked, not when a hotkey was
used. This fixes it so that the frontend event sends a signal to the
frontend so that hotkeys will actually work.
Add support for VIDEO_CS_SRGB.
Use SMPTE 170M for 601 instead of undef/BT470BG. This is the
American/Chromium way of handling 601.
Add color metadata to the container file as well via ffmpeg-mux.
Automatically generate directories if slashes are present in a recording
name format set in advanced settings or in the replay buffer
prefix/suffix settings.
Fixesobsproject/obs-studio#2416Closesobsproject/obs-studio#2858
This replaces the ffmpeg-encoded-output which had serious issues
(missing headers, muxing issues with non compliant mpegts streams) with
an output grafted from obs-ffmpeg-mux.
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed. Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
(This commit also modifies the UI, obs-ffmpeg, and obs-output modules)
Fixes a long-time regression where the program would lock up if an
encode call fails. Shuts down all outputs associated with the failing
encoder and displays an error message to the user.
Ideally, it would be best if a more detailed error could be displayed to
the user about the nature of the error, though the primary problem is
the encoder errors are typically not something the user would be able to
understand. The current message is a bit of a generic error message;
improvement is welcome.
Another suggestion is to try to have the encoder restart seamlessly,
though it would take a significant amount of work to be able to make it
do something like that properly, and it sort of assumes that encoder
failures are sporadic, which may not necessarily be the case with some
hardware encoders on some systems. It may be better just to use another
encoder in that case. For now, seamless restart is ruled out.
Instead of having ffmpeg-mux stored in a data directory, install it to
the primary binary directory. On windows, this fixes ffmpeg-mux
potentially accessing the wrong FFmpeg libraries (some programs install
them to system32, foolishly), and instead ensures that it uses the ones
that come with the program. On Linux, ensures that a binary is in its
appropriate directory (/usr/bin or /usr/local/bin rather than a subset
of /usr/share or /usr/local/share).
A bit of a hack, but this is one of the more common errors that users
are encountering, so showing useful information will help cut down on
the number of support issues.
(Note: This commit also modifies obs-ffmpeg and obs-outputs)
API Changed:
obs_output_info::void (*stop)(void *data);
To:
obs_output_info::void (*stop)(void *data, uint64_t ts);
This fixes the long-time design flaw where obs_output_stop and the
output 'stop' callback would just shut down the output without
considering the timing of when obs_output_stop was used, discarding any
possible buffering and causing the output to get cut off at an
unexpected timing.
The 'stop' callback of obs_output_info now takes a timestamp with the
expectation that the output will use that timestamp to stop output data
in accordance to that timing. obs_output_stop now records the timestamp
at the time that the function is called and calls the 'stop' callback
with that timestamp. If needed, obs_output_force_stop will still stop
the output immediately without buffering.
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)
API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)
This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).
NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention. The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
In addition to the flv file format, this allows the ability to save to
container formats such as mp4, ts, mkv, and any other containers that
support the current codecs being used.
It pipes the encoded data to the ffmpeg-mux process, which then safely
muxes the file from the encoded data. If the main program unexpectedly
terminates, the ffmpeg-mux piped program will safely close the file and
write trailer data, preventing file corruption.