447 Commits

Author SHA1 Message Date
Kurt Kartaltepe
1064cd26f1 obs-ffmpeg: Expose psycho-aq setting
This was changed to default on but is not exposed for ffmpeg nvenc.
Where cards without temporal AQ support will fail to initialize and we
cannot do checks beforehand. This exposes the parameter to allow users
to disable this feature when using the ffmpeg implementation.
2021-04-10 14:49:40 -07:00
floele
44c38e71cc obs-ffmpeg/ffmpeg-mux: Fix hang without global_stream_key
If DEBUG_FFMPEG_MUX is enabled, when starting a recording without
configuring global_stream_key, obs-ffmpeg-mux will hang. Apply same
check to global_stream_key as in init_params() to prevent this.
2021-03-30 04:55:33 -07:00
Eric Lindvall
3c76fc4ddb obs-ffmpeg: Enable macOS hardware decoding for media source
Reverts  c7395b05ece4b9e204aa90984c8e29bd3eb739d9
2021-03-30 03:45:06 -07:00
jpark37
10c43f19c0 obs-ffmpeg: Missing NVENC bounds check 2021-03-20 12:35:49 -07:00
jpark37
4404422082 obs-ffmpeg: Replace cast with numeric literal 2021-03-20 12:35:49 -07:00
jpark37
7b983f00e3 obs-ffmpeg: Static analysis warnings
Fix various warnings about variable size.
2021-03-16 20:03:45 -07:00
jpark37
f35e37a963 obs-ffmpeg: Use NVENC preset lookahead length
If the preset specifies the lookahead length, use it. Force to previous
setting of 8 otherwise.
2021-03-16 20:03:45 -07:00
jpark37
6826285921 obs-ffmpeg: Align NVENC config values
Hard-code various config values as they appear in FFmpeg.
2021-03-16 20:03:29 -07:00
jpark37
3ddab3ca3e obs-ffmpeg: Align NVENC buffer length
Compute buffer count according to FFmpeg logic.
2021-03-16 20:02:49 -07:00
jpark37
7e8a04bbea obs-ffmpeg: Align NVENC lookahead logic
Force-enable lookahead if nvEncGetEncodePresetConfig says to.
2021-03-16 20:02:20 -07:00
jpark37
eca916527d obs-ffmpeg: PVT for NVENC fallback
Plumb Psycho Visual Tuning setting into fallback encoder.
2021-03-16 19:05:36 -07:00
jpark37
aa7e579f87 obs-ffmpeg: Align NVENC vbvBufferSize
Set vbvBufferSize to match FFmpeg behavior.
2021-03-16 19:04:00 -07:00
jpark37
f253c6dcb3 obs-ffmpeg: Align NVENC aqStrength
If Psycho Visual Tuning is on, switch aqStrength to from 0 to 8 to match
FFmpeg default.
2021-03-16 19:02:50 -07:00
jpark37
0c971276ae obs-ffmpeg: Don't set NVENC max dimensions
Don't set maxEncodeWidth/maxEncodeHeight since FFmpeg doesn't, and we
don't support resolution changes.
2021-03-16 19:01:00 -07:00
jpark37
b150e4fd39 obs-ffmpeg: Align NVENC dts math
Multiply by number of bframes like FFmpeg does.
2021-03-16 18:58:29 -07:00
jpark37
6ee7725c03 obs-ffmpeg: Use av_reduce on NVENC aspect ratio
For example, 1920:1080 becomes 16:9.
2021-03-16 18:58:20 -07:00
Christopher P Yarger
fc6d2954fd obs-ffmpeg: Fix bug with obs_source_media_play_pause 2021-03-04 23:43:14 -08:00
Clayton Groeneveld
3e4c2c0535 obs-ffmpeg: Fix replay save callback not working properly
Previously the save callback would be called when the replay buffer
hotkey was pressed and not when the saving of the replay was finished.
When the 'get_last_replay' procedure was called after the saved callback
function, it would return the incorrect path, as the path would still
be the previous path.
2021-02-15 02:40:00 -08:00
Jim
2eca4d80b6
Merge pull request #2233 from VodBox/missing-files-dialog
libobs + UI: Add Missing Files API & Dialog
2021-01-31 08:02:16 -08:00
VodBox
fb95e1d1e9 libobs: Add missing file API to sources 2021-01-17 10:31:58 +13:00
Meng Li
96c7790d80 obs-ffmpeg: Always fully restart remote media sources
When a media source is set to use a URL, always fully shut down the
media when stopped. This ensures that the media will do a full
reconnect after having been stopped.
2021-01-12 19:47:44 -08: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
Gol-D-Ace
7368a2c7cc Update translations from Crowdin 2020-12-14 00:29:44 +01:00
Gol-D-Ace
7ab98ca00f Update translations from Crowdin 2020-11-25 20:11:39 +01:00
Richard Stanway
17b3873578 obs-ffmpeg: Treat non-network errors as fatal too
4f873376 as part of PR #3460 changed ffmpeg_mux_packet to
fail = !ffmpeg_mux_packet. ffe4c855 only reverted that one line
instead of the entire previous commit. When the change was
reintroduced in 6071098a as part of PR #3740, it became
fail = ffmpeg_mux_packet without the negation.

