Issues with NDI and HTML

I am trying to get CasparCG to output rendered HTML to a NDI or FFMPEG output. Both seem to fail stating that there is no source. While I am able to get it to render (I can hear the audio being played from it), I can’t get any output even though my config is correct. I have attached a screen shot of what its saying on the server.

I am also struggling trying to get HTML 5 videos on the page to render.

I am working on a livestream that is similar to The Weather Channel’s WeatherScan if that helps mention on what I am doing.

Any thoughts?

Hi
as usual it would be very helpfull to know which version of CasparCG you are using since there are significant differences in CEF-versions.
I would recommend to start by using 2.4.0 RC1

I tried 2.4.0 RC1 this morning and I still got the same result. The screen output was laggy and the FFMPEG was laggy (videos still not rendering in the HTML as well). If I give it a video (no HTML, just a video file), it works no problem. I wonder if I should try to render the HTML and then pass a feed off to CasparCG. What would be a good recommendation on how to do that?

Also, here is my config file and what its doing if that helps. I did have to compress the video to get it to upload so thats why it might look blurry.

<configuration>
    <paths>
        <media-path>media/</media-path>
        <log-path disable="false">log/</log-path>
        <data-path>data/</data-path>
        <template-path>template/</template-path>
    </paths>
    <lock-clear-phrase>secret</lock-clear-phrase>
    <channels>
        <channel>
            <video-mode>1080p6000</video-mode>
            <consumers>
                <screen />
                <system-audio />
            </consumers>
        </channel>
    </channels>
    <controllers>
        <tcp>
            <port>5250</port>
            <protocol>AMCP</protocol>
        </tcp>
    </controllers>
    <amcp>
        <media-server>
            <host>localhost</host>
            <port>8000</port>
        </media-server>
    </amcp>
	<html>
		<remote-debugging-port>1236</remote-debugging-port>
		<enable-gpu>true</enable-gpu>
		<angle-backend>d3d11</angle-backend>
</html>
</configuration>

What are you trying to accomplish? Maybe do a simple text diagram so we can better help you.
If I understood it correctly by your first post, you want to display a web page in a channel and output an NDI or FFMPEG stream, is that right? The logs and the config files are a bit confusing and contradict themselves.
Also, where do you want to display video? Is the video live? Does it change dynamically in the web page? Can it be played separately in another layer?

Some notes about the config and some CasparCG limitations:

  1. The logs in the first post show a <producer/> block that is unknown to me. The correct producer syntax is listed in the examples at the bottom of the default config file:

     <channel>
       <producers>
         <producer id="10">[HTML] http://localhost:9090/bundles/local-cast-hd-layout/graphics/index.html</producer>
       </producers>
     </channel>
    
  2. The logs also show almost the correct channel settings for outputting to NDI in the config file, and at the bottom they show that you are trying to play the NDI source in a channel. That would actually show it inside the server and not output to it. The correct syntax would be:

     <channel>
       <consumers>
         <ndi>
           <name>LCHD</name>
           <allow-fields>false</allow-fields>
         </ndi>
       </consumers>
     </channel>
    
  3. Sadly, the CEF (chrome) instance doesn’t have H.264/H.265/AAC codecs, only VP8/VP9/Vorbis/Opus.
    The DEMUXER_ERROR_NO_SUPPORTED_STREAMS probably shows that you’re trying to play an unsupported video.

  4. Autoplay is disbled for non muted video tags and is audio is tied to mouse events. You can avoid this by starting CasparCG.exe with this argument: --autoplay-policy=no-user-gesture-required

  5. HTML audio will always be played through the default system output and will NOT be routed to consumers (NDI, FFmpeg, Decklink, etc.)

I had many of the same comments (1, 2 & 3)

This should not be the case, CasparCG is automatically injecting that argument for you server/src/modules/html/html.cpp at 55e3a04b8bc0aac89c0fea3b10458b38210d2e86 · CasparCG/server · GitHub

This is true, but it is kind of being worked on. feat: route audio from CEF by Julusian · Pull Request #1517 · CasparCG/server · GitHub Mainly waiting for some testing before it can be merged. Or for 2.4.0 to be released so it can become the first new feature in 2.5

1 Like

I have recently tried to autoplay a YouTube embedded video and it only played after adding the argument. Are you sure that it is working? I’m not sure on which versions I tested that.

I’m aware of that and really looking forward to that feature.

You are doing an awesome work for this community by the way!

1 Like

I will try that and see if I can get it to play. As for better HTML rendering, I’m guessing there isn’t much I can do. It would be awesome if it could render it just as good as OBS’s browser. CasparCG meets all of the requirements for my project, I just need a much better HTML renderer. (maybe that could be added to the request list)?