Yep, I made a ffmpeg 4.0 snap (currently classic) that supports nvenc and VA-APPI hardware accelerated decoding and encoding. I also have a prototype that is strictly confined, just waiting on some AppArmor tweaks in snapd so this can be reused.
The ffmpeg snap is 20MB so small enough to bundle in an application snap that requires ffmpeg.
Sorry for possibly bumping this but I have a question - and I think you guys are the perfect people to ask!
Right now I use Ubuntu 16.04 and I have a script I made that builds FFMpeg 3.4 with NVENC support and builds the latest OBS Studio from the GitHub repo master branch and it works great using NVENC recording in OBS Studio with my GTX 1070. I am wondering - if I use Ubuntu 18.04 with snaps, is it possible for me to just install an FFMpeg snap and an OBS Studio snap and then I can use NVENC recording in OBS Studio with my GTX 1070 - that way, with two snaps, I no longer need to build? Is this possible in Ubuntu 18.04? What about in Ubuntu 16.04 - is this possible?
If this is not currently possible, is it planned for the future?
@ipkpjersi Iāve been working on an ffmpeg 4.0.x snap which can now be confined. The plan is to bundle ffmpeg, that supports accelerated encoding, in the OBS snap.
cxf@PC:~$ snap run obs-studio
+ case "$SNAP_ARCH" in
+ ARCH=x86_64-linux-gnu
+ OBS=64bit
+ cd /snap/obs-studio/213/usr/bin/64bit
+ exec ./obs
Gtk-Message: Failed to load module "gail"
Gtk-Message: Failed to load module "atk-bridge"
Gtk-Message: Failed to load module "unity-gtk-module"
Qt: Session management error: None of the authentication protocols specified are supported
Attempted path: ../../data/obs-studio/locale/en-US.ini
Attempted path: ../../data/obs-studio/locale.ini
Attempted path: ../../data/obs-studio/themes/Dark.qss
Attempted path: ../../data/obs-studio/license/gplv2.txt
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
info: CPU Name: Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz
info: CPU Speed: 3314.120MHz
info: Physical Cores: 4, Logical Cores: 4
info: Physical Memory: 7872MB Total, 1577MB Free
info: Kernel Version: Linux 4.18.0-11-generic
info: Distribution: "Ubuntu Core" "16"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.1
info: Portable mode: false
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
info: OBS 22.0.3-modified (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
samples per sec: 44100
speakers: 2
info: ---------------------------------
info: Initializing OpenGL...
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
error: Failed to create OpenGL frame buffer config
error: Failed to create context!
error: device_create (GL) failed
error: Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated.
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
info: Freeing OBS context data
info: == Profiler Results =============================
info: run_program_init: 22791.7 ms
info: ā£OBSApp::AppInit: 13.942 ms
info: ā āOBSApp::InitLocale: 2.862 ms
info: āOBSApp::OBSInit: 2902.96 ms
info: ā£obs_startup: 21.874 ms
info: āOBSBasic::OBSInit: 33.476 ms
info: ā£OBSBasic::InitBasicConfig: 0.353 ms
info: ā£OBSBasic::ResetAudio: 0.174 ms
info: āOBSBasic::ResetVideo: 29.54 ms
info: obs_hotkey_thread(25 ms): min=0.051 ms, median=0.61 ms, max=5.958 ms, 99th percentile=2.427 ms, 100% below 25 ms
info: audio_thread(Audio): min=0.001 ms, median=0.036 ms, max=0.18 ms, 99th percentile=0.056 ms
info: =================================================
info: == Profiler Time Between Calls ==================
info: obs_hotkey_thread(25 ms): min=25.129 ms, median=25.719 ms, max=31.043 ms, 15.2778% within Ā±2% of 25 ms (0% lower, 84.7222% higher)
info: =================================================
info: Number of memory leaks: 174
System configuration
Ubuntu 18.04
RX 570 open source drivers
uname -a Linux deepcool 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
No issue with blackmagic software install
When I used obs 21 in the ubuntu repo windows capture would display colours incorrectly. But the blackmagic card would have an option in the obs sources. I forget what it was called So I decided to use obs in the snap repo and that problem was resolved only to be replaced with this one.
The snap packaging probably didnāt migrate the configuration to the new snap revision during a snap upgrade/refresh, you should be able to acquire the old configuration at ~/snap/obs-studio/old_revision
However when run try to connect add my capture device as a video capture device, the input is an all black screen, and I get this on dmesg:
audit: type=1400 audit(1555187313.230:2295): apparmor=āDENIEDā operation=āopenā profile=āsnap.obs-studio.obs-studioā name="/sys/devices/virtual/dmi/id/board_vendor" pid=16491 comm=āobsā requested_mask=ārā denied_mask=ārā fsuid=1000 ouid=0
Running the snap with --classic is a workaround, but I think it defeats part of the purpose of using snaps.
Iāve just triggered a rebuild which should land in the edge channel a little later. If you snap refresh obs-studio --edge can you give that a shake and see if itās still got a problem?
cxf@PC:~$ snap run obs-studio
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error: GLXBadContext
Request Major code 151 (GLX)
Request Minor code 6 ()
Error Serial #54
Current Serial #53
/snap/obs-studio/441/usr/sbin:/snap/obs-studio/441/usr/bin:/snap/obs-studio/441/sbin:/snap/obs-studio/441/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Qt: Session management error: None of the authentication protocols specified are supported
Attempted path: ../../data/obs-studio/locale/en-US.ini
Attempted path: ../../data/obs-studio/locale.ini
Attempted path: ../../data/obs-studio/themes/Dark.qss
info: CPU Name: Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz
info: CPU Speed: 2953.585MHz
info: Physical Cores: 4, Logical Cores: 4
info: Physical Memory: 7869MB Total, 3636MB Free
info: Kernel Version: Linux 5.0.0-13-generic
info: Distribution: "Ubuntu Core" "18"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.4
info: Portable mode: false
Attempted path: ../../data/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
info: OBS 23.1.0-161-gf21a48ff (linux)
info: ---------------------------------
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
info: ---------------------------------
info: audio settings reset:
samples per sec: 44100
speakers: 2
info: ---------------------------------
info: Initializing OpenGL...
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
error: X Error: BadMatch, Major opcode: 151, Minor opcode: 34, Serial: 34
error: Failed to create OpenGL context.
error: Failed to create context!
error: device_create (GL) failed
error: Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated.
info: Freeing OBS context data
info: == Profiler Results =============================
info: run_program_init: 1945.73 ms
info: ā£OBSApp::AppInit: 1.753 ms
info: ā āOBSApp::InitLocale: 0.822 ms
info: āOBSApp::OBSInit: 133.941 ms
info: ā£obs_startup: 1.11 ms
info: āOBSBasic::OBSInit: 15.521 ms
info: ā£OBSBasic::InitBasicConfig: 0.144 ms
info: ā£OBSBasic::ResetAudio: 0.105 ms
info: āOBSBasic::ResetVideo: 15.229 ms
info: obs_hotkey_thread(25 ms): min=0.065 ms, median=0.391 ms, max=0.74 ms, 99th percentile=0.74 ms, 100% below 25 ms
info: audio_thread(Audio): min=0.01 ms, median=0.026 ms, max=0.047 ms, 99th percentile=0.047 ms
info: =================================================
info: == Profiler Time Between Calls ==================
info: obs_hotkey_thread(25 ms): min=25.141 ms, median=25.439 ms, max=25.863 ms, 52.381% within Ā±2% of 25 ms (0% lower, 47.619% higher)
info: =================================================
info: Number of memory leaks: 244