Commit Graph

1135 Commits (632f0bff5abec954fe84f191affb5243002890dd)

Author SHA1 Message Date
jp9000 42d7bf1237 Revert "win-dshow: Reword "buffering" options to be more specific"
This reverts commit a6d7cbf221.
2016-07-02 12:05:10 -07:00
jp9000 a6d7cbf221 win-dshow: Reword "buffering" options to be more specific
Due to users inquiring what the "buffering" option does, it would be
best to have a bit more details in its wording as to its function.
2016-07-01 17:03:13 -07:00
jp9000 9413a43869 obs-filters: Add scaling/aspect ratio filter
Allows forcing a specific resolution or aspect ratio on a source, with
user-defined sampling.
2016-06-29 08:00:52 -07:00
Olle Kelderman c7e3dfc347 obs-filters: Change 'Crop' filter to 'Crop/Pad' filter
Allows the ability to pad in addition to cropping.  Changes the name to
Crop/Pad filter.

(Additional edits by Jim: Greatly refactored/simplified filter code)

Closes jp9000/obs-studio#532
2016-06-28 02:46:36 -07:00
Rodrigo Ipince 12fb9508b2 rtmp-services: Add Kamcord service
Closes jp9000/obs-studio#547
2016-06-27 23:52:07 -07:00
SuslikV 8a9cbaae18 image-source: Prevent random_file call when file list empty
Simple workaround to prevent integer division by zero in random_file
when add new source.

Closes jp9000/obs-studio#550
2016-06-27 20:11:03 -07:00
jp9000 bc9d68e2ad text-freetype2: Do not set default text 2016-06-27 03:18:48 -07:00
jp9000 bd70e73c25 obs-ffmpeg: Use core count for output threads by default
Recent FFmpeg versions seem to have changed the default thread count for
most codecs to 1.  Use the max core count by default as it was
originally.
2016-06-27 03:18:40 -07:00
jp9000 b012c7280a win-capture/graphics-hook: Fix vs2015 internal compiler error
Removing this union fixes the internal compile error that would occur on
visual studio 2015 update 2 and above when these variables were all in a
union.
2016-06-22 14:40:54 -07:00
jp9000 d7db0b8b01 (API Change) libobs: Fix output data cutoff on stop
(Note: This commit also modifies obs-ffmpeg and obs-outputs)

API Changed:
obs_output_info::void (*stop)(void *data);

To:
obs_output_info::void (*stop)(void *data, uint64_t ts);

This fixes the long-time design flaw where obs_output_stop and the
output 'stop' callback would just shut down the output without
considering the timing of when obs_output_stop was used, discarding any
possible buffering and causing the output to get cut off at an
unexpected timing.

The 'stop' callback of obs_output_info now takes a timestamp with the
expectation that the output will use that timestamp to stop output data
in accordance to that timing.  obs_output_stop now records the timestamp
at the time that the function is called and calls the 'stop' callback
with that timestamp.  If needed, obs_output_force_stop will still stop
the output immediately without buffering.
2016-06-22 14:10:39 -07:00
jp9000 605590606f obs-outputs: Remove send_remaining_packets
Because output stop timing has been fixed, there is no need to send the
remaining packets in the queue because it now just waits for the stop
timing anyway.
2016-06-20 02:56:33 -07:00
Kilian von Pflugk bc2b31f10b rtmp-services: Nood add offical recommends 2016-06-16 23:58:27 +02:00
jp9000 dc04acdb44 vlc-video: Add ability to add directories to playlist 2016-06-15 16:20:36 -07:00
jp9000 d0eae5d0e6 image-source: Add ability to add directories to slideshow 2016-06-15 16:20:12 -07:00
jp9000 d32424e5ad win-capture: Reset d3d9 capture if device recreated
Fixes a bug where if a D3D9 program recreates its device the capture
would become invalid.  Certain games (especially blizzard games) will
completely recreate their Direct3D device if a critical D3D9 error
occurs.
2016-06-11 12:27:06 -07:00
jp9000 d89299fc1a vlc-video: Add VLC video source
Adds the ability to add video playlists via libvlc instead of via the
media source.  This is mostly just being added as a secondary option to
the media source to reduce maintenance costs and save time.  Currently
libff cannot pause/unpause/seek, and isn't programmed to handle
playlists yet.

