0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 21:13:04 +02:00
Commit Graph

160 Commits

Author SHA1 Message Date
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
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
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
Gol-D-Ace
fe56a12867 Update translations from Crowdin 2016-05-14 00:27:59 +02: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
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
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
7c3d858110 obs-ffmpeg: Remove unused variable 2016-04-24 13:01:14 -07:00
Gol-D-Ace
c2e4926323 Update translations from Crowdin 2016-04-24 19:55:39 +02:00
Gol-D-Ace
5ed7081213 Update translations from Crowdin 2016-04-23 10:29:21 +02: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
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
8e1943065c obs-ffmpeg: Add FFmpeg NVENC encoder 2016-04-19 09:20:26 -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
jp9000
1faaba73b0 obs-ffmpeg: Allow user to set color range on media source 2016-04-03 21:54:02 -07:00
jpk
c3629eacb5 libobs: Add Y800 color format support
(Note: Also modified the obs-ffmpeg plugin module)

Allows the ability for frame data to pass 8-bit grayscale images (Y800
color format).

Closes jp9000/obs-studio#515
2016-03-24 03:33:35 -07:00
jp9000
2fa7ef5807 obs-ffmpeg: When browsing files, start from last file dir 2016-03-21 21:22:24 -07:00
jp9000
69da1151e0 Update translations from Crowdin 2016-03-19 12:08:48 -07:00
Gol-D-Ace
2b7036dc93 Add latest translations from Crowdin 2016-02-21 22:16:12 +01:00
jp9000
74c78c1f13 obs-ffmpeg: Fix media source starting even if not active
If the media source is set to restart on activation, it also shuts down
when not active.  However, it would *always* start regardless of
active/inactive when the source is first created.  It shouldn't do that,
it should start up only when it becomes active.
2016-02-04 10:58:26 -08:00
dodgepong
ea9db8249b Add latest translations from CrowdIn 2016-01-31 18:28:35 -05:00
jp9000
cd97ce2a17 libobs: Add source output flag OBS_SOURCE_DO_NOT_DUPLICATE
Certain types of sources (display captures, game captures, audio
device captures, video device captures) should not be duplicated.  This
capability flag hints that the source prefers references over full
duplication.
2016-01-26 11:49:50 -08:00
jp9000
7f0f3d25c9 obs-ffmpeg: Remove overly verbose FFmpeg logging
For the time being, FFmpeg logging is disabled due to the fact that it
can just output way too much data.
2016-01-26 11:49:27 -08:00
jp9000
22885713b0 obs-ffmpeg: Add "restart when active" media source property
Adds the option of making the media file restart when the source becomes
active (such as switching to a scene with it).

Due to lack of libff features to start/stop/pause/seek media files,
currently this just destroys the demuxer and recreates it.  Ideally,
libff should have some functions to allow a more optimal means of doing
those things.
2016-01-26 11:49:26 -08:00
jp9000
419d6b1a22 obs-ffmpeg: Refactor media source properties
Reactors a bit of code related to starting up FFmpeg and makes it so the
initial view for the media source's properties displays the most
commonly desired settings.

Instead of the media source properties showing the URL mode by default
along with a whole bunch of properties that are confusing to most users,
starts on file mode and changes defaults to be a bit more sensible
related to file input.

