Git Product home page Git Product logo

Comments (3)

asquared avatar asquared commented on August 22, 2024 1

You need to add an audio source to the config file. This would be something like:

# At the time being, this can't be a card you're also using for video input.
# You could work around this by commenting out line 61 of replay_ingest.cpp
# and reusing the same iadp object as argument to add_source and add_audio_source.
# You would also need to use create_decklink_input_adapter_with_audio to create the
# input adapter object.
#
# 2 = card number
# 0 = 1080i 59.94
# 0 = SDI over copper
# 2 = capture two channels of audio
iadp = Replay::create_decklink_audio_input_adapter(2, 0, 0, 2)
asrc = app.add_audio_source(:input => iadp, :chmap => { 0 => '/mnt/buffer/audio_ch1', 1 => '/mnt/buffer/audio_ch2' })

This needs to be near the top of the config, because you'll use asrc later when you configure your cameras. Each audio channel gets recorded to a separate buffer file. You don't need to record channels you're not using. Audio can take up a surprising amount of space in the current implementation, because the phase vocoder implementation precomputes the FFT of the incoming audio data for many overlapping windows. Be prepared for this, and only record the channels you need.

Audio output will go to the same device you are using for video output.

You also need to set up the mapping that determines which audio channels get played back with each camera. Define a camera like this (again, your audio configuration has to precede this in the file):

chmap = {
  0 => asrc.channel(0),
  1 => asrc.channel(1)
}
iadp = Replay::create_decklink_input_adapter(0, 0, 0, Replay::RawFrame::CbYCrY8422)
app.add_source(:input => iadp, :file => '/mnt/buffer/cam1', :name => 'CAM 1', :channel_map => chmap)

If you don't define any channel_map for a camera, you won't get any audio when playing back that camera.

You can reuse the same chmap for multiple cameras, or not - it's up to you. (and there's nothing sacred about the name chmap, you can have several and assign them to different cameras). I had something like this for hockey. Channels 0 and 1 were a generic stereo mix, channels 2 and 3 were mics near corner cameras.

chmap_main = {
  0 => asrc.channel(0),
  1 => asrc.channel(1)
}

chmap_Lcorner = {
  0 => asrc.channel(2),
  1 => asrc.channel(2),
}

chmap_Rcorner = {
  0 => asrc.channel(3),
  1 => asrc.channel(3)
}

Then by attaching the different maps to different cameras I had a sort of "audio follows video" configuration.

Sorry if that was a bit scatterbrained, but it should get you started. The audio implementation is not as well tested as the rest of the code, so YMMV (but please don't hesitate to report any issues you find).

from exacore.

kench avatar kench commented on August 22, 2024

Are you still having trouble?

from exacore.

PBXForums avatar PBXForums commented on August 22, 2024

I never did get audio working.

from exacore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.