497 Commits

Author SHA1 Message Date
Jim
b745a100a3
Merge pull request #5371 from norihiro/automatic-file-splitting
Automatic file splitting
2022-04-10 16:49:37 -07: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
wangshaohui
db8145e8a2 obs-ffmpeg, win-dshow, deps/media-playback: Use recommended API for AVCodecContext 2022-04-07 01:59:30 -07:00
jpark37
4c2aa58dbe obs-ffmpeg: Support Rec. 2020, I010/P010 formats
Also remove unused function, ffmpeg_to_obs_video_format.
2022-04-03 00:03:34 -07:00
Norihiro Kamae
ba68eda590 obs-ffmpeg: Use av_packet_alloc instead of av_init_packet
sizeof(AVPacket) being a part of the public ABI is deprecated. once
av_init_packet() is removed, new packets will only be able to be
allocated with av_packet_alloc().
In ffmpeg-mux, ffmpeg-vaapi, and obs-ffmpeg-nvenc, AVPacket is allocated
at the initialization to avoid frequent allocation of AVPacket.

Includes changes to win-dshow.
2022-03-24 17:19:40 -07:00
PatTheMav
49e9d49943
plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
Florian Zwoch
8886091793 obs-ffmpeg: add NVENC blacklist check for Linux
Similar to the Windows counter part. Check the PCI bus for
installed cards. When found at least one VGA compatible adapter
from NVIDIA that is not in the blacklist we pass the check.
2022-03-08 12:16:07 -08:00
Ryan Foster
ebc514e8db obs-ffmpeg: Update nv-codec-header files
Update the in-tree nv-codec-header files (nvEncodeAPI.h and
dynlink_cuda.h) to n11.1.5.1, which is the version currently used in the
OBS Studio dependencies, to keep the in-tree version in sync with the
version in our dependencies.
2022-02-26 15:08:03 -08:00
pkv
5b0c09a9f4 obs-ffmpeg: Force mpegts format & disable restart on activate for srt & rist
This fixes crashes in media Source when :
- the user forgets to set the input format for srt or rist URLs;
- disabling / enabling / disabling etc Media source with a rist URL.

