Commit Graph

241 Commits (653d3ceb33b9c031c08ad45a05264593b0b8fd9f)

Author SHA1 Message Date
jp9000 653d3ceb33 obs-ffmpeg: Don't try to detect NVENC on mac 2018-01-18 01:36:46 -08:00
Michel 054d607c2d obs-ffmpeg: Improve NVENC detection
This improves detection by performing an actual check on encoder
capability directly with the NVENC/CUDA libraries.
2018-01-18 01:35:45 -08:00
jp9000 17560bf86a Revert "obs-ffmpeg: Improve NVENC detection"
This reverts commit 94b5982216.

Reverting this commit because it had some negative side effects, such as
adding 500 milliseconds to the startup time.  NVENC detection should
really be done through its proper API, and not via creating an encoder
on startup.
2018-01-12 05:35:01 -08:00
Jim 05a8969439
Merge pull request #1120 from pkviet/ffmpeg
obs-ffmpeg: Fix ffmpeg output recording in x264
2018-01-05 16:47:07 -08:00
pkviet 67e48ecc2c libobs/media-io: Replace quad with 4.0
(also obs, deps/media-playback, libobs/audio-monitoring, decklink,
linux-alsa, linux-pulseaudio, mac-capture, obs-ffmpeg, win-dshow,
win-wasapi)

Default channel layout for 4 channels is 4.0 in FFmpeg.
Replacing quad with 4.0 will improve compatibility since FFmpeg has
better support of its default channel layouts.
2018-01-05 09:48:52 -08:00
pkviet fb580535c9 libobs/media-io: Clean surround API
(also modifies obs-ffmpeg, audio-monitoring, win-wasapi, decklink,
obs-outputs)

Removes speaker layouts which are not exposed in UI.  The speaker
layouts selectable by users in the UI are the most common ones.  It is
not necessary to keep other layouts.  (This basically removes
5POINT1_SURROUND, 7POINT1_SURROUND, SURROUND =3.0).
2018-01-05 09:47:59 -08:00
pkviet 520a91323b obs-ffmpeg: Fix ffmpeg output recording in x264
Fixes ticket 1070.
See also
https://obsproject.com/forum/threads/ffmpeg-recording.77378/#post-330473
(related bugs).
The ffmpeg constant AVFMT_RAWPICTURE was deprecated in october 2015
and marked for removal at avformat major bump to version 58
(ffmpeg commit 34ed5c2 , oct 12, 2015).
The bump occured with commit 69b5ce6 (oct21, 2017).
The constant was subsequently removed (commit 693a11b, oct 26 2017).
It was removed from obs-studio with commit d670d7b (from me).
But the code block which was executed with this constant was not
removed, causing issues with ffmpeg output.
The commit fixes the issue for old ffmpeg builds as well as new ones.
The constant is reintegrated for avformat major version < 58 and removed
for version >= 58 (along with its accompanying code).
Thanks to J Lowe for help in solving the bug.
(tested on win 10, macos 10.13, ubuntu 17.10 with ffmpeg head & ffmpeg
3.4.1)
2017-12-21 23:28:35 +01:00
jp9000 0497095f97 Fix a number of GCC warnings 2017-12-06 16:42:45 -08:00
jp9000 530266917d obs-ffmpeg: Use correct function with older FFmpeg vers.
When this was being fixed up, the incorrect function name was used --
however it still compiled because the author was using the newer FFmpeg
version at the time.
2017-12-06 10:10:03 -08:00
jp9000 0d6204c8af Fix a number of MSVC warnings
Fixes a number of warnings with all modules
2017-12-05 13:53:44 -08:00
Michel 94b5982216 obs-ffmpeg: Improve NVENC detection
Certain NVIDIA GPUs don't support NVENC, but ship with the NVENC
library, causing OBS to mistakenly think that NVENC is available when it
actually isn't.

Closes jp9000/obs-studio#1087
2017-12-02 08:08:52 -08:00
pkviet bbac3280c1 libobs: Add surround sound audio support
(This commit also modifies the following modules: UI,
deps/media-playback, coreaudio-encoder, decklink, linux-alsa,
linux-pulseaudio, mac-capture, obs-ffmpeg, obs-filters, obs-libfdk,
obs-outputs, win-dshow, and win-wasapi)

Adds surround sound audio support to the core, core plugins, and user
interface.

Compatible streaming services: Twitch, FB 360 live
Compatible protocols: rtmp / mpeg-ts tcp udp
Compatible file formats: mkv mp4 ts  (others untested)
Compatible codecs: ffmpeg aac, fdk_aac, CoreAudio aac,
		   opus, vorbis, pcm (others untested).
Tested streaming servers: wowza, nginx
	 HLS, mpeg-dash : surround passthrough
Html5 players tested with live surround:
	 videojs, mediaelement, viblast (hls+dash), hls.js
Decklink: on win32, swap channels order for 5.1 7.1
         (due to different channel mapping on wav, mpeg, ffmpeg)