If VLC is installed on the computer (with the same architecture) it will
allow video playback via libVLC.  In the future, users should be able to
optionally download VLC libraries via the installer as well if they
don't want to necessarily install VLC to get the plugin working.

This plugin performs runtime linking instead of compile-time linking;
compiling VLC is not required, only its headers are required.  To
compile, clone the VLC repository and set the VLCPath cmake variable to
point to the VLC repository directory.
2016-06-06 23:53:59 -07:00
Jim aded8fccc3 Merge pull request #551 from kazukioishi/master
win-dshow: Fix audio output mode not showing up
2016-06-05 19:33:38 -07:00
jp9000 57d580f8a9 linux-capture: Convert window strings to UTF-8 strings
The UI expects everything to be in UTF-8, so convert all window strings
to UTF-8 whenever getting a window name.
2016-06-05 19:25:37 -07:00
jp9000 5d16e44899 linux-capture: Fix window capture crashes
The xcomposite window capture crashes were due to a few factors:
-------------------------------
1.) The source's X error handler was possibly being overwritten by
another part of the program despite us locking the display, presumably
something in Qt which isn't locking the display when pushing/popping its
own error handler (though this is not yet certain).  The source's calls
to X functions happen in the graphics thread, which is separate from the
UI thread, and it was noticed that somehow the error handler would be
overwritten almost seemingly at random, indicating that something else
in the program outside of OBS code was not locking the display while
pushing/popping the error handler.

To replicate this, make it so that the source cannot find the target
window and so it continually searches for it each video_tick call, then
resize the main OBS window continually (which causes Qt to push/pop its
own error handlers).  A crash will almost always occur due to BadWindow
despite our error handling.

2.) Calling X functions with a window ID that no longer exists,
particularly XGetWindowAttributes, in conjunction the unknown error
handler set in case #1 would cause the program to outright crash because
that error handler is programmed to crash on BadWindow for whatever
reason.  The source would call X functions without even checking if
'win' was 0.

3.) The source stored window IDs (in JSON, even if they've long since
become invalid/pointless, such as system restarts).  This is a bad
practice and will result in more cases of BadWindow.

Fixing the problem (reducing the possibility of getting BadWindow):
-------------------------------
Step 1.) Deprecate and ignore window IDs in stored settings.  Instead of
using window IDs to find the window, we now must always search the
windows and find the target window via the window name exclusively.
This helps ensure that we actually consistently have a working window
ID.

Step 2.) Do not call any X functions if the window ID is 0.

Step 3.) Reset the window ID to 0 any time the window has updated, and
make the source find the window again to ensure it still exists before
attempting to use any X functions on the window ID again.
2016-06-05 00:12:43 -07:00
Kazuki Oishi 7328c2e2d7 win-dshow: Fix audio output mode not showing up 2016-06-05 00:27:28 +09:00
nd f7ac9258d4 obs-filters: Change async delay filter max delay to 20 sec
Closes jp9000/obs-studio#549
2016-05-30 10:42:16 -07:00
jp9000 6ca3cd3504 win-capture: Fix VS2015 update 2 compiler error
Having volatile variables inside of a union causes a C1001 compiler
error in visual studio 2015 update 2.

