Reading or writing audio from audio device on MacOS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading or writing audio from audio device on MacOS

Michael Glenn Williams
Hi All,

Is it possible to ask ffmpeg to read or write from/to an audio device on
MacOS? For example read from the microphone or playback to headphones?

Thank you!

--
<https://meetings.hubspot.com/michael-glenn-williams> Michael Williams

CEO | CTO

Smart Blonde Experiential
8054991994
[hidden email]
totalvu.tv
13900 Marquesas Way, Marina Del Rey, CA
<http://totalvu.tv>
[image: facebook]
<https://www.facebook.com/boldstream/app/128953167177144/> [image:
twitter] <https://twitter.com/smartblondecorp> [image: linkedin]
<https://www.linkedin.com/in/michaelglennwilliams/>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Reading or writing audio from audio device on MacOS

DopeLabs


> On May 9, 2020, at 7:21 14AM, Michael Glenn Williams <[hidden email]> wrote:
>
> Hi All,
>
> Is it possible to ask ffmpeg to read or write from/to an audio device on
> MacOS? For example read from the microphone or playback to headphones?

yes, you can use avfoundation. to get a list of input devices use the following command

ffmpeg -f avfoundation -list_devices true -i ""

that will provide you with a list of video and audio input devices...

input devices are specified by the ID number separated by a colon provided in the previous command.

you specify the devices as -i "videoid:audioid"

here is an example of what mine looks like:

[AVFoundation indev @ 0x7fc3d1703980] AVFoundation video devices:
[AVFoundation indev @ 0x7fc3d1703980] [0] CamTwist
[AVFoundation indev @ 0x7fc3d1703980] [1] FaceTime HD Camera (Built-in)
[AVFoundation indev @ 0x7fc3d1703980] [2] webcamoid
[AVFoundation indev @ 0x7fc3d1703980] [3] CamTwist (2VUY)
[AVFoundation indev @ 0x7fc3d1703980] [4] EpocCam
[AVFoundation indev @ 0x7fc3d1703980] [5] Capture screen 0
[AVFoundation indev @ 0x7fc3d1703980] [6] Capture screen 1
[AVFoundation indev @ 0x7fc3d1703980] [7] Capture screen 2
[AVFoundation indev @ 0x7fc3d1703980] AVFoundation audio devices:
[AVFoundation indev @ 0x7fc3d1703980] [0] Scarlett 18i20 USB
[AVFoundation indev @ 0x7fc3d1703980] [1] Built-in Microphone
[AVFoundation indev @ 0x7fc3d1703980] [2] EpocCam Microphone
[AVFoundation indev @ 0x7fc3d1703980] [3] aux1


for example if i want to do a screen capture of screen 1 for the video and the built in mic for the audio, the command would look like this

ffmpeg -f avfoundation -i "6:1"

if i only want audio

ffmpeg -f avfoundation -i ":1"

im pretty sure that avfoundation is strictly input devices only... that being said, you could probably pipe it to ffplay if you wanted to monitor local playback, in which it would use the system configured output device.

there are other 3rd party tools you can use to route specific application audio output such as loopback or audiohijack.

cheers =]

>
> Thank you!
>
> --
> <https://meetings.hubspot.com/michael-glenn-williams> Michael Williams
>
> CEO | CTO
>
> Smart Blonde Experiential
> 8054991994
> [hidden email]
> totalvu.tv
> 13900 Marquesas Way, Marina Del Rey, CA
> <http://totalvu.tv>
> [image: facebook]
> <https://www.facebook.com/boldstream/app/128953167177144/> [image:
> twitter] <https://twitter.com/smartblondecorp> [image: linkedin]
> <https://www.linkedin.com/in/michaelglennwilliams/>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Reading or writing audio from audio device on MacOS

Michael Glenn Williams
Hey DopeLabs

Thank you for this. It makes sense for input and yes we are using loopback
and audio hijack.
So we *do* need a way to write to audio devices as well on Mac. We are
pulling the audio off of the video and want to send it into the local audio
routing system.


