Commit Graph

261 Commits (21684586014cb4de9848edc0a43f51c7f12f752e)

Author SHA1 Message Date
pkviet 340fb9d669 obs-ffmpeg: Enable multiple audio tracks for FFmpeg output
This allows multiple audio tracks for the FFmpeg output.

Closes obsproject/obs-studio#1351
2018-10-04 20:32:35 -07:00
Thomas Crider a64ae11bce obs-ffmpeg: Add linux VAAPI h.264 encoding support
Closes obsproject/obs-studio#1482
Closes obsproject/obs-studio#1256
2018-09-24 23:12:24 -07:00
Jim af320a0838
Merge pull request #1480 from kkartaltepe/module-descriptions
Plugins: Add descriptions to modules
2018-09-16 15:34:28 -07:00
Kurt Kartaltepe d86c8121ed Plugins: Add descriptions to modules 2018-09-11 18:28:58 -07:00
Gol-D-Ace a79aaa28ab Update translations from Crowdin 2018-08-18 04:16:35 +02:00
Ryan Foster 1f592d12aa obs-ffmpeg: Set average framerate in video stream
This commit fixes an issue where videos created with OBS will appear as
having 1000 FPS in some media players.
2018-05-27 00:45:05 -04:00
comex c54cc0bf5b obs-ffmpeg: fill in more fields on audio frames
After you call av_frame_alloc(), ffmpeg expects you to fill in certain
fields on the frame, depending on whether it's an audio or video frame.
obs-ffmpeg did this in the two places where it allocates video frames,
but not where it allocates audio frames.  On my system, using trunk
ffmpeg and the Opus codec, this causes OBS to crash while calling
avcodec_send_frame, ultimately because av_frame_copy fails due to
'dst->format < 0' (as 'format' stays at the default of -1), causing a
null pointer to be added to a buffer queue, which later gets
dereferenced.

Oddly, the fields in question can just be copied directly from
corresponding fields in the AVCodecContext, but I don't see any ffmpeg
API to automatically copy all relevant fields, and all the examples I've
seen do it by hand.  So this patch does the same.
2018-04-18 13:13:48 -07:00
Gol-D-Ace 88282c168c Update translations from Crowdin 2018-03-15 09:00:28 +01:00
Gol-D-Ace 7337b7ffb8 obs-ffmpeg: Fix locale typo 2018-03-01 22:44:43 +01:00
jp9000 aa58b9cf5f obs-ffmpeg: Use FFmpeg's "fast" AAC encoder by default
FFmpeg has recently made their "fast" AAC encoder the default, which
uses less CPU and sounds better at common bitrates.
2018-02-26 00:11:30 -08:00
jp9000 a89470d2ea obs-ffmpeg: Remove cutoff hack for AAC encoder
The cutoff hack was added many, many years ago as recommended by
Konverter.  Since then, there has been much work on the AAC encoder, so
this hack should no longer be necessary.
2018-02-25 23:50:09 -08:00
Exeldro 277b664001 obs-ffmpeg: Add speed percentage option
(Note: This commit also modifies the deps/media-playback module.)

Allows modifying the speed of local file playback.

Closes jp9000/obs-studio#1091
2018-02-15 15:18:13 -08:00
jp9000 dc0363d3e8 deps/media-playback: Use a struct for media init data
Instead of using countless parameters for the media initialization data,
use a structure.
2018-02-15 13:32:35 -08:00
pkviet 645d6ae8dd libobs/media-io: Change speaker layout to match FFmpeg aac.
(This commit also modifies the obs-ffmpeg module)

The default channel layouts from aac spec are implemented in FFmpeg
native aac encoder as follows:

    AV_CH_LAYOUT_MONO,
    AV_CH_LAYOUT_STEREO,
    AV_CH_LAYOUT_SURROUND,
    AV_CH_LAYOUT_4POINT0,
    AV_CH_LAYOUT_5POINT0_BACK,
    AV_CH_LAYOUT_5POINT1_BACK,
    AV_CH_LAYOUT_7POINT1,

The correspondence of speaker layouts to AV_CH_LAYOUT from FFmpeg is
changed to reflect the previous table.

Although FFmpeg native aac encoder can now encode all the layouts listed
in avutil channel_layout.h (on master), there might be issues with older
FFmpeg binaries.

Note that 2.1 speaker layout will be encoded as AV_CH_LAYOUT_SURROUND
(FL FR FC) because it is not listed as the default layout for three
channels.

This just means some optimizations for LFE channel will not be used by
the encoder which will treat it as an SCE (single channel element).

Closes jp9000/obs-studio#1182
2018-02-06 06:14:24 -08:00
Gol-D-Ace ae22886f67 Update translations from Crowdin 2018-01-22 04:55:52 +01:00
jp9000 6774bbdb83 obs-ffmpeg: Remove NVENC detection code for now
The reason this code is being reverted/removed is because this code is a
risk to startup stability.  This check will be added again in the
future, however this code needs to be executed from a secondary piped
process instead of directly in the process to reduce risk of
driver/hardware issues impacting program startup.  The same needs to be
accomplished for the AMF plugin as well.
2018-01-20 05:31:58 -08:00
jp9000 f5c3af1bda obs-ffmpeg: Fix signed mismatch warning 2018-01-19 16:19:10 -08:00
jp9000 655288baec obs-ffmpeg: Do not return last replay path if currently muxing 2018-01-18 08:54:43 -08:00
jp9000 8fc486339c obs-ffmpeg: Add proc to get last replay buffer
Allows getting the path of the last replay buffer saved via the
procedure handler of the FFmpeg muxer output.
2018-01-18 05:34:26 -08:00
Lucian Poston ff45b7b119 obs-ffmpeg: Call av_register_all before nvenc check
Closes jp9000/obs-studio#1157
2018-01-18 01:36:46 -08:00
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