Closes jp9000/obs-studio#544
2016-05-28 09:40:49 -07:00
fryshorts eed9547197 linux-pulseaudio: Check for failed operations
Add checks to make sure the pulseaudio operation objects are actually
valid and the request did not fail right away. Other pulseaudio
functions dealing with the objects expect them not to be NULL,
otherwise they will kill the application with a failing assert.
2016-05-28 13:19:16 +02:00
jp9000 1a72cd4007 obs-ffmpeg: Set AVCodecContext thread_count to 0
For some reason in the FFmpeg output, this AVCodecContext variable is
being set to 1 by FFmpeg itself somewhere, and it's causing a massive
slowdown when encoding with FFmpeg directly.  This should be set to 0 to
specify to use as many threads as necessary.
2016-05-27 10:18:02 -07:00
jp9000 3deae76395 win-dshow: Update libdshowcapture to 0.5.10
Fixes a crash with audio format enumeration
2016-05-26 15:24:16 -07:00
jp9000 e73546b521 image-source: Don't repeat same image when randomizing
When randomizing the image slide show, do not repeat the same image more
than once in a row
2016-05-26 12:12:35 -07:00
jp9000 8da65b5c99 image-source: Add option to randomize slideshow 2016-05-26 11:35:29 -07:00
jp9000 3b17416b82 image-source: Add image slideshow source 2016-05-26 11:14:22 -07:00
jp9000 e77e87007c obs-outputs: Remove unused variable 2016-05-26 09:10:21 -07:00
jp9000 f16a1b1aef obs-x264: Default to CBR if no other RC specified
This had the possibility of leaving the rc variable uninitialized.
2016-05-26 08:13:22 -07:00
jp9000 e935056887 image-source: Reset gif seek position when source activated 2016-05-26 08:13:22 -07:00
Kilian von Pflugk e4133485c6 rtmp-services: fix url 2016-05-20 20:43:29 +02:00
Kilian von Pflugk f1b2adf9f1 rtmp-services: Add Nood as a service
Nood is a Live video streaming platform and community for adults
https://www.nood.tv
2016-05-20 19:21:56 +02:00
Robin Hielscher 7e6ff1ae05 rtmp-services: Update Facebook Live encoder settings
As commented on: cab2819033 (commitcomment-17482672)
And according to: https://www.facebook.com/facebookmedia/get-started/live

Max 2-second keyframe interval and max video bitrate of 2500.

Closes jp9000/obs-studio#541
2016-05-17 04:23:28 -07:00
jp9000 757c1942dc obs-ffmpeg: Fix NVENC lossless mode
Lossless mode is set through the preset setting, and the profile ffmpeg
setting was incorrectly being set as lossless instead.
2016-05-16 04:18:29 -07:00
jp9000 48185cc404 rtmp-services: Update restream.io 2016-05-15 12:23:09 -07:00
jp9000 b101868e47 Revert "win-capture: Don't draw window if minimized"
This reverts commit 997f05f10e.
2016-05-15 06:14:18 -07:00
jp9000 997f05f10e win-capture: Don't draw window if minimized 2016-05-15 04:35:29 -07:00
jp9000 5a5b8b20e3 win-capture: Clear window capture if window no longer exists 2016-05-15 04:35:01 -07:00
jp9000 d24a81868e win-capture: Do not render game capture if not active 2016-05-15 04:20:39 -07:00
Gol-D-Ace fe56a12867 Update translations from Crowdin 2016-05-14 00:27:59 +02:00
jp9000 2707f05c46 Revert "win-capture: Allow window capturing of current process"
This reverts commit 8d520b970d.

This can actually cause a hard lock due to the windows API when
destroying window capture.  When the graphics thread locks the source
list for doing tick or render, and then the UI thread tries to destroy a
source, the UI thread will wait for the graphics thread to complete
rendering/ticking of sources.  The video_tick of window capture would
then check windows in the same process and try to query the window's
name via GetWindowText.  However, GetWindowText is synchronous, and will
not return until the window event has been processed by the UI thread,
so it will perpetually lock because the two threads are waiting for each
other to finish.
2016-05-13 04:21:39 -07:00
jp9000 8d520b970d win-capture: Allow window capturing of current process
Allows window capture to capture windows of the current process, and
adds windows of the current process to the end of the window list.
2016-05-13 02:14:24 -07:00
jp9000 a140d749f2 obs-ffmpeg: Fix type size mismatch warning 2016-05-12 23:01:45 -07:00
jp9000 e73b025533 obs-ffmpeg: Fix ffmpeg-mux unicode file saving (win32)
On windows, if you were saving a file name or directory with characters
that are not of the current windows character set, it could cause the
file saving process to fail.  This fixes it so that on windows it uses
wmain and converts the unicode command line to a UTF-8 command line,
which works with FFmpeg.
2016-05-12 20:20:49 -07:00
jp9000 bd9980a206 win-capture: Reset game cap. wait_for_target_startup on update
This flag should be reset when the user changes the game capture
settings.
2016-05-12 19:42:00 -07:00
jp9000 94e22dae49 win-capture: Instantly capture already-hooked processes
If a process is already hooked, immediately initialize the capture
rather than wait for the processes to initialize or wait for the timer
to trigger.
2016-05-12 19:38:46 -07:00
jp9000 8681baeec3 win-capture: Shut down game cap. when not showing
Prevents game capture from acting as a global source.  This fixes an
issue where a game capture in another scene could capture a window and
prevent a separate game capture in the current scene from being able to
capture that same window.
2016-05-12 19:36:33 -07:00
jp9000 9493095c25 win-capture: Shut down win8 monitor capture when not showing
Completely shut down monitor capture when it's not being shown in the
program (for example in a different scene).  This fixes an issue where
it would cause lag when a game enters fullscreen mode.
2016-05-12 17:59:01 -07:00
jp9000 2801cf0f37 rtmp-common: Use "rate_control" to set CBR mode
Instead of using "cbr" to set the rate control mode for encoders (which
is now considered deprecated for all encoders), set "rate_control" to
"CBR".
2016-05-11 13:12:32 -07:00
jp9000 7f1cabd81b obs-x264: Add rate control, deprecate "use cbr" setting
Instead of having a "cbr" setting that turns CBR on and off, adds a
"rate_control" parameter that sets the rate control method, which can be
one of the following: CBR, ABR, VBR, CRF.

