Failed to connect to media-scanner. Is it running? (Ubuntu 20.04)

Hi everyone, I am new to casparcg and just arrived here.
I want to use casparcg to automate a small local TV channel and schedule the time it has to stream a video or video lists.
The videos are simple .mp4 and I am not going to use any live video capture card.

I have to use ubuntu (20.04 possibly) because we can’t use windows for security reasons.

I have successfully installed casparcg-server (2.2.0 + dfsg-2.1build2) and have been able to launch it with the default configuration.

Also I have been able to connect the casparcg-client.
The problem is that in the server terminal I get this:

Failed to connect to media-scanner. Is it running?
Reason: Connection refused

How do I get it to start working?
And where is it configured?

Here the server terminal log

root@max-HP-Laptop-15-bs0xx:/usr/share/casparcg-server# casparcg 
Type "q" to close application.
Logging [info] or higher severity to log/

[2020-06-01 23:54:10.594] [info]    ############################################################################
[2020-06-01 23:54:10.594] [info]    CasparCG Server is distributed by the Swedish Broadcasting Corporation (SVT)
[2020-06-01 23:54:10.594] [info]    under the GNU General Public License GPLv3 or higher.
[2020-06-01 23:54:10.594] [info]    Please see LICENSE.TXT for details.
[2020-06-01 23:54:10.594] [info]    http://www.casparcg.com/
[2020-06-01 23:54:10.594] [info]    ############################################################################
[2020-06-01 23:54:10.594] [info]    Starting CasparCG Video and Graphics Playout Server 2.2.0 N/A Stable
[2020-06-01 23:54:10.595] [info]    Initialized ffmpeg module.
[2020-06-01 23:54:10.595] [info]    Initialized oal module.
[2020-06-01 23:54:10.595] [info]    Initialized decklink module.
[2020-06-01 23:54:10.595] [info]    Initialized screen module.
[2020-06-01 23:54:10.595] [info]    Initialized image module.
[2020-06-01 23:54:10.595] [info]    "/usr/share/casparcg-server/casparcg.config":
[2020-06-01 23:54:10.595] [info]    -----------------------------------------
[2020-06-01 23:54:10.595] [info]    <?xml version="1.0" encoding="utf-8"?>
[2020-06-01 23:54:10.595] [info]    <configuration>
[2020-06-01 23:54:10.595] [info]       <paths>
[2020-06-01 23:54:10.595] [info]          <media-path>media/</media-path>
[2020-06-01 23:54:10.595] [info]          <log-path>log/</log-path>
[2020-06-01 23:54:10.595] [info]          <data-path>data/</data-path>
[2020-06-01 23:54:10.595] [info]          <template-path>template/</template-path>
[2020-06-01 23:54:10.595] [info]          <font-path>font/</font-path>
[2020-06-01 23:54:10.595] [info]       </paths>
[2020-06-01 23:54:10.595] [info]       <lock-clear-phrase>secret</lock-clear-phrase>
[2020-06-01 23:54:10.595] [info]       <channels>
[2020-06-01 23:54:10.595] [info]          <channel>
[2020-06-01 23:54:10.595] [info]             <video-mode>720p5000</video-mode>
[2020-06-01 23:54:10.595] [info]             <consumers>
[2020-06-01 23:54:10.595] [info]                <screen/>
[2020-06-01 23:54:10.595] [info]                <system-audio/>
[2020-06-01 23:54:10.595] [info]             </consumers>
[2020-06-01 23:54:10.595] [info]          </channel>
[2020-06-01 23:54:10.595] [info]       </channels>
[2020-06-01 23:54:10.595] [info]       <controllers>
[2020-06-01 23:54:10.595] [info]          <tcp>
[2020-06-01 23:54:10.595] [info]             <port>5250</port>
[2020-06-01 23:54:10.595] [info]             <protocol>AMCP</protocol>
[2020-06-01 23:54:10.595] [info]          </tcp>
[2020-06-01 23:54:10.595] [info]       </controllers>
[2020-06-01 23:54:10.595] [info]       <amcp>
[2020-06-01 23:54:10.595] [info]          <media-server>
[2020-06-01 23:54:10.595] [info]             <host>localhost</host>
[2020-06-01 23:54:10.595] [info]             <port>8000</port>
[2020-06-01 23:54:10.595] [info]          </media-server>
[2020-06-01 23:54:10.595] [info]       </amcp>
[2020-06-01 23:54:10.595] [info]    </configuration>
[2020-06-01 23:54:10.595] [info]    -----------------------------------------
[2020-06-01 23:54:10.703] [info]    Initializing OpenGL Device.
[2020-06-01 23:54:10.705] [info]    Initialized OpenGL 4.6 (Core Profile) Mesa 20.0.4 Intel
[2020-06-01 23:54:10.710] [info]    Initialized OpenGL Accelerated GPU Image Mixer for channel 1
[2020-06-01 23:54:10.711] [info]    video_channel[1|720p5000] Successfully Initialized.
[2020-06-01 23:54:10.711] [info]    Screen consumer [1|720p5000] Initialized.
[2020-06-01 23:54:10.760] [info]    oal[1|720p5000] Initialized.
[2020-06-01 23:54:10.761] [info]    Initialized channels.
[2020-06-01 23:54:10.761] [info]    Initialized controllers.
[2020-06-01 23:54:10.761] [info]    Initialized osc.
[2020-06-01 23:54:14.011] [info]    async_event_server[:5250] Accepted connection from 127.0.0.1 (1 connections).
[2020-06-01 23:54:14.013] [info]    Received message from 127.0.0.1: VERSION SERVER\r\n
[2020-06-01 23:54:14.014] [info]    Sent message to 127.0.0.1:201 VERSION OK\r\n2.2.0 N/A Stable\r\n
[2020-06-01 23:54:14.014] [info]    Received message from 127.0.0.1: INFO\r\n
[2020-06-01 23:54:14.014] [info]    Sent message to 127.0.0.1:200 INFO OK\r\n1 720p5000 PLAYING\r\n\r\n
[2020-06-01 23:54:14.015] [info]    Received message from 127.0.0.1: CLS\r\n
[2020-06-01 23:54:14.015] [info]    Received message from 127.0.0.1: TLS\r\n
[2020-06-01 23:54:14.015] [info]    Received message from 127.0.0.1: DATA LIST\r\n
[2020-06-01 23:54:14.016] [error]   Failed to connect to media-scanner. Is it running? 
[2020-06-01 23:54:14.016] [error]   Reason: Connection refused
[2020-06-01 23:54:14.017] [info]    Received message from 127.0.0.1: THUMBNAIL LIST\r\n
[2020-06-01 23:54:14.018] [info]    Sent message to 127.0.0.1:501 CLS FAILED\r\n
[2020-06-01 23:54:14.019] [error]   Failed to connect to media-scanner. Is it running? 
[2020-06-01 23:54:14.019] [error]   Reason: Connection refused
[2020-06-01 23:54:14.019] [info]    Sent message to 127.0.0.1:501 TLS FAILED\r\n
[2020-06-01 23:54:14.020] [info]    Sent message to 127.0.0.1:200 DATA LIST OK\r\n\r\n
[2020-06-01 23:54:14.020] [error]   Failed to connect to media-scanner. Is it running? 
[2020-06-01 23:54:14.020] [error]   Reason: Connection refused
[2020-06-01 23:54:14.020] [info]    Sent message to 127.0.0.1:501 THUMBNAIL LIST FAILED\r\n

