0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

56 Commits

Author SHA1 Message Date
PatTheMav
13a23f6471 plugins: Suppress warnings about implicit integer downcasts
Returned values are usually 64-bit in length but commonly stored in
16-bit integers anyway.
2023-08-31 17:52:08 -04:00
Ryan Foster
d00068cb6c plugins: Update CMake minimum to 3.22
Since Ubuntu 22.04 is now our minimum supported Ubuntu version, and it
has CMake 3.22, let's make CMake 3.22 the minimum CMake version.
2023-08-05 16:45:46 -07:00
PatTheMav
db895092ed cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-06-29 10:11:32 -04:00
Lain
106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
tytan652
6e887f8158 obs-ffmpeg,cmake: Replace external folder by obs-deps headers 2023-05-13 17:06:39 -07:00
PatTheMav
6e07b86729 cmake: Remove EXCLUDE_FROM_ALL directive from interface libraries 2023-04-04 17:27:54 +00:00
PatTheMav
349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
tytan652
f4e90a5bd7 obs-ffmpeg,cmake: Add a finder for AMF headers 2023-03-07 14:55:03 -05:00
tytan652
ee144377dc cmake,obs-ffmpeg: Refactor Libva finder
This refactor adds Libva DRM, required for obs-ffmpeg
2023-01-25 13:14:41 -05:00
tytan652
b0c1c9c86c libobs,plugins: Remove individual -Wno-switch 2023-01-19 13:08:46 -05:00
tytan652
74b245431c obs-ffmpeg: Use Libva in FFmpeg VA-API
Libva is directly used to check if DRI devices support H264 encoding.
2022-11-20 11:30:40 +11:00
jp9000
53f4627b0c obs-ffmpeg: Add NVENC AV1 support 2022-10-07 14:34:39 -07:00
tytan652
d71878cd35 obs-ffmpeg: Add better error if SRT or RIST libraries are not found 2022-08-06 16:18:55 -07:00
Kurt Kartaltepe
8cb57aac1f obs-ffmpeg: Mark rist/srt required
When compiling with the new flag these are required, if we dont fail
here we instead get a more cryptic failure that the targets are
unassigned later in the file. This should make it easier to find the
flag to turn off or packages being searched for.
2022-07-30 20:33:54 -07:00
pkv
039d7347a3
obs-ffmpeg: Allow use of old mpegts output
By default, new mpegts output is used; but to allow CI on linux not
to be broken, we allow use of old mpegts output.
Up to ubuntu 22.04 there is no librist package available.
A manual compile is then required but the CI scripts would need to be
updated.
This also allows easy fallback in case of fatal bugs in new output.

Signed-off-by: pkv <pkv@obsproject.com>
2022-07-30 17:03:20 +02:00
pkv
e7d097cab8
obs-ffmpeg: Native SRT/RIST for mpegts output
Currently the ffmpeg_mpegts_muxer output is integrated with ffmpeg-mux.
Both use obs native encoders in contrast with obs-ffmpeg-output which
relies on avcodec library.
This allowed easy implementation of SRT, RIST & HLS protocols through
avformat library.
The main drawback is that obs-ffmpeg-mux exe doesn't allow for easy
debugging nor logging of the protocols.
It was written initially as a separate binary designed for recording so
that if obs fails for some reason, the recording can still terminate
gracefully.

In this commit the ffmpeg_mpegts_muxer is rewritten so that a pipe to
the ffmpeg-mux binary is not used any more.
The muxing to mpegts is still delegated to avformat.
But it can be traced more easily in all its steps.
Also the protocol part for SRT & RIST is implemented natively.
Custom avio_contexts for SRT & RIST are used to that end.
This allows to pass our own implementation of librist and libsrt
libraries instead of relying on avformat. This is very advantageous :
- this allows better logging.
- this allows better bug fixing and maintainance without having to rely
on hypothetical upstream fixes.

One immediate bonus of native implementation is that fixes bugs which
were not previously fixable.

Fixes: SRT & RIST auto-reconnect partly broken  #6749
Fixes: SRT: OBS unusable and uncloseable after starting stream to
invalid srt server #5791

