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
Attempt to simply shutdown sequence to avoid race between vidoe and
write threads. Can no longer join on write thread from write thread.
Also use codecpar instead of deprecated codec member.
Add support for VIDEO_CS_SRGB.
Use SMPTE 170M for 601 instead of undef/BT470BG. This is the
American/Chromium way of handling 601.
Add color metadata to the container file as well via ffmpeg-mux.
This change breaks the tying of the 'close' option to the media
source being a local file vs. network source. In doing so, it is
possible to keep network sources streaming continuously, which
fixes a few things when using network cameras as sources:
* The preview pane works in studio mode.
* There is no delay in switching scenes before video appears.
* The multiview works properly/normally.
This does introduce one bit of weirdness which could be easily fixed
with sufficient knowledge of OBS to do it quickly: if a networked media
source fails with both 'Restart playback when source becomes active' and
'Close file when inactive' disabled, it is slightly tricky to get it to
restart the video stream. (It can be done by enabling those options and
hiding the scene, though.) It would be nice to have a simple "restart
stream" button somewhere to do this more easily.
(Note: This commit also modifies deps/media-playback)
Co-authored-by: Eric Lindvall <eric@5stops.com>
Co-authored-by: Ryan Foster <RytoEX@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
Automatically generate directories if slashes are present in a recording
name format set in advanced settings or in the replay buffer
prefix/suffix settings.
Fixesobsproject/obs-studio#2416Closesobsproject/obs-studio#2858
This replaces the ffmpeg-encoded-output which had serious issues
(missing headers, muxing issues with non compliant mpegts streams) with
an output grafted from obs-ffmpeg-mux.
Fix an issue in the way AVFrames were handled in the FFmpeg
encoder plugin, which could lead to tearing in the encoded
video due to data races in the AVFrame and AVBuffer.
This is fixed by calling av_frame_make_writable which ensures
the frame and its associated buffer are writable. If its not,
it will copy the AVFrame, create a new AVBuffer for it and
decrease the refcount of the old AVFrame and AVBuffer.
This way OBS always ends up with a usable buffer to write into
which is not still used by the encoder while avoiding a copy
when unnecessary.
The error message in the process_packet function was prefixed with
"receive_audio" because it was previously from code in the encode_audio
function which was called from the receive_audio function. This is just
a string change to avoid being misled to believe that the error is
always audio related.
If we fallback to ffmpeg NVENC, the error from new NVENC might still be
present in the encoder structure. Given that this provides a lot more
actionable information to the user, let's use it if possible.
The Auto level lets the encoder decide which level to use.
Furthermore, some devices allow levels beyond 4.2. Therefore,
we add all levels allowed by H.264. This is of importance,
since using a resolution not supported by the specified level
can trigger undefined behavior on the hardware/kernel.
Explicitly checks to make sure hotkeys are actually down, rather than
both down and up. This was causing the restart hotkey to restart the
media twice, once on key down, once on key up.
When using an IP camera on a local network, we wanted to minimize
delay. In order to achieve minimum delay, we allowed Media Source to
set BufferingMB to 0, and when it is 0, also enable AVFMT_FLAG_NOBUFFER
in the AVFormatContext flags.