If the "cbr" setting is used, it will throw a deprecation warning to the
log.
2016-05-11 13:12:31 -07:00
jp9000 c7923bcbe4 obs-qsv11: Add deprecated warning for forced CBR mode
Using the "cbr" parameter is now considered deprecated in favor of using
"rate_control" to set the rate control method.
2016-05-11 13:12:31 -07:00
jp9000 978e607522 obs-ffmpeg: Change NVENC to use rate control
Instead of using an option that turns CBR on/off, adds rate control
methods: VBR, CBR, CQP, Lossless.

This moves lossless from being a preset to being a rate control method.
2016-05-11 13:12:30 -07:00
jp9000 0157d02564 obs-ffmpeg: Add lossless mode to NVENC encoder 2016-05-05 15:24:32 -07:00
jp9000 ff38176c60 obs-ffmpeg: Increase upper NVENC bitrate limit
The bitrate for the properties was capped at 90000, which is a bit low.
2016-05-04 20:31:12 -07:00
Gol-D-Ace f507d70033 rtmp-services: Bump version for services.json to 20 2016-05-01 22:54:59 +02:00
CallumHoward cab2819033 rtmp-services: Add Facebook Live as a service
Closes jp9000/obs-studio#539
2016-05-01 13:08:32 -07:00
jp9000 61ab648bac obs-qsv11: Fix QSV rescaling
When using per-encoder rescaling, QSV would overwrite the current
encoder scale value in the get_video_info callback with the base video
width/height instead of using the current encoder width/height.
2016-04-28 16:01:38 -07:00
Richard Stanway 65fcd20242
libff: Improved handling of EOF in the decoder threads
(Also modifies obs-ffmpeg to handle empty frames on EOF)

Previously the demuxer could hit EOF before the decoder threads are
finished, resulting in truncated output. In the worse case scenario the
demuxer could read small files before ff_decoder_refresh even has a chance
to start the clocks, resulting in no output at all.
2016-04-28 23:58:28 +02:00
jp9000 b16557371c obs-outputs: Improve error handling when sending headers
There was no error checking when sending headers/metadata, so what would
happen is that if a header/metadata send failed (meaning the socket was
disconnected), it would continue to act as if it was still connected,
and it would block and lock up on the next send/recv call.
2016-04-26 20:14:31 -07:00
Richard Stanway e5e5189c7b
win-capture: Make sure we don't try to hook ourselves
Can trigger when using "Hook any fullscreen application" is enabled and
the projector is active.
2016-04-25 23:46:20 +02:00
jp9000 5edc0c9580 obs-filters: Fix more chroma key shader code
In aa4e18740a I mistakenly thought that I could add the variables
back in and that it would automatically cull variables that aren't used,
but that wasn't the case -- the shader parser always checks to see
whether parameters were set, and if they're not, it'll fail.  This fixes
an issue where the shader would try to access parameters that are no
longer needed and fail due to the shader parameter check.

