566 Commits

Author SHA1 Message Date
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
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