regards
MaX
(Edited)

Did you check you firewall settings? And by the way: Would you mind to use the </> button to mark your log as code, so that we can see everything?

Hello,
(I have edited the original message)
I don’t have a firewall.
The server and the client are on the same machine (my laptop) and I have put the IP address 127.0.0.1 on the client.

Just to make sure: You started the media scanner, right? It^s a standalone program that needs to be started individually.

But… how to run the command “media-scanner” in linux? It does not appear in the PATH and analyzing the .deb package there is only the executable caspercg and the configuration file

I forgot to comment that I am using the client version
“CasparCG Client 2.0.9” although I don’t think this is the problem

I don’t know much about Linux, beside that it exist :smile: So I can not be of a big help. There must be an executable somewhere called “Scanner”. In the Windows version it is laying around in the folder were CasparCG.exe is located… (.exe is the extension used in Windows to mark executable files, I don’t know what it’s called in Linux).

The client has nothing to do with it.

ok, I found it!

I will compile it soon

will you guide me to install casparCG on my machine?
I have ubuntu 20.04
Thx in advance

I make a client program code is bellow
I have similar problem but I my case It Windows, I run Scanner.

  • when I use server 2.07 my client will refresh the media and show in my client list box
  • But when I use server 2.31 client is unable to show media file in my client list box, there is no error on server

