Both Windows and Linux OBS : 'Failed to connect to server' localhost (yes, tried 'Bind to IP' options)

kvk

New Member
Windows 10
OBS 25.08
Custom RTMP = rtmp://localhost/live
Return "Failed to connect to server"
Ran through 'Bind to IP' options
Configured "rtmp://localhost:1935/live" - no change
Occurs in both Windows and Linux partitions on the same machine
Log files return same error (Windows log below):


17:00:15.254: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://localhost/live...
17:00:15.256: [rtmp stream: 'simple_stream'] Interface: Software Loopback Interface 1 (type 24, 1073 mbps)
17:00:17.260: localhost/live is offline. Try a different server (ECONNREFUSED).
17:00:17.260: [rtmp stream: 'simple_stream'] Connection to rtmp://localhost/live failed: -2


How can a 'localhost' be offline? Is this a firewall or port issue? This issue is brand new and only began in the last week or so.

COMPLETE LOG:

16:58:58.825: CoInitializeEx succeeded: 0x00000001
16:58:58.825: CPU Name: Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz
16:58:58.825: CPU Speed: 3792MHz
16:58:58.825: Physical Cores: 4, Logical Cores: 4
16:58:58.825: Physical Memory: 16319MB Total, 13832MB Free
16:58:58.825: Windows Version: 10.0 Build 18363 (release: 1909; revision: 836; 64-bit)
16:58:58.825: Running as administrator: false
16:58:58.825: Aero is Enabled (Aero is always on for windows 8 and above)
16:58:58.825: Windows 10 Gaming Features:
16:58:58.825: Game DVR: On
16:58:58.826: Sec. Software Status:
16:58:58.827: Windows Defender Antivirus: enabled (AV)
16:58:58.828: Current Date/Time: 2020-05-29, 16:58:58
16:58:58.828: Browser Hardware Acceleration: true
16:58:58.828: Portable mode: false
16:59:02.152: OBS 25.0.8 (64-bit, windows)
16:59:02.152: ---------------------------------
16:59:02.225: ---------------------------------
16:59:02.225: audio settings reset:
16:59:02.225: samples per sec: 44100
16:59:02.225: speakers: 2
16:59:02.241: ---------------------------------
16:59:02.241: Initializing D3D11...
16:59:02.241: Available Video Adapters:
16:59:02.242: Adapter 0: NVIDIA GeForce GT 430
16:59:02.242: Dedicated VRAM: 1027014656
16:59:02.242: Shared VRAM: 4261234688
16:59:02.242: PCI ID: 10de:de1
16:59:02.243: Driver Version: 23.21.13.8813
16:59:02.243: output 0: pos={0, 0}, size={1920, 1080}, attached=true, refresh=60, name=VA2431 Series
16:59:02.243: output 1: pos={1920, 0}, size={1920, 1080}, attached=true, refresh=60, name=VA2431 Series
16:59:02.244: Loading up D3D11 on adapter NVIDIA GeForce GT 430 (0)
16:59:02.270: D3D11 loaded successfully, feature level used: b000
16:59:02.270: DXGI increase maximum frame latency success
16:59:02.270: D3D11 GPU priority setup failed (not admin?)
16:59:02.671: ---------------------------------
16:59:02.671: video settings reset:
16:59:02.671: base resolution: 1920x1080
16:59:02.671: output resolution: 1280x720
16:59:02.671: downscale filter: Bicubic
16:59:02.671: fps: 30/1
16:59:02.671: format: NV12
16:59:02.671: YUV mode: 601/Partial
16:59:02.671: NV12 texture support enabled
16:59:02.672: Audio monitoring device:
16:59:02.672: name: Default
16:59:02.672: id: default
16:59:02.672: ---------------------------------
16:59:02.714: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
16:59:02.726: Failed to load 'en-US' text for module: 'decklink-ouput-ui.dll'
16:59:03.004: [AMF] Unable to load 'amfrt64.dll', error code 126.
16:59:03.006: [AMF] AMF Test failed due to one or more errors.
16:59:03.006: Failed to initialize module 'enc-amf.dll'
16:59:03.446: [obs-browser]: Version 2.8.6
16:59:03.546: LoadLibrary failed for 'nvEncodeAPI64.dll': The specified module could not be found.
16:59:03.546: (126)
16:59:03.788: Couldn't find VLC installation, VLC video source disabled
16:59:04.061: A DeckLink iterator could not be created. The DeckLink drivers may not be installed
16:59:04.062: No blackmagic support
16:59:04.150: ---------------------------------
16:59:04.150: Loaded Modules:
16:59:04.150: win-wasapi.dll
16:59:04.150: win-mf.dll
16:59:04.150: win-dshow.dll
16:59:04.150: win-decklink.dll
16:59:04.150: win-capture.dll
16:59:04.150: vlc-video.dll
16:59:04.150: text-freetype2.dll
16:59:04.150: rtmp-services.dll
16:59:04.150: obs-x264.dll
16:59:04.150: obs-vst.dll
16:59:04.150: obs-transitions.dll
16:59:04.150: obs-text.dll
16:59:04.150: obs-qsv11.dll
16:59:04.150: obs-outputs.dll
16:59:04.150: obs-filters.dll
16:59:04.150: obs-ffmpeg.dll
16:59:04.150: obs-browser.dll
16:59:04.150: image-source.dll
16:59:04.150: frontend-tools.dll
16:59:04.150: enc-amf.dll
16:59:04.150: decklink-ouput-ui.dll
16:59:04.150: coreaudio-encoder.dll
16:59:04.150: ---------------------------------
16:59:04.150: ==== Startup complete ===============================================
16:59:04.150: Service '' not found
16:59:04.158: No scene file found, creating default scene
16:59:04.158: All scene data cleared
16:59:04.158: ------------------------------------------------
16:59:04.213: WASAPI: Device 'Headphones (High Definition Audio Device)' [48000 Hz] initialized
16:59:04.440: WASAPI: Device 'Digital Audio Interface (Cam Link)' [48000 Hz] initialized
16:59:04.440: Switched to scene 'Scene'
16:59:04.440: Failed to glob scene collections
16:59:04.511: adding 69 milliseconds of audio buffering, total audio buffering is now 69 milliseconds (source: Mic/Aux)
16:59:04.511:
16:59:04.532: [rtmp-services plugin] Successfully updated file 'services.json' (version 132)
16:59:04.532: [rtmp-services plugin] Successfully updated package (version 132)
16:59:43.509: Settings changed (stream 1)
16:59:43.509: ------------------------------------------------
16:59:49.906: Device 'Digital Audio Interface (Cam Link)' invalidated. Retrying
16:59:52.624: User added source 'Video Capture Device' (dshow_input) to scene 'Scene'
16:59:52.728: Video Capture Device: DecodeDeviceId failed
16:59:52.728: Video Capture Device: Video configuration failed
16:59:52.912: ---------------------------------
16:59:52.912: [DShow Device: 'Video Capture Device'] settings updated:
16:59:52.912: video device: Cam Link
16:59:52.912: video path: \\?\usb#vid_0fd9&pid_0061&mi_00#6&1e6dd13&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
16:59:52.912: resolution: 1920x1080
16:59:52.912: flip: 0
16:59:52.912: fps: 59.94 (interval: 166834)
16:59:52.912: format: YUY2
16:59:53.125: using video device audio: no
16:59:53.125: separate audio filter
16:59:53.125: sample rate: 44100
16:59:53.125: channels: 2
16:59:53.125: audio type: Capture
16:59:53.130: WASAPI: Device 'Digital Audio Interface (Cam Link)' [48000 Hz] initialized
17:00:15.250: ---------------------------------
17:00:15.250: [x264 encoder: 'simple_h264_stream'] preset: veryfast
17:00:15.251: [x264 encoder: 'simple_h264_stream'] settings:
17:00:15.251: rate_control: CBR
17:00:15.251: bitrate: 2500
17:00:15.251: buffer size: 2500
17:00:15.251: crf: 0
17:00:15.251: fps_num: 30
17:00:15.251: fps_den: 1
17:00:15.251: width: 1280
17:00:15.251: height: 720
17:00:15.251: keyint: 250
17:00:15.251:
17:00:15.253: ---------------------------------
17:00:15.253: [FFmpeg aac encoder: 'simple_aac'] bitrate: 160, channels: 2, channel_layout: 3
17:00:15.253:
17:00:15.254: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://localhost/live...
17:00:15.256: [rtmp stream: 'simple_stream'] Interface: Software Loopback Interface 1 (type 24, 1073 mbps)
17:00:17.260: localhost/live is offline. Try a different server (ECONNREFUSED).
17:00:17.260: [rtmp stream: 'simple_stream'] Connection to rtmp://localhost/live failed: -2
17:00:17.263: ==== Streaming Stop ================================================
 