Audio filters: surround working.
Monitoring: surround working (win macOs linux (pulse-audio)).
VST:	 stereo plugins keep in general only the first two channels.
	 surround plugins should work (e.g. mcfx does).
OS: win, macOs, linux (alsa, pulse-audio).
Misc: larger audio bitrates unlocked to accommodate more channels
NB: mf-aac only supports mono and stereo + 5.1 on win 10
         (not implemented due to lack of usefulness)

Closes jp9000/obs-studio#968
2017-11-26 03:41:53 -08:00
jp9000 edf34fdf25 obs-ffmpeg: Log bad muxer settings with FFmpeg output 2017-11-24 21:18:57 -08:00
jp9000 ee63fc69ac obs-ffmpeg: Use muxer settings with AVIOContext
In the FFmpeg output, it was not passing the muxer settings to the
AVIOContext, so some settings would not be properly passed to protocols.
2017-11-24 21:18:52 -08:00
pkviet d670d7badb libobs: Fix FFmpeg constants
(This commit also modifies the deps/media-playback, obs-ffmpeg, and
win-dshow modules)

More fixes due to ffmpeg renaming some constants and deprecating
AVFMT_RAWPICTURE and AV_PIX_FMT_VDA_VLD.
Latter replaced by AV_PIX_FMT_VIDEOTOOLBOX per ffmpeg dev advice.

Closes jp9000/obs-studio#1061
2017-11-16 21:38:37 -08:00
Richard Stanway 95f20c84ba obs-ffmpeg: Use new ffmpeg constants 2017-10-26 19:17:53 +02:00
jp9000 7bd06e7f26 Update translations from Crowdin 2017-10-17 05:39:22 -07:00
jp9000 c9182a9878 obs-ffmpeg: Fix potential seek issues with media source
(This commit also modifies deps/media-playback)

Before, the media-playback library would detect whether something was
seekable by checking the filename for "://", which is unideal because
there are other cases where targets may not be seekable.  So instead, an
explicit "seekable" property (off by default) is now in place in the
media source when not in "local file" mode.  Seeking will only be
enabled if local file mode is on, or if "seekable" is explicitly checked
by the user.

Closes jp9000/obs-studio#1022
2017-09-17 05:55:56 -07:00
chinasarft 1ef4de7ce3 obs-ffmpeg: Don't mark to destroy media unless valid
Closes jp9000/obs-studio#1021
2017-09-15 05:51:52 -07:00
Gol-D-Ace 8d8c2e5a22 Update translations from Crowdin 2017-08-10 16:07:40 +02:00
derrod 8b3921ffbf obs-ffmpeg: Add proc handler for getting number of frames in video
Allows getting (approximate) number of frames in a media file.
2017-08-08 10:06:56 +02:00
Richard Stanway ca5f123030
obs-ffmpeg: Improved output error handling
Checks the output path is writable and checks for failure to start the
ffmpeg-mux subprocess.
2017-08-07 00:32:49 +02:00
jp9000 fa611dcd76 obs-ffmpeg: Add Opus audio encoder 2017-08-01 02:14:58 -07:00
jp9000 d2ffd0fdd2 obs-ffmpeg: Ensure sample rate is supported in audio encoder
Ensures that the sample rate is supported in the audio encoders, and if
not, then make it automatically resample to the closest sample rate.
2017-07-31 14:51:21 -07:00
jp9000 0089d379b0 obs-ffmpeg: Make FFmpeg audio encoder abstractable
Abstracts the FFmpeg audio encoder to allow other codecs to use the same
code, and makes the AAC encoder derived from it.
2017-07-31 14:48:20 -07:00
jp9000 58c4f0ac91 obs-ffmpeg: Rename obs-ffmpeg-aac.c file
Renames obs-ffmpeg-aac.c to obs-ffmpeg-audio-encoders.c due to the fact
that it can be abstracted for multiple audio encoders.
2017-07-31 14:29:50 -07:00
jp9000 cffbdd6408 obs-ffmpeg: Add proc handler function to get media duration
Allows getting the duration of a video via the proc handler of the
source.
2017-07-19 16:23:06 -07:00
Jim cfe77fdaae Merge pull request #938 from admshao/incompatible-pointer-types
plugins: Clear warnings about -Wincompatible-pointer-types
2017-07-01 10:37:32 -07:00
Shaolin e5756a922a libobs/plugins/UI: Suppress unused variables warnings
Closes jp9000/obs-studio#937
2017-06-27 21:55:37 -07:00
jp9000 d295ad3ed3 obs-ffmpeg: Remove "Buffering (MS)" property
There's no need to display this property at the moment, the default
amount is more than sufficient for most cases.  That and most people
wouldn't know what to do with it anyway.
2017-06-22 00:58:45 -07:00
Richard Stanway cef0689a36
ffmpeg-mux: Set error mode to SEM_FAILCRITICALERRORS
This prevents spurious dialog boxes appearing, such as "No disk is in the
drive" if the application attempts to access an invalid drive.
2017-06-21 17:41:08 +02:00
jp9000 b787c796cd obs-ffmpeg: Do not precache if set to close when inactive
In the media source, do not pre-cache frames if the source is set to
close the file when inactive because that setting is designed to allow
the file to be replaced by the user.  If it's replaced, it can
unintentionally keep the old precache frame, playing the frame from the
older video when it starts up.
2017-06-19 22:58:01 -07:00
jp9000 054148a0af obs-ffmpeg: Don't preload media frames if set to pause on end
Preloading is designed to overwrite the current internal render texture
of the source so it'll be ready to play the first frame right when the
source is first displayed.

