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

192 Commits

Author SHA1 Message Date
Chris (Flaeri)
0eb496e8cf libobs/media-io: Add color range and space to conversion
By adding the range data we can get successful handling of full range
color via custom FFmpeg output. Previously it would always default to 0
which would yield partial/limited output. Without the colorspace info
the output file is correctly tagged, but not undergone the actual
conversion.
2023-03-03 21:48:09 +00:00
jpark37
463bf0dff5 libobs,UI: Add P216/P416 pixel formats
Will be useful for ProRes.
2023-02-21 18:48:44 +01:00
PatTheMav
fb7a9edadc libobs: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
tuduweb
e36163ce89 libobs/media-io: Correctly check codec tag compatibility for out stream 2023-02-15 18:21:09 +01:00
Jim
1f469e4f7c libobs/media-io: Add get_total_audio_size()
get_audio_size() gets the size of individual planes.
get_total_audio_size() gets the size if you include all planes.
2023-02-05 02:55:24 -08:00
tytan652
ca896dbce7 media-io: Fix FF_API_BUFFER_SIZE_T not being defined on Ubuntu 20.04 2023-01-19 13:08:46 -05:00
pkv2
252e352a51 libobs: Change audio resampler to new channel API
The channel_layout API was overhauled by FFmpeg [1-5]. The previous
bitmask channel_layout is replaced by a struct ch_layout which combines
the number of channels, a bitmask and other infos.
The resampler needs to be updated whenever using swresample > 4.5.100.
This commit makes the necessary changes.

[1] Bump minor versions after the channel layout changes
FFmpeg/FFmpeg@cdba98b
[2] lavc: switch to the new channel layout API
FFmpeg/FFmpeg@548aeb9
[3] avutil/channel_layout: Add a new channel layout API
FFmpeg/FFmpeg@086a804
[4] avframe: switch to the new channel layout API db6efa18
FFmpeg/FFmpeg@db6efa1
[5] swresample: convert to new channel layout API
FFmpeg/FFmpeg@8a5896e

Signed-off-by: pkv <pkv@obsproject.com>
2022-11-10 19:37:07 -05:00
PatTheMav
bbb3dc0059 libobs: Force hvc1 codec tag for HEVC video and respect input tags 2022-11-02 22:44:20 +01:00
jpark37
3dd0f895f8 libobs/media-io: Restore color range conversion
FFmpeg needs color range during context init to handle conversions.
sws_setColorspaceDetails after the fact is too late.
2022-09-26 21:26:01 -07:00
jpark37
5af9c87e1b libobs/media-io: Avoid scaler for range diff
Green tint appears when using converting full NV12 to limited NV12 with
swscale, so just avoid creating scaler by color range for now.
2022-09-24 16:45:01 -07:00
jpark37
70f8e83353 libobs/media-io: Create scaler in more cases
Check for other data mismatches the scaler can fix up.
2022-09-10 15:36:27 -07:00
Claude Heiland-Allen
06f66f3120 libobs: Clamp audio NaN to 0.0f
Add comparison check so that NaN is caught.
Comparisons with NaN always result in false.
NaNs cause problems later in audio encoder.

Note: may break with -ffast-math compiler flag.

Fixes #4885.
2022-05-21 02:24:43 +02:00
pkv
e66542075d libobs: Fix missing include due to FFmpeg 5 changes
Since [1], avcodec/version.h is not included anymore in codec.h and
therefore is not included any more  in avformat.h.
As a result, LIBAVCODEC_VERSION_INT is no longer defined. This commit
fixes the include.
Since obviously we can't ifdef the avcodec include by referring to an
avcodec version, we ifdef it with the avformat version which was bumped
at the same time [2].

[1] libavcodec: Split version.h
f2da2e1458
[2] doc: Add an entry to APIchanges about changes to version.h and
 version_major.h
f3a0e2ee2b