Signed-off-by: pkv <pkv@obsproject.com>
2022-02-19 15:17:19 -08:00
jp9000
109b54fd66 obs-ffmpeg: Fix svt-av1 rate control settings
For SVT-AV1, rate control is explicitly set via an "rc" option, so set
those options manually for SVT-AV1. CBR doesn't seem to be fully
supported, but it's sort of supported via CVBR (constrained variable
bitrate), which seems to be specific to each GOP size, which is about as
close to CBR as we can get.
2022-02-07 13:11:34 -08:00
Translation Updater
ac8dbf67be Update translations from Crowdin 2022-02-06 02:24:08 +00:00
derrod
8367c8adfa obs-ffmpeg: Add MX450 to blacklist 2022-01-25 16:46:55 +01:00
jp9000
0dd5d93d42 obs-ffmpeg: Add new SVT presets
Don't worry, these preset names are just placeholders for now
2022-01-23 14:57:27 -08:00
Vainock
4e8fbb8f77 obs-ffmpeg: Fix spelling mistake for 'Encoder.Timeout' 2022-01-12 07:33:04 -08:00
gxalpha
723d5a2163 obs-ffmpeg: Add missing "FFmpegOpts" locale 2022-01-12 21:48:38 +11:00
pkv
d78971b4db obs-ffmpeg: Further FFmpeg deprecations fixes for FFmpeg 4.4+
avcodec.h stopped including channel_layout.h per FFmpeg commit
1be3d8a0cb77 [1]. Fixes compilation error on macOS against
FFmpeg later than the mentioned commit.
[1] 1be3d8a0cb
2022-01-08 18:18:27 +11:00
jp9000
dfaccd1e3a obs-ffmpeg: Fix av1 encoding with fractional framerates
Just use util_mul_div64 instead of using av_rescale_q_rnd
2022-01-04 22:48:10 -08:00
Norihiro Kamae
61c0a76fc0 obs-ffmpeg: Split file by PTS instead of DTS
If B-frame is enabled in video encoder, video packets have different PTS
and DTS, however audio packets do not. That caused audio packets at the
splitting point goes to a different file and audio glitch appeared in an
NLE.
2021-12-24 16:04:15 +09:00
Norihiro Kamae
550b1331ac obs-ffmpeg, UI: Reset timestamps at splitting file
This commit adds a setting to reset timestamps when splitting files.
Some NLEs cannot handle video files whose starting timestamp is not
zero. Default is enabed.
2021-12-24 15:59:26 +09:00
Norihiro Kamae
ce92f441b5 obs-ffmpeg: Split ffmpeg_muxer output file by size or time
This commit adds 3 new properties to split output file in the output
`ffmpeg_muxer`.
- `max_time_sec` specifies the limit in seconds.
- `max_size_mb` specifies the limit in megabytes.
- `allow_overwrite` specifies to test an existing file.
If both `max_time_sec` and `max_size_mb` are not positive, the split
file feature won't be enabled.
Another output ffmpeg_mpegts_muxer shares the code but is not affected
since the output is used only for streaming.
2021-12-24 15:21:55 +09:00
Norihiro Kamae
d64adb6784 obs-ffmpeg: separate generate_filename function 2021-12-24 11:49:27 +09:00
Norihiro Kamae
685f8297e4 obs-ffmpeg: Set frame_size for audio codec parameter
This commit fixes an issue that the last audio packet is sometimes not
written into mp4 format. Since libavformat internally calculates the
packet duration from the frame_size specified in the codec parameter, it
is necessary to set frame_size.
2021-12-23 10:48:37 -08:00
Jim
91a9688d9f
Merge pull request #5501 from RytoEX/fix-ffmpeg-deprecations
Fix FFmpeg deprecations up to FFmpeg 4.4 and current FFmpeg git
2021-12-17 01:16:35 -08:00
Translation Updater
062de2c998 Update translations from Crowdin 2021-12-17 08:01:29 +00:00
Translation Updater
261345f9ef Update translations from Crowdin 2021-12-12 02:38:59 +00: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
Norihiro Kamae
f8bcc190e2 obs-ffmpeg: Fix memory leaks if replay buffer failed
When releasing a darray mux_packets at error, contents of mux_packets
are not released. It causes memory leaks if error occurs during saving
the replay buffer to a file.
2021-11-30 21:53:34 -08:00
pkv
f32c2b0fbb obs-ffmpeg: Properly name FFmpeg lib used
Cosmetic but this was nagging me since I had authored those lines.
2021-11-23 12:10:56 -05:00
pkv
c398ac9739 obs-ffmpeg: Fix NVENC old codec naming removed in FFmpeg
Per FFmpeg commit 337f777f378c [1], FFmpeg removed nvenc_h264_encoder
and nvenc_hevc_encoder after deprecation in FFmpeg commit 888a5c794778
[2]. The names to be used are ff_h264_nvenc_encoder and
ff_hevc_nvenc_encoder. So we must allow alternative search of codec as
h264_nvenc or nvenc_h264 in obs-ffmpeg.c.

[1]: 337f777f37
[2]: 888a5c7947
2021-11-23 12:10:56 -05:00
Ryan Foster
ce734366bc obs-ffmpeg: Respect AVFormatContext and AVOutputFormat constness
AVFormatContext::oformat was made const on April 27, 2021 [1]. If we
respect the constness of AVOutputFormat and do not cast results from
FFmpeg functions to non-const, we cannot modify the results after the
fact. Our choices are either to cast them to non-const (and presumably
have them implicitly casted back to const on later function calls), or
only try to modify the results in versions of FFmpeg where these are not
expected to be const.

Instead of relying on casts, we can set the encoder values in the
ffmpeg_cfg struct, which are later passed to new_stream.

Also modifies deps/media-playback. Removes compiler warnings.
Some avformat functions return const AV(In/Out)putFormat per [1], so
ifdef as needed.

[1]: 56450a0ee4
     lavf 59.0.100 avformat.h
     avformat: Constify the API wrt AV(In|Out)putFormat

     Also constify AVProbeData.
2021-11-23 12:10:25 -05:00
Ryan Foster
abf1d609d2 obs-ffmpeg: Include channel_layout.h
avcodec.h stopped including channel_layout.h per FFmpeg commit
1be3d8a0cb77 [1]. avformat.h stopped including avcodec.h per FFmpeg
commit e67e02d15672 [2]. As a result, we need to explicitly include
avutil/channel_layout.h when needed. Fixes compilation error against
FFmpeg later than the two mentioned commits.

