kinu-garage / hut_10sqft

Computer setup tools for my own environment, and public discussion place holder.
2 stars 1 forks source link

GJ: Know what we need for live streaming with a camera input and slide #1021

Closed 130s closed 6 months ago

130s commented 6 months ago

With minimum budget, ideally not having to buy anything new other than the school already has, we're evaluating whether we can live streaming. We have recently bought a Canon DSR, video capture board, microphone, along with Windows laptops and other devices not mentioned here.

Understand what we need.

130s commented 6 months ago

Testing on my Ubuntu laptop. https://obsproject.com/kb/linux-installation

sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt install obs-studio

Connecting to either Youtube {HLS, RTMPS} results in:

Failed to connect to any servers, please check your internet connection and try again

130s commented 6 months ago

That disappeared after I created a live streaming on youtube with the account that I passed on OBS.

Without selecting anything, I see on youtube.com RTMPS.

130s commented 6 months ago

I haven't understood at all the bitrate consideration explained in LAS Curry's video. Bitrate consideration for Youtube (support.google.com)

130s commented 6 months ago

Youtube video in Choose live encoder settings, bitrates, and resolutions page doesn't cover the detail of bitrates while it's more about general checkpoints about streaming, which is helpful.

In the beginning I should probably just rely on the default? I chose on OBS "simple" setting as opposed to the advanced settings LAS went into.

Stream resolution detection with custom stream keys in Live Control Room

By default (recommended), YouTube will automatically detect your resolution and frame rate. If you want to manually select a resolution, create a custom key and choose “Turn on manual settings" under “Stream Resolution."

Then, after clicking the "start streaming" button on OBS, the software crashed. Upon next run a popup offered safe mode, so I took it.

