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
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`.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This reverts commit 4f87337646f4db0d50a4ebb257faf0640a729805.
Reverting the line in 4f87337646f4d causing issues until it can be
properly investigated.