[1]: 1be3d8a0cb
[2]: e67e02d156
2021-11-21 11:30:02 -05:00
Ryan Foster
08547a1696 obs-ffmpeg: Include avcodec header for AVCodecContext
FFmpeg commit e67e02d15672 [1] drops avcodec.h from avformat.h includes.
Therefore we need to include it explicitly.

[1]: e67e02d156
     lavf/avformat.h: drop the avcodec.h include
2021-11-21 11:30:02 -05:00
Norihiro Kamae
2a0b9d851c obs-ffmpeg: Fix starting video packet offset in replay-buffer
The commit 4a5ac3974 fixed the bug the first PTS is not zero. This
commit fixed the same issue in replay-buffer.
A variable `video_dts_offset` is renamed to `video_pts_offset` and the
variable is initialized by `pts` instead of `dts`.
2021-11-04 14:49:17 -07:00
Clayton Groeneveld
af6c719139 UI, libobs, obs-plugins: Fix compiler warnings
Found warnings when compiling OBS.
2021-11-04 06:25:52 -07:00
pkv
258365da71 obs-ffmpeg-mux: Add support for rist protocol
This adds RIST to the list of protocols supported by the obs
ffmpeg_mpegts_muxer.
RIST is container and codec agnostic. But this implementation relies
on ffmpeg avformat integration and uses mpeg-ts container.
2021-10-30 15:06:58 -07: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
jp9000
e8d366f789 obs-ffmpeg/ffmpeg-mux: Allow codecs of any type
Allows the ability to mux with a codec which may not actually have an
encoder implementation within the current build of FFmpeg
2021-10-25 12:24:16 -07:00
Norihiro Kamae
499af309b5 obs-ffmpeg: Fix unwritten audio-only output
When video is disabled, no audio was sent to the container so that the
audio was not saved. Prior to this change, all audio was discarded until
the first video packet arrives. This change limits to discard audio only
if video is available.
2021-10-24 00:02:32 -07:00
Vainock
11a690b038 Update translations from Crowdin 2021-09-24 09:42:08 -07:00
Richard Stanway
1444ead812 Revert "obs-ffmpeg, obs-qsv11: Disable dynamic bitrate support"
This reverts commit 1b29bfc88419515fa423804fac4411794c4df745.
2021-08-23 18:26:37 -07:00
Richard Stanway
1b29bfc884 obs-ffmpeg, obs-qsv11: Disable dynamic bitrate support
Unfortunately these encoders tend to crash or freeze after after
multiple bitrate changes. Users with dynamic bitrate enabled
experience a random encoder freeze which manifests as OBS dropping to
0kb/sec and disconnecting and it's not at all obvious that dynamic
bitrate is the cause. Disable it for now until we can figure out if
there is any workaround or bug on our end.
2021-08-20 14:51:16 -07:00
Matt Gajownik
a5878e1caa obs-ffmpeg: Translate VAAPI property names 2021-07-31 15:09:29 -07:00
jpark37
880eac5b24 obs-ffmpeg: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
Exeldro
62d0661f98 obs-ffmpeg: Don't purge packets when there are none 2021-06-29 08:40:13 -07:00
Translation
ef2b1eb1c6 Update translations from Crowdin 2021-06-11 07:18:15 -07:00
jpark37
ba3eb46bf9 obs-ffmpeg: Add missing return statement 2021-06-07 22:14:38 -07:00
jpark37
a8414a09cc obs-ffmpeg: NVENC usage fixes
Only use lossless encode if the capability is supported.

Set qpPrimeYZeroTransformBypassFlag to 1 for lossless.

Do not set profileGUID for lossless.

For both NVENC implementations, retry with a heavier reset because both
are unable to recover from failure lightly.
2021-06-07 21:43:58 -07:00
jpark37
07084de805 obs-ffmpeg: Support lack of Psycho Visual Tuning
For new NVENC, warn if PVT is requested, but unsupported by the GPU.
Also retry without PVT on failure to try to catch bad cominbations.

For old NVENC, if PVT is enabled when FFmpeg failure occurs, retry
without PVT.
2021-06-06 11:05:04 -07:00
jpark37
15e37f96d1 obs-ffmpeg: Add linear alpha setting
Allow proper linear treatment of alpha for authoring sanity.
2021-06-04 19:04:08 -07:00
Gol-D-Ace
90df8d44df Update translations from Crowdin 2021-05-30 20:33:35 +02:00