Log ``` ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored. Gtk-Message: 13:24:23.806: Failed to load module "xapp-gtk3-module" Gtk-Message: 13:24:23.806: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it. [542759, Main Thread] WARNING: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187 (firefox:542759): Gtk-WARNING **: 13:24:23.860: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported. Gtk-Message: 13:24:23.860: Failed to load module "canberra-gtk-module" [542759, Main Thread] WARNING: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187 (firefox:542759): Gtk-WARNING **: 13:24:23.861: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported. Gtk-Message: 13:24:23.861: Failed to load module "canberra-gtk-module" error: YT: GetYTApi() Failed to get Auth info: Settings changed (stream 1, outputs) info: ------------------------------------------------ ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored. Gtk-Message: 13:41:35.697: Failed to load module "xapp-gtk3-module" Gtk-Message: 13:41:35.697: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it. [545165, Main Thread] WARNING: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187 (firefox:545165): Gtk-WARNING **: 13:41:35.751: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported. Gtk-Message: 13:41:35.751: Failed to load module "canberra-gtk-module" [545165, Main Thread] WARNING: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187 (firefox:545165): Gtk-WARNING **: 13:41:35.752: GTK+ module /snap/firefox/4033/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded. GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported. Gtk-Message: 13:41:35.752: Failed to load module "canberra-gtk-module" warning: Number of remaining views: 1 info: --------------------------------- info: video settings reset: base resolution: 1920x1080 output resolution: 1920x1080 downscale filter: Bicubic fps: 30/1 format: NV12 YUV mode: Rec. 709/Partial info: NV12 texture support enabled info: P010 texture support not available info: Settings changed (video) info: ------------------------------------------------ $ info: Settings changed (outputs) info: ------------------------------------------------ #0 0x7efb3d856323 #1 0x7efb3d903f1c #2 0x7efb3d903df0 #3 0x7efb3d8f870d #4 0x7efb3d90dd9a #5 0x7efb3d86d258 #6 0x7efb3bdb6d08 #7 0x7efb3bd90def #8 0x7efb3bd90ae3 #9 0x7efb3bdb27ad #10 0x7efb3d90d667 #11 0x7efb3da494cc #12 0x7efb3d90d9ee #13 0x7efb3d8c4c2c #14 0x7efb3d88ed6d #15 0x7efb3d8deb28 #16 0x7efb3b705360 #17 0x7efb3d8decb2 #18 0x7efb3d9033f1 #19 0x7efc11319ac3 [2]+ Trace/breakpoint trap (core dumped) obs $ obs& [1] 553264 $ debug: Found portal inhibitor debug: Attempted path: share/obs/obs-studio/locale/en-US.ini debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini debug: Attempted path: share/obs/obs-studio/locale.ini debug: Attempted path: /usr/share/obs/obs-studio/locale.ini debug: Attempted path: share/obs/obs-studio/themes debug: Attempted path: /usr/share/obs/obs-studio/themes debug: Attempted path: share/obs/obs-studio/themes/Yami.qss debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss warning: [Safe Mode] Unclean shutdown detected! info: [Safe Mode] User has launched in Safe Mode. info: Using EGL/X11 info: CPU Name: 12th Gen Intel(R) Core(TM) i7-1270P info: CPU Speed: 2500.000MHz info: Physical Cores: 12, Logical Cores: 16 info: Physical Memory: 31817MB Total, 6547MB Free info: Kernel Version: Linux 5.14.0-1058-oem info: Distribution: "Ubuntu" "22.04" info: Desktop Environment: Unity:Unity7:ubuntu (unity) info: Session Type: x11 info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1 info: Qt Version: 6.2.4 (runtime), 6.2.4 (compiled) info: Portable mode: false warning: Safe Mode enabled. info: OBS 30.1.2 (linux) info: --------------------------------- info: --------------------------------- info: audio settings reset: samples per sec: 48000 speakers: 2 max buffering: 960 milliseconds buffering type: dynamically increasing info: --------------------------------- info: Initializing OpenGL... info: Loading up OpenGL on adapter Intel Mesa Intel(R) Graphics (ADL GT2) info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2, shading language 4.60 info: --------------------------------- [77/1273] info: video settings reset: base resolution: 1920x1080 output resolution: 1920x1080 downscale filter: Bicubic fps: 30/1 format: NV12 YUV mode: Rec. 709/Partial info: NV12 texture support enabled info: P010 texture support not available info: Audio monitoring device: name: Default id: default info: --------------------------------- warning: No AJA devices found, skipping loading AJA UI plugin warning: Failed to initialize module 'aja-output-ui.so' warning: No AJA devices found, skipping loading AJA plugin warning: Failed to initialize module 'aja.so' warning: Failed to load 'en-US' text for module: 'decklink-captions.so' warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so' libDeckLinkAPI.so: cannot open shared object file: No such file or directory warning: A DeckLink iterator could not be created. The DeckLink drivers may not be installed warning: Failed to initialize module 'decklink.so' warning: Skipping module 'frontend-tools', not on safe list warning: Skipping module 'libcef', not on safe list warning: Skipping module 'libEGL', not on safe list warning: Skipping module 'libGLESv2', not on safe list warning: Skipping module 'libvk_swiftshader', not on safe list info: [pipewire] No captures available info: [obs-browser]: Version 2.23.4 info: [obs-browser]: CEF Version 103.0.5060.134 (runtime), 103.0.0-5060-shared-textures.2594+g17f8588+chromium-103.0.5060.134 (compiled) info: NVENC supported info: VAAPI: API version 1.14 info: FFmpeg VAAPI H264 encoding supported info: FFmpeg VAAPI AV1 encoding not supported info: FFmpeg VAAPI HEVC encoding supported warning: Skipping module 'obs-websocket', not on safe list error: os_dlopen(libvlc.so.5->libvlc.so.5): libvlc.so.5: cannot open shared object file: No such file or directory info: [vlc-video]: Couldn't find VLC installation, VLC video source disabled info: --------------------------------- info: Loaded Modules: info: vlc-video.so info: text-freetype2.so info: rtmp-services.so info: obs-x264.so info: obs-vst.so info: obs-transitions.so info: obs-qsv11.so info: obs-outputs.so info: obs-libfdk.so info: obs-filters.so info: obs-ffmpeg.so info: obs-browser.so info: linux-v4l2.so info: linux-pulseaudio.so info: linux-pipewire.so info: linux-jack.so info: linux-capture.so info: linux-alsa.so info: image-source.so info: decklink-output-ui.so info: decklink-captions.so info: --------------------------------- warning: QWidget::setTabOrder: 'first' and 'second' must be in the same window [13/1273] info: ==== Startup complete =============================================== info: All scene data cleared info: ------------------------------------------------ info: Switched to scene 'Scene' info: ------------------------------------------------ info: Loaded scenes: info: - scene 'Scene': info: ------------------------------------------------ error: YT: InitYTUserUrl() User is not signed error: YT: InitYTUserUrl() User is not signed info: ==== Shutting down ================================================== info: All scene data cleared info: ------------------------------------------------ info: Freeing OBS context data info: == Profiler Results ============================= info: run_program_init: 13179.3 ms info: ┣OBSApp::AppInit: 2.89 ms info: ┃ ┗OBSApp::InitLocale: 0.507 ms info: ┗OBSApp::OBSInit: 622.582 ms info: ┣obs_startup: 27.87 ms info: ┗OBSBasic::OBSInit: 552.791 ms info: ┣OBSBasic::InitBasicConfig: 0.112 ms info: ┣OBSBasic::ResetAudio: 0.179 ms info: ┣OBSBasic::ResetVideo: 60.291 ms info: ┃ ┗obs_init_graphics: 52.864 ms info: ┃ ┗shader compilation: 20.557 ms info: ┣OBSBasic::InitOBSCallbacks: 0.007 ms info: ┣OBSBasic::InitHotkeys: 0.036 ms info: ┣obs_load_all_modules2: 341.668 ms info: ┃ ┣obs_init_module(aja-output-ui.so): 0.063 ms info: ┃ ┣obs_init_module(aja.so): 0.059 ms info: ┃ ┣obs_init_module(decklink-captions.so): 0 ms info: ┃ ┣obs_init_module(decklink-output-ui.so): 0 ms info: ┃ ┣obs_init_module(decklink.so): 0.066 ms info: ┃ ┣obs_init_module(image-source.so): 0.009 ms info: ┃ ┣obs_init_module(linux-alsa.so): 0.008 ms info: ┃ ┣obs_init_module(linux-capture.so): 1.956 ms info: ┃ ┣obs_init_module(linux-jack.so): 0.003 ms info: ┃ ┣obs_init_module(linux-pipewire.so): 8.452 ms info: ┃ ┣obs_init_module(linux-pulseaudio.so): 0.003 ms info: ┃ ┣obs_init_module(linux-v4l2.so): 2.186 ms info: ┃ ┣obs_init_module(obs-browser.so): 0.085 ms info: ┃ ┣obs_init_module(obs-ffmpeg.so): 4.934 ms info: ┃ ┃ ┗nvenc_check: 0.561 ms info: ┃ ┣obs_init_module(obs-filters.so): 0.02 ms info: ┃ ┣obs_init_module(obs-libfdk.so): 0.002 ms info: ┃ ┣obs_init_module(obs-outputs.so): 0.006 ms info: ┃ ┣obs_init_module(obs-qsv11.so): 4.59 ms info: ┃ ┣obs_init_module(obs-transitions.so): 0.014 ms info: ┃ ┣obs_init_module(obs-vst.so): 0.006 ms info: ┃ ┣obs_init_module(obs-x264.so): 0.005 ms info: ┃ ┣obs_init_module(rtmp-services.so): 0.822 ms info: ┃ ┣obs_init_module(text-freetype2.so): 0.016 ms info: ┃ ┗obs_init_module(vlc-video.so): 0.122 ms info: ┣OBSBasic::InitService: 0.841 ms info: ┣OBSBasic::ResetOutputs: 0.185 ms info: ┣OBSBasic::CreateHotkeys: 0.033 ms info: ┣OBSBasic::InitPrimitives: 0.113 ms info: ┗OBSBasic::Load: 48.656 ms info: obs_hotkey_thread(25 ms): min=0.16 ms, median=1.11 ms, max=53.534 ms, 99th percentile=3.605 ms, 99.8028% below 25 ms info: audio_thread(Audio): min=0.007 ms, median=0.029 ms, max=1.643 ms, 99th percentile=0.118 ms info: obs_graphics_thread(33.3333 ms): min=0.048 ms, median=2.377 ms, max=13.757 ms, 99th percentile=5.276 ms, 100% below 33.333 ms info: ┣tick_sources: min=0 ms, median=0.008 ms, max=0.063 ms, 99th percentile=0.022 ms info: ┣output_frame: min=0.019 ms, median=0.063 ms, max=2.173 ms, 99th percentile=0.127 ms info: ┃ ┗gs_context(video->graphics): min=0.018 ms, median=0.062 ms, max=2.171 ms, 99th percentile=0.127 ms info: ┃ ┣render_video: min=0.013 ms, median=0.043 ms, max=0.095 ms, 99th percentile=0.088 ms info: ┃ ┃ ┗render_main_texture: min=0.012 ms, median=0.038 ms, max=0.089 ms, 99th percentile=0.076 ms info: ┃ ┗gs_flush: min=0.003 ms, median=0.011 ms, max=2.08 ms, 99th percentile=0.024 ms info: ┗render_displays: min=0.001 ms, median=2.269 ms, max=13.682 ms, 99th percentile=5.086 ms info: ================================================= info: == Profiler Time Between Calls ================== info: obs_hotkey_thread(25 ms): min=25.257 ms, median=26.291 ms, max=78.731 ms, 2.7668% within ±2% of 25 ms (0% lower, 97.2332% higher) info: obs_graphics_thread(33.3333 ms): min=31.221 ms, median=33.334 ms, max=35.416 ms, 99.4987% within ±2% of 33.333 ms (0.250627% lower, 0.250627% higher) info: ================================================= info: Number of memory leaks: 0 ```
130s commented 6 months ago