YUV-based shader support has been removed (due to the fact that no
sources ever use YUV shading) so there's no reason to keep around the
YUV processing code.
2016-04-24 15:57:46 -07:00
jp9000 aa4e18740a obs-filters: Fix chroma key shader bug 2016-04-24 13:55:39 -07:00
jp9000 7c3d858110 obs-ffmpeg: Remove unused variable 2016-04-24 13:01:14 -07:00
Richard Stanway 8f3289fc4d
text-freetype2: Fix a crash if there's insufficient glyph texture space 2016-04-24 20:21:07 +02:00
Gol-D-Ace c2e4926323 Update translations from Crowdin 2016-04-24 19:55:39 +02:00
jp9000 1bec777210 image-source: Set starting browse path to last used file dir
Set the starting browse path to the directory of the current file used
for the source.
2016-04-23 20:22:11 -07:00
jp9000 448ae26e64 obs-qsv11: Prevent more than one active QSV encoders
Currently, multiple QSV encoders cannot be active at the same time
(otherwise it will crash).  This is a temporary solution to prevent
crashes from occurring when more than one QSV encoder tries to start up
at the same time.

Additionally, in the future there should be a way for encoders to be
able to communicate with the front-end when an error such as this
occurs.
2016-04-23 16:18:02 -07:00
jp9000 6f02d33673 obs-qsv11: Remove unused global variable 2016-04-23 14:55:40 -07:00
jp9000 5349bbf633 obs-filters: Skip scroll filter if parent has no cx/cy
There's no point in the filter continuing its processing if there's
nothing to draw.
2016-04-23 14:39:38 -07:00
jp9000 a23d8e3f2c obs-filters: Fix scroll filter offsets becoming non-finite
If the parent source of a scroll filter has a 0 width or 0 height, the
scroll filter would do a division by zero on the size_i variable, which
would then cause the offset variable to perpetually have a non-finite
value, thus preventing the scroll filter from rendering properly after
that due to the non-finite offset value being uploaded to the shader.
2016-04-23 14:39:37 -07:00
Richard Stanway 215f2441e2
text-freetype2: Don't create vertex buffer if text is empty 2016-04-23 17:49:04 +02:00
jp9000 bc38427862 obs-qsv11: Rename encoder 2016-04-23 07:34:12 -07:00
Gol-D-Ace 5ed7081213 Update translations from Crowdin 2016-04-23 10:29:21 +02:00
jp9000 ff99ba7818 libobs: Allow filter processing function to return false
(Note: this commit also modifies the obs-filters and test-input modules)

Changes the obs_source_process_filter_begin return type so that it
returns true/false to indicate that filter processing should or should
not continue (for example if the filter is bypassed or if there's some
other sort of issue that causes the filtering to fail)
2016-04-22 10:18:12 -07:00
jp9000 42305f1c98 text-freetype2: Don't draw anything if no text to draw
Under certain circumstances (when there's no text and a filter is
applied for example) the freetype 2 text source would still draw.
2016-04-22 08:23:44 -07:00
jp9000 86a41f844f obs-ffmpeg: Remove unused variable 2016-04-19 18:21:15 -07:00
jp9000 ba70b44152 obs-ffmpeg: Also remove 'tier' from locale text 2016-04-19 16:14:03 -07:00
jp9000 98cc538776 obs-ffmpeg: Remove 'tier' from FFmpeg NVENC encoder
The 'tier' parameter is used with the NVENC HEVC encoder, not with the
AVC encoder.
2016-04-19 14:45:46 -07:00
jp9000 a39cde9d08 obs-qsv11: Fix win7 crash when fake monitor isn't forced
When using QSV is used on a windows 7 machine with a dedicated card, you
have to fake a monitor connection to your Intel graphics to be able to
use QSV.  If you do not, the initialization will fail with an error.
The error for that situation is not handled properly, and a variable
will be used while null.  Instead, the function should safely return
after that error is received.

