Commit Graph

285 Commits (1c4a6ca6c67d723d6729c357f59e5b2db768096f)

Author SHA1 Message Date
jp9000 d9786a7d0a obs-ffmpeg: Add 'save' to replay buffer proc handler
Allows saving replays programmatically without having to use hotkeys.
2017-02-20 23:39:52 -08:00
Richard Stanway f86c538a5f
obs-ffmpeg: Fix custom audio codec parameters 2017-02-16 21:44:08 +01:00
Richard Stanway 4303253920
obs-ffmpeg: Be more verbose when custom params fail 2017-02-16 21:42:25 +01:00
juvester 133f8c311e obs-ffmpeg: Fix compiler warnings 2017-02-08 16:25:54 +02:00
jp9000 a47ef76bd5 obs-ffmpeg: Do not use HW accel by default on mac
Due to crashes being caused by hardware acceleration in the media source
on mac, disable hardware acceleration of the media source being on by
default for the time being.
2017-02-06 15:10:02 -08:00
Gol-D-Ace 6223ed6520 Update translations from Crowdin 2017-01-07 00:23:16 +01:00
Gol-D-Ace 69f0bc244a Update translations from Crowdin 2016-12-23 20:46:47 +01:00
jp9000 cef4cba576 obs-ffmpeg: Fix nvenc_h264 deprecated message
The encoder name was changed from "nvenc_h264" to "h264_nvenc", and will
throw a warning in the log file if you use the former, so try the latter
first, then the former.
2016-12-21 19:27:55 -08:00
shiina424 0d5a23d5f7 obs-ffmpeg: Don't allow 32kb/s with FFmpeg AAC encoder
FFmpeg's AAC encoder is unideal at very low bitrates.

Closes jp9000/obs-studio#722
2016-12-18 06:16:16 -08:00
jp9000 f2e85b8352 obs-ffmpeg: Add replay buffer output
This output allows buffering the encoded data, and then muxing the
current buffer to a file on the spot via a hotkey the user sets.
2016-12-08 03:36:17 -08:00
Gol-D-Ace 2d47dc4e2c Update translations from Crowdin 2016-11-20 12:22:26 +01:00
Gol-D-Ace 90e805ad9b Update translations from CrowdIn 2016-11-16 00:32:47 +01:00
Ricardo Constantino 8c3b475812
obs-ffmpeg: Fix assumption about plane height with i444
Affected both FFmpeg and nvenc encoders.
Fixes issue 667.
2016-11-09 16:04:12 +00:00
jp9000 ed85b22534 Update translations from CrowdIn 2016-11-03 13:32:52 -07:00
Warren Turkal 40a5436549 obs-ffmpeg: Fix a couple printf compiler warnings. 2016-10-30 19:56:08 -07:00
jp9000 a7ef10f7ea obs-ffmpeg: Add b-frames to NVENC logging 2016-10-20 06:51:21 -07:00
Richard Stanway a8020b37be obs-ffmpeg: Fix possible NVENC crash
If the codec hasn't even been fully initialized, calling these functions
in the shutdown code could cause a crash.
2016-09-28 15:24:04 -07:00
jp9000 1e0d5e7b3e obs-ffmpeg: Add b-frame support to NVENC (default: 2)
It was unintentionally using intra-only before, impacting quality.
2016-09-26 14:46:56 -07:00
derrod 3b3933b42f obs-ffmpeg: Fix (put back in) "profile" NVENC setting
The profile setting may have been unintentionally removed in 0157d02564.

Closes jp9000/obs-studio#616
2016-09-16 19:55:18 -07:00
jp9000 c5c1e34d09 obs-ffmpeg: Free remaining NVENC frames on exit
This clears out remaining NVENC frames to ensure that the encoder has
finished processing before shutting down.
2016-09-13 09:17:07 -07:00
jp9000 9a58772a01 obs-ffmpeg: Allow ffmpeg_mux forced stop even when stopping 2016-09-09 17:39:19 -07:00
Gol-D-Ace cb036b2713 Update translations from Crowdin 2016-08-08 16:21:48 +02:00
Gol-D-Ace 81adb13f59 Update translations from Crowdin 2016-07-06 01:18:27 +02:00
jp9000 f8fcba2fa2 Revert "obs-ffmpeg: Use core count for output threads by default"
This reverts commit bd70e73c25.

