Loop is not playing correctly. Loop not seamless

Hi,
first thanks for your great work here. Sadly today we have a big problem. We found out that loops playing with caspar are not seamless.
The gap depends on the codec of the clip. I’ve made some test clips:
https://drive.google.com/drive/folders/1Yz0SFdtQcMjUbGEZyrjaUhT2_wCbabgU?usp=sharing

You can see the problems on SDI-Output. AVCI100 / XDCAMHD (1080i) are broadcast standards. For us these codecs are very important.

Caspar-Version: 2.3.2 4de6d18f Dev
Hardware: HP ZCentral R4, Inten Xenon W-2235@3,8GHz, 128GB RAM, DeckLink Quad2
OS: Windows Server 2019

Any ideas or fixes?

Thanks in advance

I forgot my config:

<?xml version="1.0" encoding="utf-8"?>

<configuration>
   <paths>
    <media-path>C:/Caspar/Media/</media-path>	
    <log-path>C:/Caspar/casparcg-server-v2.3.3-lts-stable/_log/</log-path>
    <data-path>C:/Caspar/casparcg-server-v2.3.3-lts-stable/_data/</data-path>
    <template-path>C:/Caspar/casparcg-server-v2.3.3-lts-stable/_templates/</template-path>
    </paths>
    
	<lock-clear-phrase>secret</lock-clear-phrase>
	
    <channel-grid>true</channel-grid>
   <channels>
    <channel>
        <video-mode>1080i5000</video-mode>
        <straight-alpha-output>false</straight-alpha-output>
	  <consumers>
             <decklink>
                <device>1</device>
                <embedded-audio>true</embedded-audio>
                <latency>normal</latency>
                <keyer>default</keyer>
                <key-only>false</key-only>
                <buffer-depth>3</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>
	<osc>
 <default-port>6250</default-port>
 <predefined-clients>
   <predefined-client>
     <address>xxx.xxx.168.1</address>
     <port>5253</port>
   </predefined-client>
 </predefined-clients>
</osc>
</configuration>

I think the problem with looping of compressed codecs (all of the above except Animation) has to to with the fact, that they need to restart the decoder pipeline and use some time for that.

Have you tried using an Animation encoded clip with an extra frame added to compensate for the “Last frame not played” issue?

Why do you want to play looped videos of AVC Intra or XDCAM-HD? Looping is usually used for backgrounds of full screen graphics or the like. So only a very small number of clips are used and they can be tested to run smoothly.

Looping problems are a known issue in version 2.3 server (possibly 2.2 as well). See https://github.com/CasparCG/server/issues/1365 for some posts about the issue.

The number of lost fields/frames varies slightly with the channel mode. A complication of interlaced channels, such as 1080i5000, is that the output frame might be from a source frame, or it may be a source field of frame n, and a source field of frame n+1. Random selection. The looping fault makes the output field pairing jump between the two modes. Julusian has done some work that corrects the field order issue, but I’m not sure when that will appear in a stable release. The looping remained an issue when I tested the interlace fix.

Thank you for your answer.
@didikunz : I think you’re right. It seams like the decoder is restarting. But this shoudn’t be. My understanding of looping a clip is to inistilize a second decoder instance to make the transition seamless. Or the decoder shoud not initilize a second time.
The big broadcasters work with AVCI100 or XDCAMHD (on 1080i). It’s an inhouse workflow to get such clips (or ProRes from the graphic department).
I’m thinking about transcoding the clips, but:

  • it takes time (no time for news and sports)
  • I don’t know which codec works best.

@andyw : you think we would have a chance with version 2.1?

I know that, I used to work for a “big” broadcaster. What I do not understand is, why it is such a big deal to transcode these clips. Do you use looped clips on a daily basis? What is your use case?

We made a new caspar client to display loops, images and clips on diffrent background devices in the studio. In some cases thesen loops are produced during the live production. Yes, transcoding would be time problem.
Which codec would you prefere for looping?

I would set up some watch-folder with FFMPEG to transcode (and add an extra frame). Dependent on the length of the clip transcoding would take a minute or two. Usually that is aceptable also for news.

I would use QuickTime with animation codec. These file are big, but run very smooth.

I have a similar studio decor installation at a regional broadcaster here in Switzerland, but still use CasparCG 2.0.7 for it. Looping is perfect with that. Is there a reason for using 2.3.x version of Caspar?

Maybe you could use an extra instance of 2.0.7 playing the loops and sending this to the main Caspar(s) via NDI to play in the background. I know: It’s an ugly hack, but sometimes special situations need special handling.

All the tests I have done with version 2.1.12_NRK have looped correctly.

I created some “odd looking” test signals to help assess looping performance. These are available from github here. The readme with the signals explains what they are. There are 1080i and 1080p signals in the main sets, with one set with PAL SD. It is simple to make new versions in different codecs via ffmpeg or another tool (I use Apple compressor as I already had a copy).

As well as just viewing the loop, I usually recorded the CasparCG output in a Blackmagic Hyperdeck, then viewed the recordings in a non-linear editor (FCP-X and DaVinci Resolove) or in DJV2 file viewer. This allowed me to see when a frame was made by field 2 of frame N and frame 1 of field N+1. The interpolation to move the spatial content to the other field position was then easy to see at the top and bottom of the bocks of bars.

1 Like

Hi, today I have no SDI-monitor. But tomorrow I will check your test signals. I will also make some tests with animation codec and version 2.07 and 2.1.12_NRK.
@andyw : Do you use Linux/Ubuntu for it?

But I hope there will be a fix for caspar. Correct looping is one of the major tasks of a video-server/ cg-server. Is this forum the correct place to ask for a fix? Or better Github?

just tested 2.1 (build 3440) that works fine with
animation
prores
XDCAM

AVCI fine but shows reverse fields
MP4 skips ends, does not loop nice

regards

shown on Decklink studio extreme SDI output

GitHub is the correct place. Please post an issue there.

I only used a Windows based CasparCG server. I wish I had access to a Linux unit for testing issues…

If your system includes audio (eg embedded or analogue from appropriate decklink) the audio clicks when the loop is not seemless.

Hi, so currently I’m testing v 2.1 (3440):
animation: perfect
prores: perfect
XDCAM: nope - not looping correctly @Theo : diffrent result with my clips?
AVCI: wrong field
MP4: horrible - skipping the last frames

1 Like

Now I’m testing v 2.0.7.e9fc25a Stable
animation: perfect
prores: perfect
XDCAM: perfect
AVCI: wrong field - :tired_face:
mp4: ok

1 Like

Hi,

as Didi wrote already above: from our experience over the years (with different Decklink cards, graphiccards, setups, casparversions) of using caspar is everything working fine loopwise as long its fullframe/no streamcodec (uncompressed, QT animation codec for alpha, Mjpeg,…). So when ressources are only used for reading and not decoding.

You mean fullframe = progressive? You are right, but today 90% of the broadcasters working with interlaced material.

Now I’m trying to work with version 2.2.2.
AVCI, XDCAMHD and ProRes are looping fine.
Everything else including huffyuv, MP4, DNXHD and MJepeg have interlacing problems. :disappointed_relieved: