.net Library - StarDust.CasparCG.net

Just fix in the new version. Sorry for this convenient. Normally you should notice some enhancement of the speed on cls and tls command.

I add async method in ICasparDevice too.

hey @rom1 :slight_smile:

is casparCGServer.GetTemplates().All behaving as expected?
while looping the result with a foreach, every item always returns the same value with .Folder or .FullName.

Thanks!!

oops! I think from 2.2 upwards, the way to list templates is now TLS

So I’ve gotten so far as to use casparCGServer.Templates.All, but the Folder is always empty, and the FullName is composed of only the first folder name on the path of the template.

So something like template/league/lowerthird has the following properties:

Folder:
FullName: LEAGUE

Thought this could help a bit.
Am I the only one having this issue, @rom1?
My guess is probably something wrong in CasparCGDatasParser.cs

EDIT:

My structure is templates-folder/lowerthirds/lt1, maybe this is the issue? Should i not be creating folders inside my templates-folder?

Hi,

Can you type manualy the commands below on the casparCG prompt and send me the result for each:

  • INFO
  • INFO PATHS
  • TLS

Thanks.

Sure thing :slight_smile:

INFO

[2020-01-14 20:53:48.390] [info]    Received message from Console: INFO\r\n
#200 INFO OK

1 1080i5000 PLAYING

2 1080i5000 PLAYING

INFO PATHS

[2020-01-14 20:54:20.742] [info]    Received message from Console: INFO PATHS\r\n
#201 INFO PATHS OK

<?xml version="1.0" encoding="utf-8"?>
<paths>
   <media-path>media/</media-path>
   <log-path>log/</log-path>
   <data-path>data/</data-path>
   <template-path>C:\Users\joelc\Documents\CasparCG Server\template/</template-path>
   <initial-path>C:\Users\joelc\Documents\CasparCG Server/</initial-path>
</paths>

TLS

[2020-01-14 20:55:10.736] [info]    Received message from Console: TLS\r\n
#200 TLS OK

CAMPANHA/FOTOS

CAMPANHA/ORACULO

HINARIO/HINO

ORACULOS/CANAL/ORACULO

ORACULOS/CANAL/ORACULO_VELHO

Sorry it’s not INFO that I need but the “VERSION” command. Can you send me the result ?

Here you go:

VERSION

[2020-01-14 21:01:27.902] [info]    Received message from Console: VERSION\r\n
#201 VERSION OK

2.3.0 7829b13b Dev

Thanks Joel,

In some case capsar cg return the path with / instead of . Not very sure that I have understood why.
I fix this issue on the Parser.
The new nuget package is online.

Thanks, but there’s still something wrong:

For this code:

Console.WriteLine($"Name: {template.Name} | FullName: {template.FullName} | Folder: {template.Folder}");

Output is as follows:

Name: ORACULOS | FullName: ORACULOS | Folder: 
Name: ORACULOS | FullName: ORACULOS | Folder: 
Name: ORACULOS | FullName: ORACULOS | Folder:

EDIT
PS: Holy crap, populating the UI with info from the casparcg server is blazing fast now.

Application is now freezing on every command.
Adding a template will freeze UI, playing a video will freeze UI.

I’ve downgraded back to v2019.9.27.1, and application is working again.

While on v2019.9.27.1 it will loadbg, and then issue the play command, with newer versions it will only issue loadbg and then hangs the UI.

Sorry for hammering with so many questions, thanks for the effort you put into this lib!

Trying to debug things got me this far.
I’m a newbie, but maybe there’s a thread waiting for the SendCommandAndGetStatus method?

Complete pastebin of threads: https://rentry.co/s9dkh
Relevant part:


mscorlib.dll!System.Threading.Tasks.Task.InternalWait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken)|

mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task)|

StarDust.CasparCg.net.AmcpProtocol.dll!StarDust.CasparCG.net.AmcpProtocol.AmcpTCPParser.SendCommandAndGetStatus(string command)|

StarDust.CasparCg.net.AmcpProtocol.dll!StarDust.CasparCG.net.AmcpProtocol.AmcpTCPParser.SendCommand(string command)|

StarDust.CasparCg.net.Device.dll!StarDust.CasparCG.net.Device.ChannelManager.LoadBG(StarDust.CasparCG.net.Models.Media.CasparPlayingInfoItem item, bool auto)|

IASDCG.exe!IasdCG.MainWindow.Play(string clip, bool loop, bool fade)

Thank you for your feedback. Normally fix on the new version.

Thanks. There’s a missing Crosscutting dependency that isn’t available on nuget.

Built Crosscutting from source and used in project, but main thread is still hanging.

Threads: https://rentry.co/gn4gh

You’re right I missed the crosscuting dependency.
For your error, I think you have a problem with the threading management in your client or your exception management.
I’m looking in my code to understood why your error raised. Maybe a timeout exception is raised when the code send the GetInfo command.

Do you have a repository of your code that can help me to diagnose what happen ?

Rom1

Just created a project from scratch using the info on the github page, and the UI hangs on start, as in my app.

This is the complete code for it: https://pastebin.com/R5d6Qak5

Thanks I found the origin of the problem. I upload a new version.

Thanks @rom1!
Back to a working state, and now faster than ever!

Only issue I have found now is template names with spaces in path.
If the template is “ORACULOS/SEXTA NOITE/ORACULO” in casparcg’s console “TLS” command, the output in the lib for “FullName” is “ORACULOS/SEXTA/ORACULO”.

But replacing the " " in the path with a “_” makes it work ok.

Thanks so much for your efforts!

Thanks for this feedback this issue appear in 2.3 because TLS INFO doesn’t return filename between quote.
I fix the issue in an alpha version.

You can install the new alpha version. You can install by check the pre-release checkbox in nuget package manager.