Signed-off-by: pkv <pkv@obsproject.com>
2022-07-30 17:03:10 +02:00
OvchinnikovDmitrii
4e140d2ffe obs-ffmpeg: Add texture-based hardware AMD encoder
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon obsproject/obs-studio#4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
2022-07-21 15:29:25 -07:00
PatTheMav
3f2aad12cd obs-ffmpeg: Disable compiler warnings about non-exhaustive switch cases 2022-07-10 09:59:55 +10:00
jp9000
c5e328e359 obs-ffmpeg: Refactor FFmpeg video encoders
This reduces code duplication between the different FFmpeg-based video
encoder implementations
2022-04-22 12:51:38 -07:00
PatTheMav
49e9d49943
plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
Carlo Castoldi
4623a6b4bc obs-ffmpeg: Set DRI devices and their name persistently
retrieving the DRI devices from /dev/dri/by-path/ instead of
/dev/dri/renderDXXX. This enable us to use lspci to get the device
name as well.
2021-12-12 11:12:36 +11:00
jp9000
442886c0aa obs-ffmpeg: Add AOM AV1 and SVT-AV1 encoders
Adds the ability to encode with software AV1 encoders within FFmpeg,
specifically AOM AV1 and SVT-AV1.
2021-10-25 12:24:16 -07:00
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
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
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
7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
Colin Edwards
55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
Aaron Boxer
b55b1e9bfd obs-ffmpeg: Add new ffmpeg-encoded-output 2019-11-27 14:40:52 -05:00
derrod
5e183ff9a7 obs-ffmpeg: use avcodec_find_best_pix_fmt_of_list
The built-in format selector failed in certain cases like UtVideo now
using a differently packeg RGB format. FFmpeg has a format selection
functionality built-in that does pick the correct format however
(avcodec_find_best_pix_fmt_of_list), so we can simply use that instead.
2019-10-17 08:07:27 +02:00
Matt Gajownik
51be039cf8 CMake: Build Windows modules with file descriptors 2019-10-15 21:34:12 +11:00
jp9000
617086b040 obs-ffmpeg: Separate logging code
Cleans up obs-ffmpeg.c and separates all the logging code to a different
file, which can be enabled with ENABLE_FFMPEG_LOGGING.
2019-07-09 10:07:24 -07:00
jp9000
ed0c7bcd6a obs-ffmpeg: Add texture-based NVENC encoder implementation
Adds a texture-based NVENC implementation which passes OBS NV12 output
textures directly to NVENC without downloading them off of the GPU,
increasing NVENC performance by a significant margin.

If NV12 textures are unavailable or the new encoder fails to initialize
for whatever reason, it will fall back to the FFmpeg NVENC
implementation safely.
2019-02-07 17:00:47 -08:00
Thomas Crider
a64ae11bce obs-ffmpeg: Add linux VAAPI h.264 encoding support
Closes obsproject/obs-studio#1482
Closes obsproject/obs-studio#1256
2018-09-24 23:12:24 -07:00
jp9000
58c4f0ac91 obs-ffmpeg: Rename obs-ffmpeg-aac.c file
Renames obs-ffmpeg-aac.c to obs-ffmpeg-audio-encoders.c due to the fact
that it can be abstracted for multiple audio encoders.
2017-07-31 14:29:50 -07:00
jp9000
45d029b1fb obs-ffmpeg: Change from libff to media-playback 2017-03-31 12:10:32 -07:00
jp9000
8e1943065c obs-ffmpeg: Add FFmpeg NVENC encoder 2016-04-19 09:20:26 -07:00
jp9000
c87d3b1f12 cmake: Rename FindFFMpeg to FindFFmpeg
This was sort of driving me crazy: The 'm' in FFmpeg isn't supposed to
be capitalized.
2015-07-18 16:32:26 -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
jp9000
33a040b025 obs-ffmpeg: Add ffmpeg muxer pipe program 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
martell
b8055ed944 obs-ffmpeg: avoid w32-pthreads for mingw-w64
mingw-w64 provides its own pthreads library
2015-02-09 03:41:51 -08:00
jp9000
d3f92ca5d6 obs-ffmpeg: Make FFmpeg a usable output
This makes FFmpeg usable as an output, and removes or changes most of
the code that was originally intended for testing purposes.

Changes the settings for the FFmpeg output to the following:
* url:             Sets the output URL or file path
* video_bitrate:   Sets the video bitrate
* audio_bitrate:   Sets the audio bitrate
* video_encoder:   Sets the video encoder (by name, blank for default)
* audio_encoder:   Sets the audio encoder (by name, blank for default)
* video_settings:  Sets custom video encoder FFmpeg settings
* audio_settings:  Sets custom audio encoder FFmpeg settings
* scale_width:     Image scale width (0 if none)
* scale_height:    Image scale height (0 if none)

The reason why scale_width and scale_height are provided is because it
may internally convert formats, and it may be a bit more optimal to use
that scaler instead of the pre-output scaler just in case it already has
to convert formats internally anyway (though you can do it either way
you wish).

Video format handling has also changed; it will now attempt to use the
closest format to the current format if available for a given video
codec.
2015-02-04 16:51:54 -08:00
BtbN
599febcb54 cmake: Replace FFMpeg modules with single module
Now using components instead of one find_package call per module
2014-09-27 09:41:13 -07:00
BtbN
02725acdd4 Fix double invocation of install_obs_plugin in every single plugin 2014-08-19 14:24:59 +02:00
BtbN
38c2fc87aa Move all data into the subdir it belongs to
Completely removes the build dir in favor of cmake based build layouting
2014-07-19 01:38:41 +02:00
jp9000
482791c5b6 Add locale for modules 2014-07-11 17:29:00 -07:00
BtbN
8b14aa8f4a Add missing header to CMakeLists.txt 2014-06-28 20:54:14 +02:00
BtbN
e2c2e50f4c Fix ffmpeg/x264 find modules according to cmake find module naming conventions 2014-05-22 13:03:47 +02:00
BtbN
ce542525fc Fix dependency on win32-pthreads 2014-05-08 14:43:16 +02:00
BtbN
075820028f Improve bundle fixup 2014-04-13 11:05:46 -07:00