Turns out the commit was due to a miscommunication -- the commit it was
fixing actually worked fine, and this fix was unnecessary.
2016-07-02 23:54:43 -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 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
kc5nra 34cc2438c1 obs-ffmpeg: Output ffmpeg messages line by line 2015-08-14 07:53:45 -07:00
jp9000 c87d3b1f12 cmake: Rename FindFFMpeg to FindFFmpeg
This was sort of driving me crazy: The 'm' in FFmpeg isn't supposed to
be capitalized.
2015-07-18 16:32:26 -07:00
jp9000 50b47a6861 obs-outputs: Use actual audio encoder sample rate 2015-07-09 10:43:32 -07:00
dodgepong fb679bdd02 Add latest translations from CrowdIn 2015-07-08 14:56:07 -04:00
jp9000 5f75993882 obs-ffmpeg: Improve AAC logging
Adds a separator and uses better logging techniques
2015-07-06 17:03:40 -07:00
jp9000 d1e9b9d66a obs-ffmpeg: Fix potential integer overflows
This particularly affected audio encoding, audio encoding previously
would count samples and use it to create an encoding timestamp, but
because I was using a standard integer (which is 32bit by default on
x86), it would max out at about 0x7FFFFFFF samples, which is about 12
hours of samples at 48000 sample rate.  After that, it would start going
into negative territory (overflowing).  By changing it to int64_t, it
will make it so that audio at 48000 samples per second would only be
able to overflow after about..  6.09 million years.  In other words,
this should fix the issue for good.
2015-07-03 17:18:08 -07:00
jp9000 9048743ebe obs-ffmpeg: Add ffmpeg muxer
In addition to the flv file format, this allows the ability to save to
container formats such as mp4, ts, mkv, and any other containers that
support the current codecs being used.

It pipes the encoded data to the ffmpeg-mux process, which then safely
muxes the file from the encoded data.  If the main program unexpectedly
terminates, the ffmpeg-mux piped program will safely close the file and
write trailer data, preventing file corruption.
2015-06-21 22:34:49 -07:00
jp9000 33a040b025 obs-ffmpeg: Add ffmpeg muxer pipe program 2015-06-21 22:34:49 -07:00
jp9000 4d75c888a3 obs-ffmpeg: Use timestamps from video/audio frames
Instead of using system timestamps for playback, use the timestamps
directly from the video/audio data to ensure all the data is synced up
using the obs_source back-end.

I think the original misconception when this was written was that OBS
would not handle timestamp resets/loops, which isn't the case; it will
actually handle all timestamp resets and abnormalities.  It's always
best to use the obs_source back-end for all playback and syncing.
2015-06-10 09:44:25 -07:00
dodgepong d0fbe3b382 Add latest translations from CrowdIn 2015-05-08 17:10:39 -04:00
kc5nra 5b97cfbbdd obs-ffmpeg: Only set codec ids if format non-null
In the settings if you select default container then the
format becomes null.  If null then audio/video codec ids should
not be set on the output format as they will both be
AV_CODEC_ID_NONE causing a context with no streams specified
to be created (error).
2015-04-26 17:31:21 -05:00
jp9000 c33384fe7a obs-ffmpeg: Add support for YUV 4:4:4
Add support for YUV 4:4:4 output (if supported by the encoder currently
in use by FFmpeg)
2015-04-18 00:03:14 -07:00
jp9000 4d002f588b (API Change) Remove encoder callback boilerplate
API Changed (in struct obs_encoder_info):
----------------------------------------
bool (*get_audio_info)(void *data, struct audio_convert_info *info);
bool (*get_video_info)(void *data, struct video_scale_info *info);

To:
----------------------------------------
void (*get_audio_info)(void *data, struct audio_convert_info *info);
void (*get_video_info)(void *data, struct video_scale_info *info);

The encoder video/audio information callbacks no longer need to manually
query the libobs video/audio information, that information is now passed
via the parameter, which the callbacks can modify.