kvk

New Member
I'm testing with LiveSwitch, which is a WebRTC server network out of Canada (Frozen Mountain is the parent company). It worked fine with a localhost implementation of XSplit (I could see the local stream in browser code sitting on my website), but in the past, OBS has always run locally with no other program running (e.g. it streams quietly to itself even before I start Nginx or Red5Pro on the local machine.
 

kvk

New Member
As my experiment with a localhost stream using XSplit functioned correctly, I'm assuming the error has nothing to do with the server instance. But as the error presents on both Windows and Linux partitions, I'm assuming it might be either an OBS version bug or some firewall or port setting affecting both OS.
 

kvk

New Member
Well, possibly. But it certainly seems to be, based on the terminal output (last few lines).

C:\Users\foo\Desktop>lsconnect ffcapture --application-id="my-app-id" --shared-secret="--replaceThisWithYourOwnSharedSecret--" --channel-id="122667" --user-id="OBS" --device-id="OBSSTUDIO" --gateway-url="https://v1.liveswitch.fm:8443/sync" --input-args="-i rtmp://localhost:1935/live"
Checking for OpenH264...
OpenH264 initialized.
FFCapturer client '8f84cf66d5fc462e9144862420b5d0f0' created:
Gateway URL : https://v1.liveswitch.fm:8443/sync
Application ID : my-app-id
User ID : OBS
Device ID : OBSSTUDIO
ID : 8f84cf66d5fc462e9144862420b5d0f0
Client '8f84cf66d5fc462e9144862420b5d0f0' state is registering.
Client '8f84cf66d5fc462e9144862420b5d0f0' state is registered.
FFCapturer connection 'a85d556316044413a8c9f6cfd3bd18d0' created:
ID : a85d556316044413a8c9f6cfd3bd18d0
Connection 'a85d556316044413a8c9f6cfd3bd18d0' state is initializing.
Connection 'a85d556316044413a8c9f6cfd3bd18d0' state is connecting.
Connection 'a85d556316044413a8c9f6cfd3bd18d0' state is connected.