However, When the media source is set to pause on the last frame, it
keeps that current render texture visible, so preloading it with the
first frame will essentially overwrite the current render, causing it to
inadvertently show and pause on the first frame rather than the last
frame.  So instead, just disable preloading when the user has it set to
pause on the last frame.
2017-06-14 08:30:44 -07:00
Shaolin cfcb2f4f39 plugins: Clear warnings about -Wincompatible-pointer-types
Signed-off-by: Shaolin <admshao@gmail.com>
2017-06-01 05:25:55 -03:00
jp9000 892a6548e7 obs-ffmpeg: Add network buffering property
(Note: This commit also modifies deps/media-playback)

Allows buffering network-based media sources where supported.  Default
is two megabytes of buffering.
2017-05-29 19:30:13 -07:00
jp9000 1738adf021 Revert "obs-ffmpeg/nvenc: Remove "default" preset"
This reverts commit d1343dc064.

Apparently people are having issues caused by this specific commit.
Going to temporarily revert for the time being.
2017-05-21 02:54:41 -07:00
Gol-D-Ace 5d25d800ad Fix German locale inconsistencies 2017-05-20 20:24:46 +02:00
Gol-D-Ace 3d2cacd782 Update translations from Crowdin 2017-05-20 10:18:41 +02:00
jp9000 c7395b05ec obs-ffmpeg: Disable media source HW accel. for now
Due to a noticeable frequency of crashes inside of FFmpeg when using
hardware encoding on mac, this feature is going to be disabled for now
pending more investigation at a later time.
2017-05-18 23:42:01 -07:00
jp9000 514387f7cd obs-ffmpeg: Always close network sources when inactive 2017-05-16 01:58:18 -07:00
jp9000 65c344d75d obs-ffmpeg: Only preload frames for local files 2017-05-16 01:58:01 -07:00
jp9000 d13fa96851 libobs: Don't use source flags for async buffering
(This commit also modifies the decklink, linux-v4l2, mac-avcapture,
obs-ffmpeg, and win-dshow modules)

Originally, async buffering for sources was supposed to be a
user-controllable flag.  However, that turned out to be less than ideal
because sources (such as the win-dshow plugin) were programmed with
automatic control over their buffering (such as automatically detecting
USB 2.0 capture devices and then enabling in those cases).

The fact that it was a flag caused a design flaw to where buffering
values would be overwritten when a source is loaded from save data.

Because of that, this flag is being deprecated and replaced with a
specific function to enable unbuffered mode instead.
2017-05-13 23:32:40 -07:00
jp9000 d6872af0a2 obs-ffmpeg: Implement get_total_bytes in recording outputs
Allows seeing statistics such as bitrate and total bytes saved for
recording outputs.
2017-05-13 01:21:20 -07:00
jp9000 8962899b77 obs-ffmpeg: Add signal/proc to restart media playback
A convenient feature if the user wants to trigger the media to play back
on the fly for whatever reason.
2017-05-10 19:54:03 -07:00
jp9000 8f4f38c30e obs-ffmpeg: Fix bug on non-MSVC compilers
This happens because the enum had the incorrect name, and microsoft
automatically treats all enums as integers in C, regardless of whether
they actually exist or not.  Microsoft makes terrible compilers and
whoever decided this was a good idea should be fired.
2017-03-31 12:45:47 -07:00
jp9000 1d69e359ec obs-ffmpeg: Always open on update unless set otherwise 2017-03-31 12:30:10 -07:00
jp9000 9174ba8403 obs-ffmpeg: Remove unnecessary open call 2017-03-31 12:28:10 -07:00
jp9000 45d029b1fb obs-ffmpeg: Change from libff to media-playback 2017-03-31 12:10:32 -07:00
BtbN d1343dc064 obs-ffmpeg/nvenc: Remove "default" preset
The "default" preset is not an actual default, but something Nvidia
decided to just call that way.  It yields the worst quality per bitrate
out of all the presets, for no actual benefits.  The actual FFmpeg
default is the hq one, which yields the best quality, especially when
twopass mode is enabled.

I can't think of a way to keep the "default" preset in a non-confusing
way, and as it gives no known benefits, might as well just remove it
entirely.

(Jim edit: Also made it so that if the settings have it set to
"default", it automatically treats it as "hq")

Closes jp9000/obs-studio#865
2017-03-25 02:08:06 -07:00
Gol-D-Ace dbf95bdc15 Update translations from Crowdin 2017-03-05 23:40:11 +01:00