The refactor that reduces boilerplate in the encoder video/audio
information callbacks also removes the need for their return values, so
change the return types to void.
2015-04-17 20:17:43 -07:00
jp9000 908a165d62 Add planar YUV 4:4:4 format support
Adds the ability to natively output with planar YUV 4:4:4.
2015-04-17 20:16:40 -07:00
vividnightmare f29f286402 obs-ffmpeg: Only set x264 opts if actually x264
Check the actual name of the codec before applying an x264-specific
preset so we don't encounter an "Invalid argument" error when using
other h264 encoders in FFmpeg (such as NVEnc).

Closes jp9000/obs-studio#412
2015-04-11 06:06:04 -07:00
Ethan Lee fd4f2e29aa Buildfix for older FFmpeg versions (F20 RPMFusion) 2015-04-01 06:50:22 -04:00
kc5nra f04be51947 obs-ffmpeg: Set channel layout to avoid warning 2015-03-30 17:58:44 -05:00
kc5nra aa82340a1e obs-ffmpeg: Set stream time_base to avoid warnings 2015-03-30 17:58:44 -05:00
kc5nra c53f8cbed8 obs-ffmpeg: Add format and codec id support
Allow specification of specific codec ids and container
format to muxing.
2015-03-30 17:58:37 -05:00
John Bradley 4c570826c2 obs-ffmpeg: Workaround for a64 encoder bug
the Commodore A64 codecs seem to deref the video frame
too many times causing a crash.  For now just skip if this
codec.
2015-03-30 17:30:38 -05:00
kc5nra f128283655 obs-ffmpeg: Fix outputs without both video/audio
Fixes a crash in formats that don't support both video and audio
streams.
2015-03-30 17:30:38 -05:00
John Bradley fc596f6141 obs-ffmpeg: Fix spurious bad channel layout
Some formats (like WMV) would send out audio packets that
had channels set but did not specify a channel layout.
Solution is to no longer rely on channel layout to get the
channels and just get the channel count directly off the
FFmpeg audio frame.
2015-03-30 10:59:59 -05:00
dodgepong a04548070c UI: Add latest translations from CrowdIn 2015-03-25 20:51:25 -04:00
kc5nra 946b9d01e3 obs-ffmpeg: Clearer meaning for ClearMediaOnEnd 2015-03-24 07:25:57 -05:00
kc5nra dd2d6494a1 obs-ffmpeg: Add clear on media end option
Clears source video when the media stream ends.
2015-03-24 00:21:24 -05:00
kc5nra c7ad555eae obs-ffmpeg: Handle null frames in frame callbacks
This is in preparation of an API change that will send null
frames to signal the end of the media being played.
2015-03-24 00:16:35 -05:00
kc5nra b091b03291 obs-ffmpeg: Split definition and assignment 2015-03-24 00:12:10 -05:00
kc5nra 54baa1a369 obs-ffmpeg: Change from sws_* cacheing to our own
Since sws_getCachedContext possibly logs a message every
time it is used (depending on the input), use our own caching
logic to minimize log spam.
2015-03-23 22:14:42 -05:00
John Bradley d69f03c6a5 obs-ffmpeg: Use deferred update flag for properties 2015-03-19 16:02:24 -05:00
John Bradley c539c16ecc obs-ffmpeg: Instead of failing with unsupported CS, use default 2015-03-19 14:40:24 -05:00
John Bradley 52aae96f74 obs-ffmpeg: Add alias of CS601 support 2015-03-19 14:40:24 -05:00
John Bradley 17f8e3c58b obs-ffmpeg: Add frame drop controls to the ffmpeg source UI 2015-03-19 14:40:24 -05:00
jp9000 9832a760b8 (API Change) Always use planar float audio output
Core API functions changed:
-----------------------------
EXPORT bool obs_reset_audio(struct audio_output_info *aoi);
EXPORT bool obs_get_audio_info(struct audio_output_info *aoi);

To:
-----------------------------
EXPORT bool obs_reset_audio(const struct obs_audio_info *oai);
EXPORT bool obs_get_audio_info(struct obs_audio_info *oai);