This commit reverts db1e6aa and fixes the logic check.
2020-11-19 01:55:26 +01:00
jp9000
db1e6aa192 Revert "obs-ffmpeg: Treat errors as fatal for non-network streams in ffmpeg-mux"
This reverts commit 6071098abc48575a82f41b850b9c04fbaf570838.
2020-11-18 14:28:06 -08:00
Eric Lindvall
6071098abc obs-ffmpeg: Treat errors as fatal for non-network streams in ffmpeg-mux 2020-11-16 07:31:44 -08:00
Eric Lindvall
315fbd6f33 obs-ffmpeg: Treat EINVAL as non-fatal in ffmpeg-mux 2020-11-16 07:31:44 -08:00
Eric Lindvall
1fa99dd075 obs-ffmpeg: Treat AVERROR_INVALIDDATA as non-fatal 2020-11-15 06:02:30 -08:00
Eric Lindvall
41258f8976 obs-ffmpeg: Add error detection to ffmpeg-mux network streams
ffmpeg-mux does not notice if ffmpeg returns an error from
av_interleaved_write_frame() which means that OBS never knows if there
is a problem in ffmpeg.

This is the biggest issue for cases like srt:// or tcp:// streams that
can regularly fail. Without this change OBS never knows that something
went wrong.

Only network streams are checked to prevent impacting potential
transient errors in recordings.
2020-11-15 06:02:30 -08:00
jp9000
ffe4c8552b Revert "obs-ffmpeg: Add error detection to ffmpeg-mux"
This reverts commit 4f87337646f4db0d50a4ebb257faf0640a729805.

Reverting the line in 4f87337646f4d causing issues until it can be
properly investigated.
2020-11-14 13:08:35 -08:00
jpark37
af8cb162c2 obs-ffmpeg: Add missing int cast 2020-11-04 04:45:07 -08:00
Jim
b32abbe33f
Merge pull request #3083 from pkviet/srtfix4
UI: Enable sps/pps (video headers) repetition (for srt/mpegts)
2020-10-30 23:25:24 -07:00
Joel Bethke
2b8ea4b5f3 obs-ffmpeg: Add MX350 to blacklist 2020-10-29 21:04:06 -07:00
jp9000
0b24b3ae14 obs-ffmpeg/ffmpeg-mux: Fix issue with HLS
For some reason, currently unknown, FFmpeg logging has to be set to
something in order for HLS to not fail on Windows, even if it's just an
empty function.

(Author comment: I don't feel comfortable not knowing why, my theory is
that FFmpeg has an issue with this internally with HLS on Windows
related to logging or how it's trying to log, I have absolutely no idea
what's going on and if someone can enlighten me or debug FFmpeg itself
it'd be real nice to know why.)
2020-10-14 19:39:12 -07:00
jp9000
18486853a5 obs-ffmpeg: Add ability to debug ffmpeg-mux subprocess
Adds a cmake variable (DEBUG_FFMPEG_MUX) which enables FFmpeg debug
output in the ffmpeg-mux subprocess, and if on Windows, shows the
console window of the ffmpeg-mux subprocess so the current output can be
seen.
2020-10-14 18:42:22 -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
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
04596ec097 obs-ffmpeg/ffmpeg-mux: Set codec->time_base if avformat < 59 2020-10-13 13:29:17 -07:00
Maya Venkatraman
f7a468dd30 obs-ffmpeg/ffmpeg-mux: Add ability to get FFmpeg logging 2020-10-13 13:29:17 -07:00
Maya Venkatraman
c574b65488 obs-ffmpeg/ffmpeg-mux: Fix variable case 2020-10-13 13:29:17 -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
4f87337646 obs-ffmpeg: Add error detection to ffmpeg-mux
ffmpeg-mux does not notice if ffmpeg returns an error from
av_interleaved_write_frame() which means that OBS never knows if there is a
problem in ffmpeg.

This is the biggest issue for cases like srt:// or tcp:// streams that can
regularly fail. Without this change OBS never knows that something went wrong.
2020-10-03 22:26:52 -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
Gol-D-Ace
c66ebde080 Update translations from Crowdin 2020-09-27 23:07:27 +02:00
cristisilaghi
dd9f4fd22c obs-ffmpeg: Add missing translable string for "Profile" 2020-09-10 16:24:10 +03:00
Kurt Kartaltepe
8761fa1a2c obs-ffmpeg: fix crash with rawvideo
Some codecs have no recommended pix_fmts so we must check that pix_fmts
is not null before trying to find a good match. This just prays whatever
OBS is configure for is a valid format when users choose these oddball
codecs. When its not you should get a normal recording fail instead of a
crash now.

fixes #3031
2020-09-08 21:22:24 -07:00