On Sat, May 9, 2020 at 8:31 AM DopeLabs <[hidden email]> wrote:

>
>
> > On May 9, 2020, at 7:21 14AM, Michael Glenn Williams <
> [hidden email]> wrote:
> >
> > Hi All,
> >
> > Is it possible to ask ffmpeg to read or write from/to an audio device on
> > MacOS? For example read from the microphone or playback to headphones?
>
> yes, you can use avfoundation. to get a list of input devices use the
> following command
>
> ffmpeg -f avfoundation -list_devices true -i ""
>
> that will provide you with a list of video and audio input devices...
>
> input devices are specified by the ID number separated by a colon provided
> in the previous command.
>
> you specify the devices as -i "videoid:audioid"
>
> here is an example of what mine looks like:
>
> [AVFoundation indev @ 0x7fc3d1703980] AVFoundation video devices:
> [AVFoundation indev @ 0x7fc3d1703980] [0] CamTwist
> [AVFoundation indev @ 0x7fc3d1703980] [1] FaceTime HD Camera (Built-in)
> [AVFoundation indev @ 0x7fc3d1703980] [2] webcamoid
> [AVFoundation indev @ 0x7fc3d1703980] [3] CamTwist (2VUY)
> [AVFoundation indev @ 0x7fc3d1703980] [4] EpocCam
> [AVFoundation indev @ 0x7fc3d1703980] [5] Capture screen 0
> [AVFoundation indev @ 0x7fc3d1703980] [6] Capture screen 1
> [AVFoundation indev @ 0x7fc3d1703980] [7] Capture screen 2
> [AVFoundation indev @ 0x7fc3d1703980] AVFoundation audio devices:
> [AVFoundation indev @ 0x7fc3d1703980] [0] Scarlett 18i20 USB
> [AVFoundation indev @ 0x7fc3d1703980] [1] Built-in Microphone
> [AVFoundation indev @ 0x7fc3d1703980] [2] EpocCam Microphone
> [AVFoundation indev @ 0x7fc3d1703980] [3] aux1
>
>
> for example if i want to do a screen capture of screen 1 for the video and
> the built in mic for the audio, the command would look like this
>
> ffmpeg -f avfoundation -i "6:1"
>
> if i only want audio
>
> ffmpeg -f avfoundation -i ":1"
>
> im pretty sure that avfoundation is strictly input devices only... that
> being said, you could probably pipe it to ffplay if you wanted to monitor
> local playback, in which it would use the system configured output device.
>
> there are other 3rd party tools you can use to route specific application
> audio output such as loopback or audiohijack.
>
> cheers =]
>
> >
> > Thank you!
> >
> > --
> > <https://meetings.hubspot.com/michael-glenn-williams> Michael Williams
> >
> > CEO | CTO
> >
> > Smart Blonde Experiential
> > 8054991994
> > [hidden email]
> > totalvu.tv
> > 13900 Marquesas Way, Marina Del Rey, CA
> > <http://totalvu.tv>
> > [image: facebook]
> > <https://www.facebook.com/boldstream/app/128953167177144/> [image:
> > twitter] <https://twitter.com/smartblondecorp> [image: linkedin]
> > <https://www.linkedin.com/in/michaelglennwilliams/>
> > _______________________________________________
> > ffmpeg-user mailing list
> > [hidden email]
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > [hidden email] with subject "unsubscribe".
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
<https://meetings.hubspot.com/michael-glenn-williams> Michael Williams

CEO | CTO

Smart Blonde Experiential
8054991994
[hidden email]
totalvu.tv
13900 Marquesas Way, Marina Del Rey, CA
<http://totalvu.tv>
[image: facebook]
<https://www.facebook.com/boldstream/app/128953167177144/> [image:
twitter] <https://twitter.com/smartblondecorp> [image: linkedin]
<https://www.linkedin.com/in/michaelglennwilliams/>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".