Closing OBS that started as safe mode, and re-launched it. I saw settings I made are gone so re-did them. Now I can "start streaming" w/o a crash, then I see an error on this popup that seems to prevent the streaming to start.

Failed to open NVENC codec: Generic error in an external library

Try installing the latest NVIDIA driver and closing other recording software that might be using NVENC such as NVIDIA ShadowPlay or Windows Game DVR.
130s commented 6 months ago

Solved by superuser.com#1421980 citing my answer:

Just to elaborate the answer from @user1020800,

I found "NVENC" on OBS' "Controls -> settings", then "Streaming -> Video Encoder" where the value was "Hardware (NVENC, H.264)". Changing the value to "software encoder" resolved the issue for me.

Verified on Ubuntu 22.04, OBS Studio 30.1.2

130s commented 6 months ago

Was able to connect to the live from android, which is a different device than the OBS host.

I saw the stream was delayed significantly. Computer's throughput showed 750 KB/s. On youtube.com I saw this msg. Raising "Output -> streaming -> video bitrate" from 2500 Kbps to 5500 Kbps didn't seem to help:

YouTube is not receiving enough video to maintain smooth streaming. As such, viewers will experience buffering.

130s commented 6 months ago

Live stream w/OBS requires so much so out of scope. Discussion moved to internal thread.