HTML Producer latency question

#1
I've been doing some testing with the HTML Producer and noticed some latency issues. I have a project that uses web sockets so I can issue commands to HTML templates.

When viewing these on my monitor using Chrome outputting via HDMI to SDI using a Blackmagic Micro Converter from issuing the command to seeing it on the monitor is taking 10ms.

If I do the same using CasparCG HTML Producer using a Blackmagic Design Decklink HD Extreme 3D+ from issuing the command to seeing it on the monitor is taking 334ms or 350ms if I use the HDMI output from the Decklink, using the screen producer is taking 225ms.

All tests have been done on the same machine using the latest build of CasparCG Server 2.2.0 Beta

The HTML Producer is on channel 2:20 then routed to channel 1:20, playing out directly on 2:20 via Decklink gives a few ms improvement so it's not the route adding the delay.

What is the expected latency one should see when using the HTML Producer?

Hardware
Xeon 1620 v3
Quadro K4200
Decklink Driver 10.9.11

Image

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <paths>
    <media-path>media/</media-path>
    <log-path>log/</log-path>
    <data-path>data/</data-path>
    <template-path>template/</template-path>
    <font-path>font/</font-path>
  </paths>
  <lock-clear-phrase>secret</lock-clear-phrase>
  <channels>
    <channel>
      <video-mode>1080i5000</video-mode>
      <channel-layout>stereo</channel-layout>
      <consumers>
        <decklink>
          <device>1</device>
          <embedded-audio>false</embedded-audio>
          <latency>low</latency>
          <keyer>external</keyer>
          <key-only>false</key-only>
          <buffer-depth>2</buffer-depth>
        </decklink>
        <screen>
          <device>2</device>
          <windowed>false</windowed>
        </screen>
      </consumers>
    </channel>
    <channel>
      <video-mode>1080i5000</video-mode>
      <channel-layout>stereo</channel-layout>
      <consumers>
      </consumers>
    </channel>
    <channel>
      <video-mode>1080i5000</video-mode>
      <channel-layout>stereo</channel-layout>
      <consumers>
        <decklink>
          <device>2</device>
          <embedded-audio>false</embedded-audio>
          <latency>low</latency>
          <keyer>external</keyer>
          <key-only>false</key-only>
          <buffer-depth>2</buffer-depth>
        </decklink>
      </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>
</configuration>
Last edited by grahamspr on 14 Mar 2018, 17:18, edited 1 time in total.

Re: HTML Producer latency question

#2
Hi
i have noticed, that the processing from caspar takes around 0.5 sec.
my machine is similar to your machine (Xeon 1585 v5,Quadro K5200,Decklink Driver 10.9.5)
no matter if you have html templates or flash templates. the latency must be created during processing inside Caspar and from the decklink driver.
no difference with old or new decklink drivers. no difference between Quadro 5200 or Quadro 4200, also no difference between the faster PC or the slower HP laptop system (Quadro M3000) with thunderbolt extension chassis for the decklink. even with a 5 year old mac with bootcamp and a thunderbolt 2 mini-decklink-adapter.
always around 0.5 seconds.

any other results around?

best
Peter

Re: HTML Producer latency question

#3
Internally there are a few points of buffering to ensure that playout is smooth even when there is unexpected system load.

From what I can see:
Each producer typically buffers 2 or 3 frames.
Route adds 1 frame of latency.
Consumers also have their own buffers. Decklink is 3/4 (this is a hardware requirement), and screen 1/2.
The OpenGL mixer will also add some more latency, I don't know how much this will be.

These numbers don't quite seem to add up to what you are measuring, but my estimates could well be off, or I could have missed some steps.