ffmpeg -y -i rtmp://localhost:1935/live -map 0:a:0 -f s16le -ar 48000 -ac 2 \\.\pipe\ffcapture_audio_0d307817 -map 0:v:0 -f yuv4mpegpipe -pix_fmt yuv420p \\.\pipe\ffcapture_video_85dc125c
Waiting for exit signal...
ffmpeg version git-2020-03-30-8d019db Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200328
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 42.102 / 56. 42.102
libavcodec 58. 77.101 / 58. 77.101
libavformat 58. 42.100 / 58. 42.100
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 77.101 / 7. 77.101
libswscale 5. 6.101 / 5. 6.101
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[tcp @ 000002011ab8c780] Connection to tcp://localhost:1935 failed: Error number -138 occurred
[rtmp @ 000002011ab8c280] Cannot open connection tcp://localhost:1935
rtmp://localhost:1935/live: Unknown error
 

R1CH

Forum Admin
Developer
I think you are misunderstanding what OBS and ffmpeg are for. OBS streams output to an RTMP server by connecting and sending data, ffmpeg receives input from an RTMP server by connecting to it and requesting a stream. In your case I think you're actually missing a server component - OBS and ffmpeg cannot talk to each other over directly over RTMP, there needs to be a server to manage the ingesting and output of the streams.
 

kvk

New Member
Thanks for the feedback! Let me see...

Harold is correct - when OBS is running and LSConnect - OBS do not communicate, there is no port 1935 listed on any Netstat output. (That includes explicitly defining port 1935 or leaving it out in the Custom RTMP input of OBS and/or the LSConnect command line input). LSConnect is looking to establish the RTMP connection over 1953, but doesn't do so. If, however, I open XSplit and run it on a localhost connection, Netstat does indeed show port 1935 to be open and in use, and the test server for LiveSwitch receives the stream being directed from my local machine.

Now, R1CH knows what he's talking about far more than I do, so I might be full of crap. But from my end - LSConnect is a local server instance on my home machine. It initiates a connection to the LiveSwitch WebRTC network with the initial command line call to 'lsconnect' and subsequently defines the input/output via ffmpeg.

So I'm unsure what to do with these pieces or how to begin troubleshooting/addressing them.
 
Top