Core structure added:
-----------------------------
struct obs_audio_info {
	uint32_t            samples_per_sec;
	enum speaker_layout speakers;
	uint64_t            buffer_ms;
};

Non-interleaved (planar) floating point output is standard with audio
filtering, so to prevent audio filters from having to worry about
different audio format implementations and for the sake consistency
between user interfaces, make it so that audio is always set to
non-interleaved floating point output.
2015-03-12 22:22:02 -07:00
John Bradley f23d958122 obs-ffmpeg: Cache picture buffer in the same way as sws context 2015-03-10 14:37:28 -05:00
John Bradley baea0f583a obs-ffmpeg: Remove extra curly braces 2015-03-10 14:34:37 -05:00
John Bradley a73c15ae16 obs-ffmpeg: Fix bug where update_sws_context result not checked 2015-03-10 14:33:21 -05:00
John Bradley e13bb8f479 obs-ffmpeg: Cache swscale context during frame callback
Some codecs don't report the correct dimensions until the first
frame is rendered.
2015-03-10 12:53:17 -05:00
John Bradley 0e944735e0 obs-ffmpeg: Fix error fetching properties from wrong pointer 2015-03-10 12:25:24 -05:00
John Bradley 2fc6c4d725 obs-ffmpeg: Add FFMpeg input source 2015-03-09 21:22:32 -05:00
John Bradley 8a32345071 obs-ffmpeg: Add FFmpeg format -> obs format func 2015-03-09 21:22:32 -05:00
dodgepong eb918d01b4 Add latest translations from CrowdIn 2015-02-09 19:26:17 -05:00
martell b8055ed944 obs-ffmpeg: avoid w32-pthreads for mingw-w64
mingw-w64 provides its own pthreads library
2015-02-09 03:41:51 -08:00
jp9000 d3f92ca5d6 obs-ffmpeg: Make FFmpeg a usable output
This makes FFmpeg usable as an output, and removes or changes most of
the code that was originally intended for testing purposes.

Changes the settings for the FFmpeg output to the following:
* url:             Sets the output URL or file path
* video_bitrate:   Sets the video bitrate
* audio_bitrate:   Sets the audio bitrate
* video_encoder:   Sets the video encoder (by name, blank for default)
* audio_encoder:   Sets the audio encoder (by name, blank for default)
* video_settings:  Sets custom video encoder FFmpeg settings
* audio_settings:  Sets custom audio encoder FFmpeg settings
* scale_width:     Image scale width (0 if none)
* scale_height:    Image scale height (0 if none)

The reason why scale_width and scale_height are provided is because it
may internally convert formats, and it may be a bit more optimal to use
that scaler instead of the pre-output scaler just in case it already has
to convert formats internally anyway (though you can do it either way
you wish).

