synching slowed down audio with slowed video

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

EliorK

  • Posts: 1
  • Joined: Mon Aug 28, 2023 6:11 pm
  • Real Name: Elior Keller

synching slowed down audio with slowed video

PostMon Aug 28, 2023 6:31 pm

Hi everyone,

I have a project where I'm using 2 declink devices(duo and quad) in order to capture media, edit, and display an edited version of the video+audio. I'm using the sdk version 12.2.

One of the edits involves taking a packet that was received from "VideoInputFrameArrived" and includes an X number of audio samples, and slowing the audio down in a way that the modified audio packet consists of (X * f) samples, f being 1/slowdown (slowdown is 0 to 1).

I'm using scheduledPlayback, and I output the audio samples with the scheduleAudioSamples function(sending X*f as the samples number).

The audio slowdown works well but where I find difficulty is in synchronizing the video frames to slowdown by the same rate so that the audio and video fit each other. I output frames in the frameCompleted callback with the function scheduleVideoFrame and when I try to modify the input parameter "displayDuration" that the function receives (multiply the default value with f) I still see that the audio is falling behind the video, like there is an additional delay between them that is increasing throughout the playback making the video advance faster than the audio even when they are both slowed down by the same rate. do note that I made sure to modify the DisplayTime input for the scheduleVideoFrame function as well.

Any suggestions about how can I make the frame appear for a longer time just like the audio?
is frame duplication the right way to go here? if so how should it be done?

thanks,
Elior

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 18 guests