Also, do not call ClearData in the destructor unless QSV has been
properly initialized (if m_pmfxENC is null).
2016-04-19 12:29:50 -07:00
jp9000 43eba49a50 obs-ffmpeg: Fix warning and remove unnecessary null checks
The if statement erroneously ended with a ';', which means that the code
is always executed, but there's no reason to even have these if checks
in the first place as the functions themselves return safely with null
pointers.
2016-04-19 10:29:34 -07:00
jp9000 17132ba27f win-mf: Deprecate MF NVENC encoder 2016-04-19 09:20:27 -07:00
jp9000 8e1943065c obs-ffmpeg: Add FFmpeg NVENC encoder 2016-04-19 09:20:26 -07:00
jp9000 81313dfd35 win-mf: Deprecate MF QSV encoder 2016-04-19 08:29:23 -07:00
Seung-Woo Kim 3e4bcf06bc obs-qsv11: Add native obs-studio QSV encoder 2016-04-19 08:29:22 -07:00
jp9000 d56dc4791d win-capture: Fix cursor corruption bug (typo) 2016-04-18 18:34:41 -07:00
jp9000 bef1b37ae2 win-capture: Fix case where hook only captures one frame
When using a chain hook method (forward or reverse), it was unwisely
assumed that the previous hook in the chain would not overwrite new
hooks when it's called.  When the game capture hook calls the previous
hook in the chain, certain other programs that hook (in this case,
rivatuner on-screen display) would overwrite the hook with older data
and erase the game capture hook, causing it to only capture the first
frame and then never capture again.

This patch ensures that the hook is always saved before calling the next
hook in the chain and then restored after the call returns.  It also
preserves any new hooks that may be added on top of it at any point.
2016-04-14 23:45:19 -07:00
Richard Stanway c42f666b02
obs-outputs: Fix assign instead of compare on socket address type
Detected by Coverity Scan (CID 92187, 92170)
2016-04-13 02:23:23 +02:00
jp9000 a589ea8c14 rtmp-services: Use "scenecut=0" x264 option for Twitch
This option is an x264-specific feature that may generate additional
keyframes when a major visual change in the output is detected.  This
functionality is undesirable for streaming because it can cause
keyframes to become inconsistent and unpredictable, which can negatively
affect viewer buffering.
2016-04-09 23:39:12 -07:00
jp9000 87810bcf1a rtmp-services: Add the ability to specify custom x264 opts
Certain services may request certain x264-specific options (such as
scenecut=0 to prevent additional keyframes from being generated)
2016-04-09 23:34:16 -07:00
jp9000 cdcb8d1f81 obs-ffmpeg: Fix warnings with FFmpeg 3.0.0+
Fixes warnings with deprecated function av_free_packet (which was
replaced by av_packet_unref)
2016-04-09 18:10:48 -07:00
Gol-D-Ace ad31acca5d rtmp-services: Update restream.io ingests 2016-04-09 17:57:49 +02:00
Aesen Vismea 9cf56f8b4c linux-capture: Add "Use alpha-less texture format" option
This is to work around a Mesa issue that prevents copying
between RGB and RGBA textures. Other drivers seem to allow
this, even though it's technically not allowed by the GL
spec.

Closes jp9000/obs-studio#514
2016-04-08 03:17:33 -07:00
Guillermo A. Amaral f6a940cce7 linux-alsa: Add ALSA audio input plugin (linux)
Closes jp9000/obs-studio#494
2016-04-08 02:53:21 -07:00
jp9000 1faaba73b0 obs-ffmpeg: Allow user to set color range on media source 2016-04-03 21:54:02 -07:00
jp9000 d8a357e01a image-source: Use os_stat instead of stat
(Note: This commit also modified text-freetype2)

Prevents issues from being able to update files that may not be using
the current system encoding on windows.
2016-04-03 18:03:52 -07:00
jp9000 e460dfeb83 win-dshow: Add 'deactivate when not showing' option
Useful for two purposes:

1.) When many devices are hooked up to the system and used in separate
scenes, but only one device active at once is desired

2.) Allows users who are dependent on outputting audio to desktop to
disable that audio (via disabling that device) when the device isn't
being displayed
2016-04-03 15:55:15 -07:00
jp9000 22a766ef80 rtmp-services: Add mSportz service 2016-04-03 15:29:09 -07:00
hwdro 262599f0f2 obs-transitions: Add 'Fade to Color' transition
Closes jp9000/obs-studio#521
2016-03-24 16:23:29 -07:00
jp9000 2f2cb138bb obs-outputs: Remove trailing/leading whitespace from key/url 2016-03-24 13:42:54 -07:00