465 Commits

Author SHA1 Message Date
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
jpark37
b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
Clayton Groeneveld
d2d99ac5fc obs-ffmpeg: Fix crash when seeking with no media
This fixes a crash when seeking when there is no valid
media.
2020-08-24 02:43:42 -05:00
pkv
73ac96ac7c obs-ffmpeg: Allow video headers repetition in IDR and bitstream for jim-nvenc
This commit adds a repeat_headers setting which will allow sps/pps
repetition and AUDs(access unit delimiters) .
Repetition is ensured by h264config->repeatSPSPPS &
h264config->disableSPSPPS;
the two parameters are set by nvenc to true on default.
When video headers repetition is required, we set the second in
jim-nvenc to false so that SPS/PPS are written into bitstream.
The first parameter could be omitted but is exposed since repetition of
video headers might not be required.
When headers repetition is enabled, we also enable AUD to facilitate
decoding.
Typically the video headers repetition will be useful for mpegts and
DVB broadcast decoders.
2020-08-23 11:10:10 +02:00
Jim
bfdf5dc947
Merge pull request #2356 from jpark37/sycc-color-space
Color space refinements
2020-08-05 08:58:21 -07:00
jp9000
4b17b82aab obs-ffmpeg: Set async video frame immediately when seeking 2020-07-29 13:59:49 -07:00
Richard Stanway
80803aa2f7 obs-ffmpeg: Clear texture when starting playback
This prevents a stale texture from being visible for a single frame when
there is no preloaded video.
2020-07-23 23:56:30 +02:00
jpark37
ffbc3ed923 obs-ffmpeg: Fix race and deprecation warnings
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.
2020-07-19 12:49:53 -07:00
jpark37
37f01b35f6 obs-ffmpeg: Improve color space handling
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.
2020-07-18 19:44:13 -07:00
jpark37
be4a859383 obs-ffmpeg: Fix FFmpeg deprecation warnings 2020-07-18 18:47:58 -07:00
Clayton Groeneveld
990a07dc18 UI, obs-ffmpeg, obs-filters: Fix compile warnings 2020-07-16 23:15:13 -05:00
Exeldro
663605f650 obs-ffmpeg: Fix play pause crash 2020-07-12 20:11:47 +02:00
Jeremy Cole
974cd4350b obs-ffmpeg: Allow continuous network streaming
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.
2020-07-08 07:05:11 -07:00
yoho
0a4b1d622c obs-ffmpeg: Add auto reconnect to remote media sources
(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>
2020-07-05 08:31:05 -07:00
jp9000
002886bbac obs-ffmpeg, UI: Allow slash in recording names
Automatically generate directories if slashes are present in a recording
name format set in advanced settings or in the replay buffer
prefix/suffix settings.

Fixes obsproject/obs-studio#2416
Closes obsproject/obs-studio#2858
2020-06-27 05:21:14 -07:00
Richard Stanway
ea7bb7a7cd obs-ffmpeg: Show friendly error for NV_ENC_ERR_INVALID_VERSION 2020-05-24 14:42:14 +02:00
Jim
9607a9f46e
Merge pull request #2384 from LiamCoal/allow-no-buffering
media-playback: Unbuffered Media Source
2020-05-21 17:40:08 -07:00
Jim
89ccad8a2b
Merge pull request #2619 from dgcampea/ffmpeg-vaapi
Expose more levels and profiles for FFmpeg VAAPI
2020-05-20 19:49:41 -07:00
pkv
91418e901c obs-ffmpeg: Use obs-ffmpeg-mux for mpegts network output
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.
2020-05-19 16:15:41 -07:00
jp9000
c165798959 obs-ffmpeg: Move file read error to separate function
Moves the code that generates a file read error message to its own
function for the sake of cleaning things up a bit.
2020-05-19 16:10:06 -07:00
pkv
c8ff234255 obs-ffmpeg: Enable mpegts network URL for ffmpeg-mux 2020-05-18 22:18:23 -07:00
jp9000
7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
Marvin Scholz
9ef263f81a obs-ffmpeg: Fix AVFrame handling in FFmpeg output
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.
2020-05-06 02:55:52 +02:00
Jim
f6dc71089a
Merge pull request #2814 from cg2121/media-hotkeys
obs-plugins: Check if sources are showing for media hotkeys
2020-05-03 06:49:31 -07:00
Ryan Foster
7fdfb847f8 obs-ffmpeg: Update error message in process_packet
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.
2020-04-29 19:04:54 -04:00
Clayton Groeneveld
62b1911e33 obs-plugins: Check if sources are showing for media hotkeys 2020-04-26 21:57:01 -05:00
Richard Stanway
6fac77b69f obs-ffmpeg: Add error message for non-zero GPU 2020-04-27 01:22:34 +02:00
Richard Stanway
35e218e05b obs-ffmpeg: Add localization for NVENC error messages 2020-04-27 01:22:05 +02:00
Richard Stanway
6b441a180c obs-ffmpeg: Preserve error message from new NVENC
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.
2020-04-26 23:35:28 +02:00
Richard Stanway
aa97534057 obs-ffmpeg: Log why new NVENC might not be used 2020-04-26 23:32:51 +02:00
Colin Edwards
55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
Richard Stanway
4fda6cf846
Merge pull request #2700 from Bennik2000/mantis_0001603
obs-ffmpeg: Fix media source not closing file when inactive
2020-04-18 21:24:25 +02:00
Bennik2000
26810c31b6 obs-ffmpeg: Fix media source not closing file when inactive 2020-04-13 09:13:16 +02:00