Commit Graph

36 Commits (97491ee91afcf2060d92aa03f6cabd9edd6f08a2)

Author SHA1 Message Date
Maya Venkatraman 49d351b537 obs-ffmpeg: Add HLS output
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.
2020-10-13 13:54:42 -07:00
Maya Venkatraman c4e71794d9 obs-ffmpeg: Allow using stream keys with muxer
(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)
2020-10-13 13:54:42 -07:00
Maya Venkatraman d7e673d23d obs-ffmpeg: Allow specifying mux settings directly
(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).
2020-10-13 13:54:08 -07:00
Maya Venkatraman 966b48a0f7 obs-ffmpeg/ffmpeg-mux: Use separate printable URL target
(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.
2020-10-13 13:54:01 -07:00
Maya Venkatraman 87a64e6565 obs-ffmpeg: Move muxer structure/funcs to header
(Jim) Allows the ability to use it for more output types.
2020-10-13 13:29:15 -07:00
jp9000 3d51602690 UI: Fix replay buffer frontend event not triggering
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.
2020-10-12 16:59:26 -07:00
Eric Lindvall 3d1c13210a obs-ffmpeg: Signal a remote disconnect for network streams from ffmpeg-mux
If using ffmpeg-mux to send a network stream, signal a disconnect error code
on error to allow reconnections to take place.
2020-10-03 22:17:02 -07:00
jpark37 b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
jpark37 37f01b35f6 obs-ffmpeg: Improve color space handling
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.
2020-07-18 19:44:13 -07:00
Clayton Groeneveld 990a07dc18 UI, obs-ffmpeg, obs-filters: Fix compile warnings 2020-07-16 23:15:13 -05:00
jp9000 002886bbac obs-ffmpeg, UI: Allow slash in recording names
Automatically generate directories if slashes are present in a recording
name format set in advanced settings or in the replay buffer
prefix/suffix settings.

Fixes obsproject/obs-studio#2416
Closes obsproject/obs-studio#2858
2020-06-27 05:21:14 -07:00
pkv 91418e901c obs-ffmpeg: Use obs-ffmpeg-mux for mpegts network output
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.
2020-05-19 16:15:41 -07:00
jp9000 c165798959 obs-ffmpeg: Move file read error to separate function
Moves the code that generates a file read error message to its own
function for the sake of cleaning things up a bit.
2020-05-19 16:10:06 -07:00
jp9000 942ca6f709 obs-ffmpeg: Add support for pausing 2019-07-07 16:38:22 -07:00
jp9000 8caa4f938c obs-ffmpeg: Check for replay buffer button press
The replay buffer was triggering on both button press and button
release, which is redundant.
2019-07-06 09:27:40 -07:00
jp9000 f53df7da64 clang-format: Apply formatting
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.
2019-06-23 23:49:10 -07:00
jp9000 973d31b8c2 libobs: Fix lockup when an encode call fails
(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.
2019-05-17 01:51:12 -07:00
jp9000 0677fe2b21 obs-ffmpeg: Move ffmpeg-mux to executable dir
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).
2019-04-26 13:24:34 -07:00
Richard Stanway ca5a19cf66 obs-ffmpeg: Add logging of last error for passing to UI 2019-04-19 05:45:38 -07:00
Richard Stanway bf16ec5f2d obs-ffmpeg: Show additional details in failed to write error
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.
2019-01-27 20:16:40 +01:00
jp9000 655288baec obs-ffmpeg: Do not return last replay path if currently muxing 2018-01-18 08:54:43 -08:00
jp9000 8fc486339c obs-ffmpeg: Add proc to get last replay buffer
Allows getting the path of the last replay buffer saved via the
procedure handler of the FFmpeg muxer output.
2018-01-18 05:34:26 -08:00
Richard Stanway ca5f123030
obs-ffmpeg: Improved output error handling
Checks the output path is writable and checks for failure to start the
ffmpeg-mux subprocess.
2017-08-07 00:32:49 +02:00
Shaolin cfcb2f4f39 plugins: Clear warnings about -Wincompatible-pointer-types
Signed-off-by: Shaolin <admshao@gmail.com>
2017-06-01 05:25:55 -03:00
jp9000 d6872af0a2 obs-ffmpeg: Implement get_total_bytes in recording outputs
Allows seeing statistics such as bitrate and total bytes saved for
recording outputs.
2017-05-13 01:21:20 -07:00
Michael Fabian Dirks ed6507ffcf obs-ffmpeg: Allow saving with different video codecs
Closes jp9000/obs-studio#794
2017-02-25 08:02:59 -08:00
Jim da1fddbd84 Merge pull request #793 from juvester/unused-params
obs-ffmpeg, UI: Fix compiler warnings
2017-02-25 02:35:46 -08:00
jp9000 d9786a7d0a obs-ffmpeg: Add 'save' to replay buffer proc handler
Allows saving replays programmatically without having to use hotkeys.
2017-02-20 23:39:52 -08:00
juvester 133f8c311e obs-ffmpeg: Fix compiler warnings 2017-02-08 16:25:54 +02:00
jp9000 f2e85b8352 obs-ffmpeg: Add replay buffer output
This output allows buffering the encoded data, and then muxing the
current buffer to a file on the spot via a hotkey the user sets.
2016-12-08 03:36:17 -08:00
jp9000 9a58772a01 obs-ffmpeg: Allow ffmpeg_mux forced stop even when stopping 2016-09-09 17:39:19 -07:00
jp9000 d7db0b8b01 (API Change) libobs: Fix output data cutoff on stop
(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.
2016-06-22 14:10:39 -07:00
Palana d870bbb643 obs-ffmpeg: Add custom muxer options to ffmpeg-mux 2015-11-27 15:48:24 +01:00
jp9000 6285a47726 (API Change) libobs: Pass type data to get_name callbacks
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.
2015-09-16 09:21:12 -07:00
jp9000 50b47a6861 obs-outputs: Use actual audio encoder sample rate 2015-07-09 10:43:32 -07:00
jp9000 9048743ebe obs-ffmpeg: Add ffmpeg muxer
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.
2015-06-21 22:34:49 -07:00