Refress Media with server 2.31|690x275

[2021-04-17 17:01:11.985] [info]    async_event_server[:5250] Accepted connection from 127.0.0.1 (1 connections).
[2021-04-17 17:01:11.985] [info]    Received message from 127.0.0.1: VERSION\r\n
[2021-04-17 17:01:11.985] [info]    Received message from 127.0.0.1: INFO\r\n
[2021-04-17 17:01:11.985] [info]    Sent message to 127.0.0.1:201 VERSION OK\r\n2.3.1 e767c1dda Release\r\n
[2021-04-17 17:01:11.985] [info]    Sent message to 127.0.0.1:200 INFO OK\r\n1 1080i5000 PLAYING\r\n\r\n
[2021-04-17 17:01:16.064] [info]    Received message from 127.0.0.1: CLS\r\n
[2021-04-17 17:01:16.086] [info]    Sent more than 512 bytes to 127.0.0.1
[2021-04-17 17:01:24.585] [info]    Received message from 127.0.0.1: CLS\r\n
[2021-04-17 17:01:24.599] [info]    Sent more than 512 bytes to 127.0.0.1
[2021-04-17 17:01:26.809] [info]    Received message from 127.0.0.1: CLS\r\n
[2021-04-17 17:01:26.824] [info]    Sent more than 512 bytes to 127.0.0.1

client source code


Imports Svt.Caspar
Imports Svt.Network
Imports DirectShowLib

Public Class Form1
    Dim server As New CasparDevice
    Dim astondata As New CasparCGDataCollection

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles ConnectBtn.Click
        server.Connect(TextBoxipinput.Text, 5250)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        server.SendString("Play 1-1 " & TextBox2.Text)
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        server.Disconnect()
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        server.SendString("stop 1-1")
    End Sub

    Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged

    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        astondata.SetData("f0", TextBox1.Text)
        server.Channels(0).CG.Add(10, 10, "Test Template/Aston", True, astondata.ToAMCPEscapedXml)
    End Sub

    Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
        server.SendString("stop 1-10")
    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub NdiBox_TextChanged(sender As Object, e As EventArgs) Handles txtNDI.TextChanged

    End Sub



    Private Sub cmbNDI_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbNDI.SelectedIndexChanged

    End Sub

    Private Sub cmdstopndi_Click(sender As Object, e As EventArgs) Handles cmdstopndi.Click

    End Sub

    Private Sub cmdSendNDI_Click(sender As Object, e As EventArgs) Handles cmdSendNDI.Click
        On Error Resume Next
        server.SendString(txtNDI.Text & " " & cmbNDI.Text)
    End Sub

    Private Sub cmdRefreshNDISources_Click(sender As Object, e As EventArgs) Handles cmdRefreshNDISources.Click

    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub TextBoxipinput_TextChanged(sender As Object, e As EventArgs) Handles TextBoxipinput.TextChanged

    End Sub

    Private Sub ButtonLibref_Click(sender As Object, e As EventArgs) Handles ButtonLibref.Click
        server.RefreshMediafiles()
        Threading.Thread.Sleep(100)
        For i = 0 To server.Mediafiles.Count - 1
            ListBox1.Items.Add(server.Mediafiles.Item(i))
        Next
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged

    End Sub

    Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged

    End Sub

    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        server.RefreshTemplates()
        For i = 0 To server.Templates.All.Count - 1
            ComboBox1.Items.Add(server.Templates.All.Item(i))
        Next





    End Sub

    Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
        astondata.SetData("f0", TextBox1.Text)
        server.Channels(0).CG.Add(10, 10, ComboBox1.Text, True, astondata.ToAMCPEscapedXml)
    End Sub

    Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter

    End Sub
End Class

Please use the </> button to format log and code. I get tired of doing this for users all the time, before I have a chance to read the code, as it is such a mess otherwise.

For it to run on newer version of Caspar than 2.0.7 you need to start the separate Scanner.exe programm. Most people do that using a batch file.

And just a side note: On Error Resume Next is old VB6 style of programming. Use Try / Catch instead, as then you know, what actually happens in your code.