Also, as a temporary measure for fixing color format issues (some video
files would display their color information incorrectly), forced format
conversion is now enabled by default, and has been moved to advanced
settings.  Ideally, the actual bug causing color format issues in either
media-io or libff should be fixed at some point.
2016-01-26 11:49:26 -08:00
jp9000
df4f0c4142 obs-ffmpeg: Fix media source file filter
When browsing for a file, it would also just use *.* for the file
filter, which is a pain to use.  This has been changed to use a
reasonable file filter related to common video/audio files so you don't
have to wade through non-media files just to select a media file.  A
filter to show all files is still available as well.
2016-01-26 11:49:25 -08:00
Palana
d870bbb643 obs-ffmpeg: Add custom muxer options to ffmpeg-mux 2015-11-27 15:48:24 +01:00
Palana
38c9c38b9f obs-ffmpeg: Set mux output context filename
This enables e.g. the HLS muxer to output all files in the same directory, with
appropriate names
2015-11-27 15:37:59 +01:00
Gol-D-Ace
2ee1d82860 Add latest translations from Crowdin 2015-11-16 21:04:55 +01:00
Richard Stanway
55dd8f8726 obs-ffmpeg: Fix a race condition in create_or_fetch_log_context
Another thread could be manipulating the active_log_contexts array while the current thread is trying to read it, resulting in an uninitialized memory crash as the da_push_back call was not protected by the mutex.
2015-10-12 23:21:45 +02:00
dodgepong
76c18b079b Latest translations from CrowdIn 2015-09-22 23:33:29 -04:00
jp9000
e10cf47e0d obs-ffmpeg: Fix 'possible loss of data' warnings
Fixes warning:
warning C4244: 'initializing' : conversion from 'int64_t' to 'int',
possible loss of data
2015-09-21 18:35:27 -07:00
jp9000
e54118592b obs-ffmpeg: Set colorspace/range hints
Sets the color range/space for FFmpeg output encoders that support it.
2015-09-19 08:20:17 -07:00
jp9000
8d0edc1377 obs-ffmpeg: Send stop signal on unexpected stop
This also adds the ability to detect whether it stopped due to lack of
space or not -- particularly useful for the FFmpeg output due to
lossless file format support.
2015-09-19 08:20:07 -07:00
jp9000
b96f15a625 obs-ffmpeg: Do not require encoder ids to be set
For the FFmpeg output, the encoder ids are sort of superfluous.  They
really should be optional.  If they're not set, it should use the
encoder name string instead to determine the ids automatically.
2015-09-18 22:11:49 -07:00
jp9000
6285a47726 (API Change) libobs: Pass type data to get_name callbacks
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)

API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)

This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).

NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention.  The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
2015-09-16 09:21:12 -07:00
Palana
386ee73443 obs-ffmpeg: Add custom muxer settings
This allows changing e.g. the number of segments in a hls playlist and
its caching behavior with:
"hls_allow_cache=1 hls_list_size=0"
2015-09-16 10:47:58 +02:00
Palana
d8723dbd40 obs-ffmpeg: Set FFmpeg AVFormatContext filename
This is used by some muxers that set AVFMT_NOFILE and doesn't seem to
hurt muxers that don't set it; notable this makes the hls muxer output
its m3u8 playlist with the proper filename in the proper directory
2015-09-16 10:27:35 +02:00
Mathias Panzenböck
b266b563fa obs-ffmpeg: Fix compile error
This fixes the compile error: "'AVDISCARD_NONINTRA' undeclared" when
using a libavcodec version earlier than 55.67.100.

Closes jp9000/obs-studio#469
2015-09-12 22:14:24 -07:00
kc5nra
34b95eff8a obs-ffmpeg: Sychronize logging on log context
Different logging can occur from different contexts.
This adds isolation for each context passed to the
AV log.
2015-08-14 07:53:52 -07:00
John Bradley
6e69b0f4f0 obs-ffmpeg: Move log callback up to plugin scope 2015-08-14 07:53:51 -07:00
John Bradley
d04fbd7549 obs-ffmpeg: Log source info on update/create
Adds a log message whenever the source is created or updated
containing all the properties set to help debugging remote
users' problems.
2015-08-14 07:53:50 -07:00
John Bradley
78d5240e18 obs-ffmpeg: Add more informative logging to source 2015-08-14 07:53:48 -07:00
John Bradley
207203d104 obs-ffmpeg: Normalize ffmpeg source argument name 2015-08-14 07:53:47 -07:00
John Bradley
59482ec29b obs-ffmpeg: Normalize video frame method arguments 2015-08-14 07:53:46 -07:00