Signed-off-by: pkv <pkv@obsproject.com>
2022-05-16 16:17:32 -04:00
Norihiro Kamae
d044231bfc libobs/media-io: Sleep to next audio time accurately
Prior to this change, the audio thread roughly waits the time of
`AUDIO_OUTPUT_FRAMES`, and consecutively processes twice or more if the
latency is accumulated. This behavior causes fluctuation of timing to
output audio packets. This change introduces `os_sleepto_ns_fast` so
that the audio packets will be periodically output.
2022-05-15 02:31:31 -07:00
Jim
952988d9ec
Merge pull request #6231 from mvji/prores_pix_fmt
Add support for GPU conversion of YUV422P10LE, YUV444P12LE, YUVA444P12LE
2022-05-04 02:01:27 -07:00
jpark37
7ce8cf8477 libobs/media-io: Preserve video side data on remux 2022-04-30 16:05:01 -07:00
mvji
93490da4c2 obs-ffmpeg: Use YVYU for FFmpeg pix fmt YVYU422
This commit also modifies deps/media-playback and libobs.
2022-04-19 19:39:22 +02:00
mvji
d3a8ef7128 libobs: Add support for YUV422P10LE, YUV444P12LE, YUVA444P12LE 2022-04-19 19:37:07 +02:00
jpark37
59dbc3eb81 libobs: Rename Rec. 2020 to Rec. 2100
Rec. 2020 is really an SDR spec, but I think HDR10 made it okay to slap
PQ on it, call it an HDR spec. Rec. 2100 came along after and formally
allowed the use of PQ/HLG, so we should use 2100 instead.
2022-04-10 00:13:52 -07:00
jpark37
94fa6d064b libobs: Add video_format_get_parameters_for_format
Video matrix is slightly different based on the number of bits per
channel, so derive from video_format for convenience.
2022-04-07 19:28:51 -07:00
jpark37
0ed0f2cdb4 libobs: Add I010/P010 support, TRC enum 2022-04-03 00:01:25 -07:00
jpark37
6fc5566f38 libobs: Add SWS_CS_BT2020 support 2022-04-02 20:14:31 -07:00
jpark37
692ca7efce libobs: Add Rec. 2020 video_colorspace enum values
One for PQ, and one for HLG. Including transfer function as part of the
color space simplifies logic by avoid invalid combinations.
2022-03-24 20:56:19 -07:00
Ryan Foster
5f68991911 clang-format: Commit file changes for clang-format 12 2021-10-13 20:00:04 +11:00
jpark37
e582879303 libobs/media-io: Register audio thread with MMCSS
Ensure audio gets more priority to help prevent glitching.
2021-10-10 19:19:01 -07:00
jpark37
0c208f1e62 libobs/media-io: Fix leaks and error handling 2021-08-23 22:57:07 -07:00
jpark37
8440a53da3 libobs: Round up chroma sizes for odd resolutions
When playing video, OBS can overflow and crash, or render video edges
incorrectly if the video resolution does not divide into 2 for trivial
chroma subsampling. This is fixed by rounding chroma plane sizes up
instead of down, and maintaining that through the video pipeline.
2021-07-23 12:02:06 -07:00
Richard Stanway
e5c6839904 libobs, obs-ffmpeg: Use correct value for EINVAL error check
FFmpeg functions such as av_interleaved_write_frame return negative
on error, so all errno values are negated.
2020-12-21 18:37:49 +01:00
Richard Stanway
e00feef7ab libobs: Ignore non-fatal ffmpeg return values during remux
Similar to 315fbd6 and 6071098, ignore non-fatal errors during the
remux process. It's possible OBS itself writes a file that generates
these errors when remuxed.
2020-12-02 21:05:43 +01: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
Richard Stanway
d7e8f115e8 libobs/media-io: Fix suspicious memset behavior 2020-09-04 21:46:18 +02:00
Jim
bfdf5dc947
Merge pull request #2356 from jpark37/sycc-color-space
Color space refinements
2020-08-05 08:58:21 -07:00
jpark37
06e4b10675 libobs/media-io: Add missing codec_tag set 2020-07-18 23:35:35 -07:00
jpark37
a69151e204 libobs: Add VIDEO_CS_SRGB support 2020-07-18 19:43:04 -07:00
jpark37
40b4db0c0c libobs/media-io: Fix FFmpeg deprecation warnings 2020-07-18 18:47:52 -07:00
jpark37
cf911744f7 libobs: Fix video scalar copy heights
Use plane height instead of overall height for copying planes to fix
memory stomp.
2020-07-07 12:48:49 -07:00
Jim
3b11e170b7
Merge pull request #2836 from jpark37/yuv-image-fix
Fix FFmpeg YUV to RGB conversion by adding extra destination padding to line sizes
2020-06-26 06:13:45 -07:00
jpark37
d9fa5de572 libobs: Fix right edge for "video scaler"
FFmpeg YUV to RGB conversions require extra destination padding.

This code only appears to be exercised for DeckLink.
2020-06-14 20:26:10 -07:00
jpark37
886bf5ceb7 libobs/media-io: Remove unused code 2020-06-07 11:16:24 -07:00
Hans Petter Selasky
0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00
Clayton Groeneveld
4e3a0180ba libobs, obs-x264: Fix compiler warnings 2020-01-21 15:18:09 -06:00
jpark37
8134a116be libobs: Add VIDEO_CS_SRGB enum value
Can't implement all at once because of AMF submodule.
2020-01-18 08:21:42 -08:00
Peter Geis
08b1b66439 libobs: fix building modules once installed
sse-intrin.h is a required header now, but the implicit path
breaks building addons once the headers are installed.

Fix this by making the path explicit.
2019-11-27 14:00:15 -05:00
Peter Geis
64d0b7fcb4 libobs: Enable compilation on aarch64
Add arch checks to enable aarch-compat layer on aarch64, retain normal
gcc intrinsics on x86 and ppc64.
2019-11-25 13:04:21 -05:00
jpark37
42bf026a49 libobs: Fix video warnings 2019-08-30 22:13:03 -07:00
Jim
444991ba21
Merge pull request #2021 from jpark37/yuva-format
Add support for YUV alpha formats
2019-08-11 20:38:17 -07:00
jpark37
3d6f5c8ad6 libobs: Add YUV alpha formats
This will allow YUV alpha formats to be converted to RGBA on the GPU.
2019-08-11 11:26:22 -07:00
SCG82
5bc1b3bc76 libobs: Add missing pixel format to format_is_yuv and get_video_format_name 2019-08-03 05:42:30 -07:00
jp9000
68a5a40df9 libobs, obs-ffmpeg, win-dshow: Fix FFmpeg 4.0 deprecation
Fixes FFmpeg 4.0 deprecation warnings.
2019-07-29 20:34:13 -07:00
James Park
37f663a789 libobs: obs-ffmpeg: win-dshow: Planar 4:2:2 video
This format has been seen when using FFmpeg MJPEG decompression.
2019-07-25 20:11:37 -07:00