Decklink audio output returning E_FAIL
Posted: Wed Apr 10, 2019 5:09 pm
I have an application that outputs video on a Decklink card. Everything worked perfectly until I decided to add audio.
I call EnableAudioOutput like so after I have called EnableVideoOutput and that returns S_OK
Then I start playback like so and that goes fine
But in my main loop, where I successfully run ScheduleVideoFrame , if I try to run ScheduleAudioSamples that just returns E_FAIL which does not leave me with any clue about what failed. I have tried both using the same timescale for audio and video as well as using the time scale 48000 for the audio, makes no difference. I have also tried using continuous audio instead of time stamped, makes no difference.
Only thing I have not tried is prerolling, and since this is a low latency application and the manual explicitly states prerolling is optional I do not really want to completely rethink the way I do clocking in this application just to try it.
I call EnableAudioOutput like so after I have called EnableVideoOutput and that returns S_OK
- Code: Select all
result = g_deckLinkOutput->EnableAudioOutput(bmdAudioSampleRate48kHz, bmdAudioSampleType16bitInteger, 2, bmdAudioOutputStreamTimestamped);
Then I start playback like so and that goes fine
- Code: Select all
BMDTimeValue frameDuration;
BMDTimeScale frameTimescale;
displayMode->GetFrameRate(&frameDuration, &frameTimescale);
result = g_deckLinkOutput->StartScheduledPlayback(0, frameTimescale, 1.0);
But in my main loop, where I successfully run ScheduleVideoFrame , if I try to run ScheduleAudioSamples that just returns E_FAIL which does not leave me with any clue about what failed. I have tried both using the same timescale for audio and video as well as using the time scale 48000 for the audio, makes no difference. I have also tried using continuous audio instead of time stamped, makes no difference.
Only thing I have not tried is prerolling, and since this is a low latency application and the manual explicitly states prerolling is optional I do not really want to completely rethink the way I do clocking in this application just to try it.