Problem with audio and video not in sync during playback

Hi,

it on 2.3.3, I am using two screen consumers , one for key and one for fill. When playing back a video file the audio from the file get pushed to the fill HDMI channel, which is exactly what I want. But the audio is delayed for roughly 4 seconds compared to the video. Have seen issues with audio drifting in time, but none that it is out of sync from start, so I believe is something Im doing wrong, but don’t know where to start.

How are you playing the video? Are you using the casparcg client?

What codec do you have on the file in question? Have you tried different files?
Do you have a bigger system with video switchers inbetween or delayed straight out of the HDMI? Is the sound embedded on the HDMI signal or via a soundcard?

I haven’t seen this issue before so I am interested in what could have happened. Hope to see this worked out.

Yeah, CasparCG client 2.0.2 running on same machine.
I have tried a few versions of the file, first try was a higher bitrate with 48k sound. That was very choppy, both the audio and the video. Then exported in lower bitrates and lower sound resolution, then it will play. The video and audio is perfectly in sync when playing in VLC, using the same route for audio, i.e. the hdmi out. The sound is coming straight from the movie file into hdmi, so no external mixer or anything like that . HDMI goes to ATEM mini extreme with audio on for that camera. Exact same audio path as VLC uses and that does not have sync issues.
The movie is encoded with H.265 in a MOV container, 1920x1080p 25fps with 20 Mbps bitrate , audio 44.1kHz…
Just realised that I export the movie in 25 fps and the server is running 30 fps. Need to see if anything changes if I go to 25 on the server

UPDATE: tried exporting the movie in 30fps and same effect. But 4 seconds is overexagerrated, it more like 1 second

What server specs are your machine running? I have noticed the same behavior that VLC plays it flawlessly and the server stutters on the same file. I also solved it by encoding the video to a lower bitrate. Probably to do with ffmpeg being what it is and casparcg not really being a video playout server.

Best codec for video playback - General - CasparCG Community Forum (casparcgforum.org)

Looking at the link you could try quicktime h.264.
Have you tried with .mp4 instead of .mov?
Does your atem have some delay in its settings? Probably not since it dropped from 4 seconds to 1 second but worth a shot.

It’s an Hp elite desk , i believe an i5 (or i3), certainly not the most powerful machine .
I have tried encoding at 10 Mbps with same result , also tried encoding in ProRes 444 LT , with same issue . Have tried both MOV and MP4 containers. I can’t export in h.264, don’t find the option for it.
So I do not beleive it is due to machine power , I rather suspect some buffering going on somewhere . I set the < systemAudio> delay to 0 , but same effect
I double checked the atem delays and there are none , and playing from VLC with same audio route through ATEM produces no delays

So intel internal graphics I presume? Also assume you are running the server on windows?

Could you send the caspar.config file? I haven’t played around with hdmi screen that much but will see if I can replicate your setup on my system.

Oh that would be awesome. I checked the stats on the computer, i5 with internal graphics. Yes, server is running on windows

Conf file, my setup

Device 1: VGA port → I use a VGA to HDMI adapter to get the desktop output
Device 2 & 3: Internal HDMI ports

<?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>
    </paths>
    <channels>
        <channel>
            <video-mode>1080p3000</video-mode>
            <consumers>
                 <screen>
                <device>2</device>
                <key-only>false</key-only>
                <name>Fill</name>
		<interactive>false</interactive>
		<always-on-top>true</always-on-top>
                <windowed>false</windowed>
                <borderless>true</borderless>
          </screen>

          <screen>
                <device>3</device>
                <key-only>true</key-only>
                <name>Key</name>
		<interactive>false</interactive>
		<always-on-top>true</always-on-top>
                 <windowed>false</windowed>
               	<borderless>true</borderless>
          </screen>
               <!-- <system-audio /> -->
<system-audio>
                <channel-layout>stereo [mono|stereo|matrix]</channel-layout>
                <latency>0</latency>
            </system-audio>
            </consumers>
        </channel>
    </channels>
    <controllers>
        <tcp>
            <port>5250</port>
            <protocol>AMCP</protocol>
        </tcp>
    </controllers>
</configuration>

The screen consumer and system audio is usually not in sync. I would suggest looking for a Decklink card, as this works and it did not sound, that your PC is a notebook, is it?

It is not a notebook but like a nuc formfactor, no expansion slots for a decklink unfortunately

Sometimes these NUC’s have Thunderbolt…

I’ve checked that on mine , just USB

Is the delay constant in some way , per reboot or per video play? Or is it sporadic? I was experiencing longer delays when starting this thread (2-3 seconds) and then shorter delays (about 1s) when answering the first responder. The difference beeing a reboot. Can the audio be so much out of sync due the using system audio?