Commit Graph

25 Commits (2a08f1d1440a57352b0999c0c1777c29c1c4ca29)

Author SHA1 Message Date
Kurt Kartaltepe d86c8121ed Plugins: Add descriptions to modules 2018-09-11 18:28:58 -07:00
jp9000 6774bbdb83 obs-ffmpeg: Remove NVENC detection code for now
The reason this code is being reverted/removed is because this code is a
risk to startup stability.  This check will be added again in the
future, however this code needs to be executed from a secondary piped
process instead of directly in the process to reduce risk of
driver/hardware issues impacting program startup.  The same needs to be
accomplished for the AMF plugin as well.
2018-01-20 05:31:58 -08:00
jp9000 f5c3af1bda obs-ffmpeg: Fix signed mismatch warning 2018-01-19 16:19:10 -08:00
Lucian Poston ff45b7b119 obs-ffmpeg: Call av_register_all before nvenc check
Closes jp9000/obs-studio#1157
2018-01-18 01:36:46 -08:00
jp9000 653d3ceb33 obs-ffmpeg: Don't try to detect NVENC on mac 2018-01-18 01:36:46 -08:00
Michel 054d607c2d obs-ffmpeg: Improve NVENC detection
This improves detection by performing an actual check on encoder
capability directly with the NVENC/CUDA libraries.
2018-01-18 01:35:45 -08:00
jp9000 17560bf86a Revert "obs-ffmpeg: Improve NVENC detection"
This reverts commit 94b5982216.

Reverting this commit because it had some negative side effects, such as
adding 500 milliseconds to the startup time.  NVENC detection should
really be done through its proper API, and not via creating an encoder
on startup.
2018-01-12 05:35:01 -08:00
Michel 94b5982216 obs-ffmpeg: Improve NVENC detection
Certain NVIDIA GPUs don't support NVENC, but ship with the NVENC
library, causing OBS to mistakenly think that NVENC is available when it
actually isn't.

Closes jp9000/obs-studio#1087
2017-12-02 08:08:52 -08:00
jp9000 fa611dcd76 obs-ffmpeg: Add Opus audio encoder 2017-08-01 02:14:58 -07: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 8e1943065c obs-ffmpeg: Add FFmpeg NVENC encoder 2016-04-19 09:20:26 -07:00
jp9000 7f0f3d25c9 obs-ffmpeg: Remove overly verbose FFmpeg logging
For the time being, FFmpeg logging is disabled due to the fact that it
can just output way too much data.
2016-01-26 11:49:27 -08:00
Richard Stanway 55dd8f8726 obs-ffmpeg: Fix a race condition in create_or_fetch_log_context
Another thread could be manipulating the active_log_contexts array while the current thread is trying to read it, resulting in an uninitialized memory crash as the da_push_back call was not protected by the mutex.
2015-10-12 23:21:45 +02:00
kc5nra 34b95eff8a obs-ffmpeg: Sychronize logging on log context
Different logging can occur from different contexts.
This adds isolation for each context passed to the
AV log.
2015-08-14 07:53:52 -07:00
John Bradley 6e69b0f4f0 obs-ffmpeg: Move log callback up to plugin scope 2015-08-14 07:53:51 -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
John Bradley 2fc6c4d725 obs-ffmpeg: Add FFMpeg input source 2015-03-09 21:22:32 -05:00
jp9000 892fdea83e Remove macro to free locale
This functionality can now be handled automatically because locale can
now be freed seaparately from obs_module_unload with
obs_module_free_locale, which is called automatically when the module is
being freed.
2014-07-27 17:29:10 -07:00
jp9000 f0ac19abba Remove version parameter from obs_module_load
Replaced by obs_get_version() API
2014-07-27 17:29:10 -07:00
jp9000 482791c5b6 Add locale for modules 2014-07-11 17:29:00 -07:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- Implement the RTMP output module.  This time around, we just use a
   simple FLV muxer, then just write to the stream with RTMP_Write.
   Easy and effective.

 - Fix the FLV muxer, the muxer now outputs proper FLV packets.

 - Output API:
   * When using encoders, automatically interleave encoded packets
     before sending it to the output.

   * Pair encoders and have them automatically wait for the other to
     start to ensure sync.

   * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
     because it was a bit confusing, and doing this makes a lot more
     sense for outputs that need to stop suddenly (disconnections/etc).

 - Encoder API:
   * Remove some unnecessary encoder functions from the actual API and
     make them internal.  Most of the encoder functions are handled
     automatically by outputs anyway, so there's no real need to expose
     them and end up inadvertently confusing plugin writers.

   * Have audio encoders wait for the video encoder to get a frame, then
     start at the exact data point that the first video frame starts to
     ensure the most accrate sync of video/audio possible.

   * Add a required 'frame_size' callback for audio encoders that
     returns the expected number of frames desired to encode with.  This
     way, the libobs encoder API can handle the circular buffering
     internally automatically for the encoder modules, so encoder
     writers don't have to do it themselves.

 - Fix a few bugs in the serializer interface.  It was passing the wrong
   variable for the data in a few cases.

 - If a source has video, make obs_source_update defer the actual update
   callback until the tick function is called to prevent threading
   issues.
2014-04-07 22:00:10 -07:00
jp9000 966b943d5b Remove majority of warnings
There were a *lot* of warnings, managed to remove most of them.

Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after,
as -Wall -Wextra was overwriting flags that came before it.
2014-02-14 15:13:36 -07:00
jp9000 8e81d8be56 Revamp API and start using doxygen
The API used to be designed in such a way to where it would expect
exports for each individual source/output/encoder/etc.  You would export
functions for each and it would automatically load those functions based
on a specific naming scheme from the module.

The idea behind this was that I wanted to limit the usage of structures
in the API so only functions could be used.  It was an interesting idea
in theory, but this idea turned out to be flawed in a number of ways:

 1.) Requiring exports to create sources/outputs/encoders/etc meant that
     you could not create them by any other means, which meant that
     things like faruton's .net plugin would become difficult.

 2.) Export function declarations could not be checked, therefore if you
     created a function with the wrong parameters and parameter types,
     the compiler wouldn't know how to check for that.

 3.) Required overly complex load functions in libobs just to handle it.
     It makes much more sense to just have a load function that you call
     manually.  Complexity is the bane of all good programs.

 4.) It required that you have functions of specific names, which looked
     and felt somewhat unsightly.

So, to fix these issues, I replaced it with a more commonly used API
scheme, seen commonly in places like kernels and typical C libraries
with abstraction.  You simply create a structure that contains the
callback definitions, and you pass it to a function to register that
definition (such as obs_register_source), which you call in the
obs_module_load of the module.

It will also automatically check the structure size and ensure that it
only loads the required values if the structure happened to add new
values in an API change.

The "main" source file for each module must include obs-module.h, and
must use OBS_DECLARE_MODULE() within that source file.

Also, started writing some doxygen documentation in to the main library
headers.  Will add more detailed documentation as I go.
2014-02-12 08:04:50 -07:00
jp9000 3d6d43225f Add planar audio support, improve test output
- Add planar audio support.  FFmpeg and libav use planar audio for many
  encoders, so it was somewhat necessary to add support in libobs
  itself.

- Improve/adjust FFmpeg test output plugin.  The exports were somewhat
  messed up (making me rethink how exports should be done).  Not yet
  functional; it handles video properly, but it still does not handle
  audio properly.

- Improve planar video code.  The planar video code was not properly
  accounting for row sizes for each plane.  Specifying row sizes for
  each plane has now been added.  This will also make it more compatible
  with FFmpeg/libav.

- Fixed a bug where callbacks wouldn't create properly in audio-io and
  video-io code.

- Implement 'blogva' function to allow for va_list usage with libobs
  logging.
2014-02-07 03:03:54 -07:00
jp9000 fc8851e9f4 Add preliminary ffmpeg plugin (still testing)
- Added some code for FFmpeg output that I'm still playing around with.
  Right now I'm just trying to get it to output to file and try to
  understand the FFmpeg/libav APIs.  Hopefully in the future this plugin
  can be used for any sort of output to FFmpeg.

- Fixed a cast warning in audio-io.c with size_t -> uint32_t

- Renamed the 'video_info' and 'audio_info' structures to
  'video_conver_info' and 'audio_convert_info' to better represent their
  actual purpose, and to avoid confusion with 'audio_output_info' and
  'video_output_info' structures.

- Removed a few macros from obs-def.h that were at one point going to be
  used but no longer going to be used (at least for now)
2014-01-19 03:16:41 -07:00