Video format handling has also changed; it will now attempt to use the
closest format to the current format if available for a given video
codec.
2015-02-04 16:51:54 -08:00
jp9000 f091f062f0 obs-ffmpeg: Do not use CBR by default for FFmpeg
The FFmpeg output source will now mostly be used for file output, so
using CBR by default makes no real sense.
2015-02-04 16:51:53 -08:00
jp9000 ae862c16a6 obs-ffmpeg: If ffaac is used, change cutoff freq
If FFmpeg's experimental aac encoder is used, this changes the cutoff
frequency to better values in order to try to help make up for the
inherent lack of encoder quality a bit.  If FFmpeg is compiled to use
another encoder by default, these settings will not be applied.
2014-11-17 06:47:48 -08:00
dodgepong 17804ec12f Add latest translations from CrowdIn 2014-10-31 21:02:47 -04:00
Ben Torell 958b5c12de Latest translations from Crowdin 2014-10-11 18:47:35 -04:00
Palana 94a93abb2b (API Change) Pass data to get_properties when possible 2014-10-01 15:39:57 +02:00
BtbN 599febcb54 cmake: Replace FFMpeg modules with single module
Now using components instead of one find_package call per module
2014-09-27 09:41:13 -07:00
jp9000 c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
dodgepong a221fee3d2 Add latest translations from CrowdIn 2014-08-25 14:41:52 -07:00
BtbN 02725acdd4 Fix double invocation of install_obs_plugin in every single plugin 2014-08-19 14:24:59 +02:00
jp9000 f75a1ebf63 Plugins: Use new encoder/output size functions 2014-08-10 17:10:20 -07:00
jp9000 42a0925ce1 (API Change) media-io: Improve naming consistency
Renamed:                        To:
-----------------------------------------------------------
audio_output_blocksize          audio_output_get_block_size
audio_output_planes             audio_output_get_planes
audio_output_channels           audio_output_get_channels
audio_output_samplerate         audio_output_get_sample_rate
audio_output_getinfo            audio_output_get_info
audio_output_createline         audio_output_create_line
video_output_getinfo            video_output_get_info
video_gettime                   video_output_get_time
video_getframetime              video_output_get_frame_time
video_output_width              video_output_get_width
video_output_height             video_output_get_height
video_output_framerate          video_output_get_frame_rate
video_output_num_skipped_frames video_output_get_skipped_frames
video_output_total_frames       video_output_get_total_frames
2014-08-09 11:57:37 -07:00
jp9000 04712b5fe9 (API Change) Unsquish obs_data_* names
Changed:                 To:
-----------------------------------------------
obs_data_getjson         obs_data_get_json
obs_data_getstring       obs_data_get_string
obs_data_getint          obs_data_get_int
obs_data_getdouble       obs_data_get_double
obs_data_getbool         obs_data_get_bool
obs_data_getobj          obs_data_get_obj
obs_data_getarray        obs_data_get_array
obs_data_setstring       obs_data_set_string
obs_data_setint          obs_data_set_int
obs_data_setdouble       obs_data_set_double
obs_data_setbool         obs_data_set_bool
obs_data_setobj          obs_data_set_obj
obs_data_setarray        obs_data_set_array
obs_data_item_getstring  obs_data_item_get_string
obs_data_item_getint     obs_data_item_get_int
obs_data_item_getdouble  obs_data_item_get_double
obs_data_item_getbool    obs_data_item_get_bool
obs_data_item_getobj     obs_data_item_get_obj
obs_data_item_getarray   obs_data_item_get_array
obs_data_item_setstring  obs_data_item_set_string
obs_data_item_setint     obs_data_item_set_int
obs_data_item_setdouble  obs_data_item_set_double
obs_data_item_setbool    obs_data_item_set_bool
obs_data_item_setobj     obs_data_item_set_obj
obs_data_item_setarray   obs_data_item_set_array
2014-08-09 11:57:36 -07:00
jp9000 2d606dd8d8 (API Change) Use 'get' convention: API callbacks
Renamed:                       To:
-------------------------------------------------------
obs_source_info::defaults       obs_source_info::get_defaults
obs_source_info::properties     obs_source_info::get_properties
obs_output_info::defaults       obs_output_info::get_defaults
obs_output_info::properties     obs_output_info::get_properties
obs_output_info::total_bytes    obs_output_info::get_total_bytes
obs_output_info::dropped_frames obs_output_info::get_dropped_frames
obs_encoder_info::defaults      obs_encoder_info::get_defaults
obs_encoder_info::properties    obs_encoder_info::get_properties
obs_encoder_info::extra_data    obs_encoder_info::get_extra_data
obs_encoder_info::sei_data      obs_encoder_info::get_sei_data
obs_encoder_info::audio_info    obs_encoder_info::get_audio_info
obs_encoder_info::video_info    obs_encoder_info::get_video_fino
obs_service_info::defaults      obs_service_info::get_defaults
obs_service_info::properties    obs_service_info::get_properties
2014-08-09 11:57:30 -07:00
jp9000 c83d05117f (API Change) Unsquish libobs API callback names
Renamed:                    To:
-------------------------------------------------------
obs_source_info::getname    obs_source_info::get_name
obs_source_info::getwidth   obs_source_info::get_width
obs_source_info::getheight  obs_source_info::get_height
obs_output_info::getname    obs_output_info::get_name
obs_encoder_info::getname   obs_encoder_info::get_name
obs_service_info::getname   obs_service_info::get_name
2014-08-08 11:04:46 -07:00
jp9000 892fdea83e Remove macro to free locale
This functionality can now be handled automatically because locale can
now be freed seaparately from obs_module_unload with
obs_module_free_locale, which is called automatically when the module is
being freed.
2014-07-27 17:29:10 -07:00
jp9000 f0ac19abba Remove version parameter from obs_module_load
Replaced by obs_get_version() API
2014-07-27 17:29:10 -07:00
BtbN 38c2fc87aa Move all data into the subdir it belongs to
Completely removes the build dir in favor of cmake based build layouting
2014-07-19 01:38:41 +02:00
jp9000 94d047bb69 Log FFmpeg AAC encoder settings 2014-07-13 03:10:16 -07:00
jp9000 482791c5b6 Add locale for modules 2014-07-11 17:29:00 -07:00
BtbN 8b14aa8f4a Add missing header to CMakeLists.txt 2014-06-28 20:54:14 +02:00
jp9000 0b4a259e56 Remove 'locale' parameter from all callbacks
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function.  The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
2014-06-25 12:36:26 -07:00
jp9000 74b4743bce Remove 'locale' from properties
Having the value stored here is somewhat pointless, so this is one step
in fixing the locale handling.  Locale should be handled by the modules
themselves with their own loaded locale lookup information.
2014-06-25 12:36:26 -07:00
BtbN 817c25884d Make obs-ffmpeg aac encoder output which encoder is beeing used 2014-05-23 00:06:29 +02:00
BtbN e2c2e50f4c Fix ffmpeg/x264 find modules according to cmake find module naming conventions 2014-05-22 13:03:47 +02:00
BtbN ce542525fc Fix dependency on win32-pthreads 2014-05-08 14:43:16 +02:00
Palana b9c544969e Request global headers from ffmpeg aac encoder
FAAC and FDK AAC don't populate AVCodecContext::extradata{_size} unless
CODEC_FLAG_GLOBAL_HEADER is set
2014-05-08 14:19:10 +02:00
BtbN 075820028f Improve bundle fixup 2014-04-13 11:05:46 -07:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- Implement the RTMP output module.  This time around, we just use a
   simple FLV muxer, then just write to the stream with RTMP_Write.
   Easy and effective.

 - Fix the FLV muxer, the muxer now outputs proper FLV packets.

 - Output API:
   * When using encoders, automatically interleave encoded packets
     before sending it to the output.

   * Pair encoders and have them automatically wait for the other to
     start to ensure sync.

   * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
     because it was a bit confusing, and doing this makes a lot more
     sense for outputs that need to stop suddenly (disconnections/etc).

 - Encoder API:
   * Remove some unnecessary encoder functions from the actual API and
     make them internal.  Most of the encoder functions are handled
     automatically by outputs anyway, so there's no real need to expose
     them and end up inadvertently confusing plugin writers.

   * Have audio encoders wait for the video encoder to get a frame, then
     start at the exact data point that the first video frame starts to
     ensure the most accrate sync of video/audio possible.

   * Add a required 'frame_size' callback for audio encoders that
     returns the expected number of frames desired to encode with.  This
     way, the libobs encoder API can handle the circular buffering
     internally automatically for the encoder modules, so encoder
     writers don't have to do it themselves.

 - Fix a few bugs in the serializer interface.  It was passing the wrong
   variable for the data in a few cases.

 - If a source has video, make obs_source_update defer the actual update
   callback until the tick function is called to prevent threading
   issues.
2014-04-07 22:00:10 -07:00
Timo R 15639d928c Add compatiblity for some older ffmpeg versions 2014-04-05 16:12:32 +02:00
jp9000 bd331c8ffe Remove the weird size stuff from OBS_DECLARE_MODULE
Instead of doing this, just use macros to handle this situation.

Also, fix a minor bug in AAC encoder
2014-04-05 01:45:53 -07:00
jp9000 7bfe15e4a9 AAC: Use obs_data_set_default_int function 2014-04-05 01:17:32 -07:00
jp9000 cabe98cb4e Add FFmpeg's AAC enoder
This just adds FFmpeg's default AAC encoder as an audio encoder.  Going
to try to start getting things going with the RTMP output library next.
2014-04-05 01:13:11 -07:00