Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements
@ 2022-01-19 14:17 Romain Beauxis
  2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 14:17 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

This is a follow-up from a previous series of patches that fix, enhance and
cleanup support for audio and video input on macos in libavdevice. Due to
some important recent refactoring and addition, version is reset.

Patches:
  libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  libavdevice/avfoundation.m: Replace mutex-based concurrency handling in
avfoundation.m by a thread-safe fifo queue with maximum length
  libavdevice/avfoundation.m: Allow to select devices by unique ID
  Use appropriate method for device discovery.
  Add AudioToolbox audio input device.

 configure                            |   5 ++
 doc/indevs.texi                      |  50 +++++++++++++++-
 libavdevice/Makefile                 |   1 +
 libavdevice/alldevices.c             |   1 +
 libavdevice/audiotoolbox_dec.m (new) | 466
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libavdevice/avfoundation.m           | 548
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------
 6 files changed, 781 insertions(+), 290 deletions(-)
 create mode 100644 libavdevice/audiotoolbox_dec.m
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 14:17 [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements Romain Beauxis
@ 2022-01-19 14:23 ` Romain Beauxis
  2022-01-19 14:27   ` Marvin Scholz
                     ` (2 more replies)
  2022-01-19 14:35 ` [FFmpeg-devel] [PATCH 2/5] libavdevice/avfoundation.m: Replace mutex-based concurrency by a thread-safe fifo queue with maximum length Romain Beauxis
                   ` (3 subsequent siblings)
  4 siblings, 3 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 14:23 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Thilo Borgmann, epirat07

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

This patch switches the logic around audio settings to let the caller drive the format.

After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).

Using setAudioSettings allow the OS to drive audio conversion internally and pick whatever appropriate settings for the audio device. This has been working very well and is also the way AVFoundation audio input is setup in videolan.


[-- Attachment #2: 0001-libavdevice-avfoundation.m-use-setAudioSettings-extend.eml --]
[-- Type: message/rfc822, Size: 14195 bytes --]

Date: =20Mon,=2029=20Nov=202021=2008:46:05=20-0600=0ASubject:=20[PATCH]=20=



[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
@ 2022-01-19 14:27   ` Marvin Scholz
  2022-01-19 14:28   ` Andreas Rheinhardt
  2022-01-19 14:31   ` Gyan Doshi
  2 siblings, 0 replies; 22+ messages in thread
From: Marvin Scholz @ 2022-01-19 14:27 UTC (permalink / raw)
  To: Romain Beauxis; +Cc: Thilo Borgmann, FFmpeg development discussions and patches

On 19 Jan 2022, at 15:23, Romain Beauxis wrote:

> This patch switches the logic around audio settings to let the caller 
> drive the format.

Hi,
just a quick technical feedback, with the patch sent as attachment it 
now finally applies
fine for me, thanks!

>
> After experimenting with the AudioConverter, we realized that, even 
> when adhering to a strict implementation of the documented API, we 
> were still getting errors during conversions. The input device would 
> randomly change from e.g. s32le to s24le between restarts and error 
> out on conversion (using a freshly initialized converter).
>
> Using setAudioSettings allow the OS to drive audio conversion 
> internally and pick whatever appropriate settings for the audio 
> device. This has been working very well and is also the way 
> AVFoundation audio input is setup in videolan.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
  2022-01-19 14:27   ` Marvin Scholz
@ 2022-01-19 14:28   ` Andreas Rheinhardt
  2022-01-19 16:48     ` Thilo Borgmann
  2022-01-19 14:31   ` Gyan Doshi
  2 siblings, 1 reply; 22+ messages in thread
From: Andreas Rheinhardt @ 2022-01-19 14:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Thilo Borgmann, epirat07

Romain Beauxis:
> This patch switches the logic around audio settings to let the caller drive the 
> format.
> 
> After experimenting with the AudioConverter, we realized that, even when 
> adhering to a strict implementation of the documented API, we were still getting 
> errors during conversions. The input device would randomly change from e.g. 
> s32le to s24le between restarts and error out on conversion (using a freshly 
> initialized converter).
> 
> Using setAudioSettings allow the OS to drive audio conversion internally and 
> pick whatever appropriate settings for the audio device. This has been working 
> very well and is also the way AVFoundation audio input is setup in videolan.
> 

Your mail is broken: we don't want patches as eml; instead you should
attach what git format-patch produces. Or you can use git send-email
directly.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
  2022-01-19 14:27   ` Marvin Scholz
  2022-01-19 14:28   ` Andreas Rheinhardt
@ 2022-01-19 14:31   ` Gyan Doshi
  2022-01-19 15:14     ` Romain Beauxis
  2 siblings, 1 reply; 22+ messages in thread
From: Gyan Doshi @ 2022-01-19 14:31 UTC (permalink / raw)
  To: ffmpeg-devel



On 2022-01-19 07:53 pm, Romain Beauxis wrote:
> This patch switches the logic around audio settings to let the caller drive the format.
>
> After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).
  At present, the code uses the first frame to set attributes. If you 
wait for a few frames and then probe, the attributes are stable.

Regards,
Gyan
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [FFmpeg-devel] [PATCH 2/5] libavdevice/avfoundation.m: Replace mutex-based concurrency by a thread-safe fifo queue with maximum length
  2022-01-19 14:17 [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements Romain Beauxis
  2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
@ 2022-01-19 14:35 ` Romain Beauxis
  2022-01-19 14:38 ` [FFmpeg-devel] [PATCH 3/5] libavdevice/avfoundation.m: Allow to select devices by unique ID Romain Beauxis
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 14:35 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Thilo Borgmann, Marvin Scholz

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

The existing implementation of avdevice input has issues in its concurrent model as it only allows for one shared frame between writing and reading threads. This means that, if reading thread gets late, frames get dropped, resulting in corrupted input.

This patch changes the concurrency logic to use a single shared queue for both video and audio frames. Previous version of the patch used separate queues for audio and video but this could cause synchronization issues.

In order to avoid dropping initial audio frames, the video configuration logic is also changed to assume height/width as configured when opening the input device so as to not depend on the first video frame for it.


[-- Attachment #2: 0001-libavdevice-avfoundation.m-Replace-mutex-based-concurr.eml --]
[-- Type: message/rfc822, Size: 16846 bytes --]

Date: =20Sun,=2012=20Dec=202021=2017:29:27=20-0600=0ASubject:=20[PATCH]=20=



[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [FFmpeg-devel] [PATCH 3/5] libavdevice/avfoundation.m: Allow to select devices by unique ID
  2022-01-19 14:17 [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements Romain Beauxis
  2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
  2022-01-19 14:35 ` [FFmpeg-devel] [PATCH 2/5] libavdevice/avfoundation.m: Replace mutex-based concurrency by a thread-safe fifo queue with maximum length Romain Beauxis
@ 2022-01-19 14:38 ` Romain Beauxis
  2022-01-19 14:39 ` [FFmpeg-devel] [PATCH 4/5] Use appropriate method for device discovery Romain Beauxis
  2022-01-19 14:42 ` [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device Romain Beauxis
  4 siblings, 0 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 14:38 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Thilo Borgmann, Marvin Scholz

[-- Attachment #1: Type: text/plain, Size: 235 bytes --]

This patch changes the logic around device selection to allow to use a static, machine-readable unique ID when selecting devices. Device names depends on locale settings and device index can change when plugging/unplugging devices.


[-- Attachment #2: 0001-libavdevice-avfoundation.m-Allow-to-select-devices-by-.eml --]
[-- Type: message/rfc822, Size: 8933 bytes --]

Date: =20Mon,=2013=20Dec=202021=2009:14:50=20-0600=0ASubject:=20[PATCH]=20=



[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [FFmpeg-devel] [PATCH 4/5] Use appropriate method for device discovery.
  2022-01-19 14:17 [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements Romain Beauxis
                   ` (2 preceding siblings ...)
  2022-01-19 14:38 ` [FFmpeg-devel] [PATCH 3/5] libavdevice/avfoundation.m: Allow to select devices by unique ID Romain Beauxis
@ 2022-01-19 14:39 ` Romain Beauxis
  2022-01-19 14:42 ` [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device Romain Beauxis
  4 siblings, 0 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 14:39 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Thilo Borgmann, Marvin Scholz

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

This adds support for the non-deprecated methods for selecting devices, when available.


[-- Attachment #2: 0001-Use-appropriate-method-for-device-discovery.eml --]
[-- Type: message/rfc822, Size: 6573 bytes --]

To: =20ffmpeg-devel@ffmpeg.org=0A=0ASigned-off-by:=20Romain=20Beauxis=20=
Date: =20Fri,=2014=20Jan=202022=2010:06:08=20-0600=0ASubject:=20[PATCH]=20=



[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-19 14:17 [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements Romain Beauxis
                   ` (3 preceding siblings ...)
  2022-01-19 14:39 ` [FFmpeg-devel] [PATCH 4/5] Use appropriate method for device discovery Romain Beauxis
@ 2022-01-19 14:42 ` Romain Beauxis
  2022-01-19 16:59   ` Marvin Scholz
  4 siblings, 1 reply; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 14:42 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Thilo Borgmann, Marvin Scholz

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

This patch adds support for a new, audio-specific input device using the documented and battle-tested AUHAL input. This provides a pendant to the AudioToolbox audio-only output.

A couple of advantages for this:
* It avoids a lot of the complexity of supporting audio and video in a single input
* The AUHAL API seems tested, documented and robust
* This implementation hopefully gives good control over audio latency and also minimizes data copy


[-- Attachment #2: 0001-Add-AudioToolbox-audio-input-device.eml --]
[-- Type: message/rfc822, Size: 23711 bytes --]

Date: =20Tue,=2018=20Jan=202022=2016:29:59=20-0600=0ASubject:=20[PATCH]=20=



[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 14:31   ` Gyan Doshi
@ 2022-01-19 15:14     ` Romain Beauxis
  2022-01-19 15:19       ` Gyan Doshi
  0 siblings, 1 reply; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 15:14 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Le mer. 19 janv. 2022 à 08:31, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
> On 2022-01-19 07:53 pm, Romain Beauxis wrote:
> > This patch switches the logic around audio settings to let the caller drive the format.
> >
> > After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).
>   At present, the code uses the first frame to set attributes. If you
> wait for a few frames and then probe, the attributes are stable.

How is that supposed to work to get a full A/V stream? Discarding
initial audio frames results in data loss in audio-only input and
corrupted initial audio in A/V inputs.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 15:14     ` Romain Beauxis
@ 2022-01-19 15:19       ` Gyan Doshi
  2022-01-19 15:21         ` Romain Beauxis
  0 siblings, 1 reply; 22+ messages in thread
From: Gyan Doshi @ 2022-01-19 15:19 UTC (permalink / raw)
  To: ffmpeg-devel



On 2022-01-19 08:44 pm, Romain Beauxis wrote:
> Le mer. 19 janv. 2022 à 08:31, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
>> On 2022-01-19 07:53 pm, Romain Beauxis wrote:
>>> This patch switches the logic around audio settings to let the caller drive the format.
>>>
>>> After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).
>>    At present, the code uses the first frame to set attributes. If you
>> wait for a few frames and then probe, the attributes are stable.
> How is that supposed to work to get a full A/V stream? Discarding
> initial audio frames results in data loss in audio-only input and
> corrupted initial audio in A/V inputs.

We're talking about around 5-6 packets, so ~100 ms. The streaming 
scenarios I worked on weren't sensitive to that amount of initial loss. 
YMMV.

Regards
Gyan
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 15:19       ` Gyan Doshi
@ 2022-01-19 15:21         ` Romain Beauxis
  2022-01-19 15:45           ` Gyan Doshi
  0 siblings, 1 reply; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 15:21 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Le mer. 19 janv. 2022 à 09:19, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
> On 2022-01-19 08:44 pm, Romain Beauxis wrote:
> > Le mer. 19 janv. 2022 à 08:31, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
> >> On 2022-01-19 07:53 pm, Romain Beauxis wrote:
> >>> This patch switches the logic around audio settings to let the caller drive the format.
> >>>
> >>> After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).
> >>    At present, the code uses the first frame to set attributes. If you
> >> wait for a few frames and then probe, the attributes are stable.
> > How is that supposed to work to get a full A/V stream? Discarding
> > initial audio frames results in data loss in audio-only input and
> > corrupted initial audio in A/V inputs.
>
> We're talking about around 5-6 packets, so ~100 ms. The streaming
> scenarios I worked on weren't sensitive to that amount of initial loss.
> YMMV.

I see thanks. And what advantages does this method provide aside from
supporting 24 bit sample formats which are currently excluded from
these changes?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 15:21         ` Romain Beauxis
@ 2022-01-19 15:45           ` Gyan Doshi
  2022-01-19 15:52             ` Romain Beauxis
  0 siblings, 1 reply; 22+ messages in thread
From: Gyan Doshi @ 2022-01-19 15:45 UTC (permalink / raw)
  To: ffmpeg-devel



On 2022-01-19 08:51 pm, Romain Beauxis wrote:
> Le mer. 19 janv. 2022 à 09:19, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
>> On 2022-01-19 08:44 pm, Romain Beauxis wrote:
>>> Le mer. 19 janv. 2022 à 08:31, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
>>>> On 2022-01-19 07:53 pm, Romain Beauxis wrote:
>>>>> This patch switches the logic around audio settings to let the caller drive the format.
>>>>>
>>>>> After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).
>>>>     At present, the code uses the first frame to set attributes. If you
>>>> wait for a few frames and then probe, the attributes are stable.
>>> How is that supposed to work to get a full A/V stream? Discarding
>>> initial audio frames results in data loss in audio-only input and
>>> corrupted initial audio in A/V inputs.
>> We're talking about around 5-6 packets, so ~100 ms. The streaming
>> scenarios I worked on weren't sensitive to that amount of initial loss.
>> YMMV.
> I see thanks. And what advantages does this method provide aside from
> supporting 24 bit sample formats which are currently excluded from
> these changes?

I was remarking on a way to avoid format changes post-initialization.
Not a comment on your patches.

Gyan
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 15:45           ` Gyan Doshi
@ 2022-01-19 15:52             ` Romain Beauxis
  0 siblings, 0 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-19 15:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Le mer. 19 janv. 2022 à 09:45, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
> On 2022-01-19 08:51 pm, Romain Beauxis wrote:
> > Le mer. 19 janv. 2022 à 09:19, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
> >> On 2022-01-19 08:44 pm, Romain Beauxis wrote:
> >>> Le mer. 19 janv. 2022 à 08:31, Gyan Doshi <ffmpeg@gyani.pro> a écrit :
> >>>> On 2022-01-19 07:53 pm, Romain Beauxis wrote:
> >>>>> This patch switches the logic around audio settings to let the caller drive the format.
> >>>>>
> >>>>> After experimenting with the AudioConverter, we realized that, even when adhering to a strict implementation of the documented API, we were still getting errors during conversions. The input device would randomly change from e.g. s32le to s24le between restarts and error out on conversion (using a freshly initialized converter).
> >>>>     At present, the code uses the first frame to set attributes. If you
> >>>> wait for a few frames and then probe, the attributes are stable.
> >>> How is that supposed to work to get a full A/V stream? Discarding
> >>> initial audio frames results in data loss in audio-only input and
> >>> corrupted initial audio in A/V inputs.
> >> We're talking about around 5-6 packets, so ~100 ms. The streaming
> >> scenarios I worked on weren't sensitive to that amount of initial loss.
> >> YMMV.
> > I see thanks. And what advantages does this method provide aside from
> > supporting 24 bit sample formats which are currently excluded from
> > these changes?
>
> I was remarking on a way to avoid format changes post-initialization.
> Not a comment on your patches.

For sure, and I appreciate the feedback.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats
  2022-01-19 14:28   ` Andreas Rheinhardt
@ 2022-01-19 16:48     ` Thilo Borgmann
  0 siblings, 0 replies; 22+ messages in thread
From: Thilo Borgmann @ 2022-01-19 16:48 UTC (permalink / raw)
  To: ffmpeg-devel

Am 19.01.22 um 15:28 schrieb Andreas Rheinhardt:
> Romain Beauxis:
>> This patch switches the logic around audio settings to let the caller drive the
>> format.
>>
>> After experimenting with the AudioConverter, we realized that, even when
>> adhering to a strict implementation of the documented API, we were still getting
>> errors during conversions. The input device would randomly change from e.g.
>> s32le to s24le between restarts and error out on conversion (using a freshly
>> initialized converter).
>>
>> Using setAudioSettings allow the OS to drive audio conversion internally and
>> pick whatever appropriate settings for the audio device. This has been working
>> very well and is also the way AVFoundation audio input is setup in videolan.
>>
> 
> Your mail is broken: we don't want patches as eml; instead you should
> attach what git format-patch produces. Or you can use git send-email
> directly.

+1, please.

-Thilo

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-19 14:42 ` [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device Romain Beauxis
@ 2022-01-19 16:59   ` Marvin Scholz
  2022-01-24 15:42     ` Romain Beauxis
  2022-01-29 20:35     ` Romain Beauxis
  0 siblings, 2 replies; 22+ messages in thread
From: Marvin Scholz @ 2022-01-19 16:59 UTC (permalink / raw)
  To: Romain Beauxis; +Cc: Thilo Borgmann, FFmpeg development discussions and patches



On 19 Jan 2022, at 15:42, Romain Beauxis wrote:

Hi, thanks for the patch. I've not done a full code review yet, just a 
few
initial remarks below:

> This patch adds support for a new, audio-specific input device using 
> the documented and battle-tested AUHAL input. This provides a pendant 
> to the AudioToolbox audio-only output.
>
> A couple of advantages for this:
> * It avoids a lot of the complexity of supporting audio and video in a 
> single input
> * The AUHAL API seems tested, documented and robust
> * This implementation hopefully gives good control over audio latency 
> and also minimizes data copy
> From: Romain Beauxis <toots@rastageeks.org>
> To: ffmpeg-devel@ffmpeg.org
> Subject: [PATCH] Add AudioToolbox audio input device.
> Date: 18. January 2022 at 23:29
> Signed-off-by: Romain Beauxis <toots@rastageeks.org>
> ---
>  configure                      |   5 +
>  doc/indevs.texi                |  44 ++++
>  libavdevice/Makefile           |   1 +
>  libavdevice/alldevices.c       |   1 +
>  libavdevice/audiotoolbox_dec.m | 466 
> +++++++++++++++++++++++++++++++++
>  5 files changed, 517 insertions(+)
>  create mode 100644 libavdevice/audiotoolbox_dec.m
>
> diff --git a/configure b/configure
> index 1413122d87..80e39aae44 100755
> --- a/configure
> +++ b/configure
> @@ -204,6 +204,7 @@ External library support:
>    --disable-avfoundation   disable Apple AVFoundation framework 
> [autodetect]
>    --enable-avisynth        enable reading of AviSynth script files 
> [no]
>    --disable-bzlib          disable bzlib [autodetect]
> +  --disable-coremedia      disable Apple CoreMedia framework 
> [autodetect]
>    --disable-coreimage      disable Apple CoreImage framework 
> [autodetect]
>    --enable-chromaprint     enable audio fingerprinting with 
> chromaprint [no]
>    --enable-frei0r          enable frei0r video filtering [no]
> @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
>      appkit
>      avfoundation
>      bzlib
> +    coremedia
>      coreimage
>      iconv
>      libxcb
> @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
>  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
>  avfoundation_indev_suggest="coregraphics applicationservices"
>  avfoundation_indev_extralibs="-framework Foundation"
> +audiotoolbox_indev_deps="coremedia audiotoolbox"
> +audiotoolbox_indev_extralibs="-framework CoreMedia -framework 
> AudioToolbox"
>  audiotoolbox_outdev_deps="audiotoolbox pthreads"
>  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework 
> CoreAudio"
>  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h 
> dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
> @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h 
> camera/NdkCameraManager.h" ACameraManag
>  enabled appkit       && check_apple_framework AppKit
>  enabled audiotoolbox && check_apple_framework AudioToolbox
>  enabled avfoundation && check_apple_framework AVFoundation
> +enabled coremedia    && check_apple_framework CoreMedia
>  enabled coreimage    && check_apple_framework CoreImage
>  enabled metal        && check_apple_framework Metal
>  enabled videotoolbox && check_apple_framework VideoToolbox
> diff --git a/doc/indevs.texi b/doc/indevs.texi
> index 858c0fa4e4..30a91d304f 100644
> --- a/doc/indevs.texi
> +++ b/doc/indevs.texi
> @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer. 
> Default is 5.
>
>  @end table
>
> +@section AudioToolbox
> +
> +AudioToolbox input device.
> +
> +Allows native input from CoreAudio devices on OSX.
Nit: Nowadays it's macOS instead of OSX

> +
> +All available devices can be enumerated by using 
> @option{-list_devices true}, listing
> +all device names, and corresponding unique ID.

Instead of adding another device that uses a custom list-devices option, 
could you
instead implement the .get_device_list callback? (See alsa or pulse 
modules for an
example) Then listing would work properly with the `ffmpeg -sources` 
command and
devices could be iterated over using the avdevice APIs as well.

(Ideally we would have that for AVFoundation too but its really hard now 
to do that
in a backwards compatible manner)

> +
> +@subsection Options
> +
> +AudioToolbox supports the following options:
> +
> +@table @option
> +
> +@item channels
> +Set the number of channels. Default is device's default.
> +
> +@item frames_queue_length
> +Maximum of buffers in the input queue
> +
> +@item buffer_frame_size
> +Buffer frame size, gouverning internal latency
> +
> +@item big_endian
> +Return big endian samples
> +
> +@item sample_format
> +Sample format
> +
> +@end table
> +
> +@subsection Examples
> +
> +@itemize
> +
> +@item
> +Print the list of supported devices
> +@example
> +$ ffmpeg -f audiotoolbox -list_devices true -i ""
> +@end example
> +
> +@end itemize
> +
>  @section avfoundation
[…]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-19 16:59   ` Marvin Scholz
@ 2022-01-24 15:42     ` Romain Beauxis
  2022-01-24 16:19       ` Marvin Scholz
  2022-01-29 20:35     ` Romain Beauxis
  1 sibling, 1 reply; 22+ messages in thread
From: Romain Beauxis @ 2022-01-24 15:42 UTC (permalink / raw)
  To: Marvin Scholz; +Cc: Thilo Borgmann, FFmpeg development discussions and patches

Hi Marvin,

Le mer. 19 janv. 2022 à 10:59, Marvin Scholz <epirat07@gmail.com> a écrit :
> On 19 Jan 2022, at 15:42, Romain Beauxis wrote:
>
> Hi, thanks for the patch. I've not done a full code review yet, just a
> few
> initial remarks below:
>
> > This patch adds support for a new, audio-specific input device using
> > the documented and battle-tested AUHAL input. This provides a pendant
> > to the AudioToolbox audio-only output.
> >
> > A couple of advantages for this:
> > * It avoids a lot of the complexity of supporting audio and video in a
> > single input
> > * The AUHAL API seems tested, documented and robust
> > * This implementation hopefully gives good control over audio latency
> > and also minimizes data copy

Thanks!

Do you need more time for this review? We discovered another issue
with the dynamic array of video devices and I'd like to send a revised
series soon. Also, I think I'll reorder the patches so that the most
trivial one (unique device name, probing API call updates) can be
applied right away.

Let me know!
Romain

> > From: Romain Beauxis <toots@rastageeks.org>
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: [PATCH] Add AudioToolbox audio input device.
> > Date: 18. January 2022 at 23:29
> > Signed-off-by: Romain Beauxis <toots@rastageeks.org>
> > ---
> >  configure                      |   5 +
> >  doc/indevs.texi                |  44 ++++
> >  libavdevice/Makefile           |   1 +
> >  libavdevice/alldevices.c       |   1 +
> >  libavdevice/audiotoolbox_dec.m | 466
> > +++++++++++++++++++++++++++++++++
> >  5 files changed, 517 insertions(+)
> >  create mode 100644 libavdevice/audiotoolbox_dec.m
> >
> > diff --git a/configure b/configure
> > index 1413122d87..80e39aae44 100755
> > --- a/configure
> > +++ b/configure
> > @@ -204,6 +204,7 @@ External library support:
> >    --disable-avfoundation   disable Apple AVFoundation framework
> > [autodetect]
> >    --enable-avisynth        enable reading of AviSynth script files
> > [no]
> >    --disable-bzlib          disable bzlib [autodetect]
> > +  --disable-coremedia      disable Apple CoreMedia framework
> > [autodetect]
> >    --disable-coreimage      disable Apple CoreImage framework
> > [autodetect]
> >    --enable-chromaprint     enable audio fingerprinting with
> > chromaprint [no]
> >    --enable-frei0r          enable frei0r video filtering [no]
> > @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
> >      appkit
> >      avfoundation
> >      bzlib
> > +    coremedia
> >      coreimage
> >      iconv
> >      libxcb
> > @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
> >  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
> >  avfoundation_indev_suggest="coregraphics applicationservices"
> >  avfoundation_indev_extralibs="-framework Foundation"
> > +audiotoolbox_indev_deps="coremedia audiotoolbox"
> > +audiotoolbox_indev_extralibs="-framework CoreMedia -framework
> > AudioToolbox"
> >  audiotoolbox_outdev_deps="audiotoolbox pthreads"
> >  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework
> > CoreAudio"
> >  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
> > dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
> > @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h
> > camera/NdkCameraManager.h" ACameraManag
> >  enabled appkit       && check_apple_framework AppKit
> >  enabled audiotoolbox && check_apple_framework AudioToolbox
> >  enabled avfoundation && check_apple_framework AVFoundation
> > +enabled coremedia    && check_apple_framework CoreMedia
> >  enabled coreimage    && check_apple_framework CoreImage
> >  enabled metal        && check_apple_framework Metal
> >  enabled videotoolbox && check_apple_framework VideoToolbox
> > diff --git a/doc/indevs.texi b/doc/indevs.texi
> > index 858c0fa4e4..30a91d304f 100644
> > --- a/doc/indevs.texi
> > +++ b/doc/indevs.texi
> > @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer.
> > Default is 5.
> >
> >  @end table
> >
> > +@section AudioToolbox
> > +
> > +AudioToolbox input device.
> > +
> > +Allows native input from CoreAudio devices on OSX.
> Nit: Nowadays it's macOS instead of OSX
>
> > +
> > +All available devices can be enumerated by using
> > @option{-list_devices true}, listing
> > +all device names, and corresponding unique ID.
>
> Instead of adding another device that uses a custom list-devices option,
> could you
> instead implement the .get_device_list callback? (See alsa or pulse
> modules for an
> example) Then listing would work properly with the `ffmpeg -sources`
> command and
> devices could be iterated over using the avdevice APIs as well.
>
> (Ideally we would have that for AVFoundation too but its really hard now
> to do that
> in a backwards compatible manner)
>
> > +
> > +@subsection Options
> > +
> > +AudioToolbox supports the following options:
> > +
> > +@table @option
> > +
> > +@item channels
> > +Set the number of channels. Default is device's default.
> > +
> > +@item frames_queue_length
> > +Maximum of buffers in the input queue
> > +
> > +@item buffer_frame_size
> > +Buffer frame size, gouverning internal latency
> > +
> > +@item big_endian
> > +Return big endian samples
> > +
> > +@item sample_format
> > +Sample format
> > +
> > +@end table
> > +
> > +@subsection Examples
> > +
> > +@itemize
> > +
> > +@item
> > +Print the list of supported devices
> > +@example
> > +$ ffmpeg -f audiotoolbox -list_devices true -i ""
> > +@end example
> > +
> > +@end itemize
> > +
> >  @section avfoundation
> […]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-24 15:42     ` Romain Beauxis
@ 2022-01-24 16:19       ` Marvin Scholz
  2022-01-24 16:20         ` Romain Beauxis
  0 siblings, 1 reply; 22+ messages in thread
From: Marvin Scholz @ 2022-01-24 16:19 UTC (permalink / raw)
  To: Romain Beauxis; +Cc: Thilo Borgmann, FFmpeg development discussions and patches



On 24 Jan 2022, at 16:42, Romain Beauxis wrote:

> Hi Marvin,
>
> Le mer. 19 janv. 2022 à 10:59, Marvin Scholz <epirat07@gmail.com> a 
> écrit :
>> On 19 Jan 2022, at 15:42, Romain Beauxis wrote:
>>
>> Hi, thanks for the patch. I've not done a full code review yet, just 
>> a
>> few
>> initial remarks below:
>>
>>> This patch adds support for a new, audio-specific input device using
>>> the documented and battle-tested AUHAL input. This provides a 
>>> pendant
>>> to the AudioToolbox audio-only output.
>>>
>>> A couple of advantages for this:
>>> * It avoids a lot of the complexity of supporting audio and video in 
>>> a
>>> single input
>>> * The AUHAL API seems tested, documented and robust
>>> * This implementation hopefully gives good control over audio 
>>> latency
>>> and also minimizes data copy
>
> Thanks!
>
> Do you need more time for this review? We discovered another issue
> with the dynamic array of video devices and I'd like to send a revised
> series soon.

Well if you want to address the things I mentioned last time
it will anyway change a bunch of things probably, so it
might be easier if I just wait for the new patch.

Additionally it might be useful to send it independent of the
whole patchset as IIUC it does not really depend on any of the
previous patches.

> Also, I think I'll reorder the patches so that the most
> trivial one (unique device name, probing API call updates) can be
> applied right away.
>
> Let me know!
> Romain
>
>>> From: Romain Beauxis <toots@rastageeks.org>
>>> To: ffmpeg-devel@ffmpeg.org
>>> Subject: [PATCH] Add AudioToolbox audio input device.
>>> Date: 18. January 2022 at 23:29
>>> Signed-off-by: Romain Beauxis <toots@rastageeks.org>
>>> ---
>>>  configure                      |   5 +
>>>  doc/indevs.texi                |  44 ++++
>>>  libavdevice/Makefile           |   1 +
>>>  libavdevice/alldevices.c       |   1 +
>>>  libavdevice/audiotoolbox_dec.m | 466
>>> +++++++++++++++++++++++++++++++++
>>>  5 files changed, 517 insertions(+)
>>>  create mode 100644 libavdevice/audiotoolbox_dec.m
>>>
>>> diff --git a/configure b/configure
>>> index 1413122d87..80e39aae44 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -204,6 +204,7 @@ External library support:
>>>    --disable-avfoundation   disable Apple AVFoundation framework
>>> [autodetect]
>>>    --enable-avisynth        enable reading of AviSynth script files
>>> [no]
>>>    --disable-bzlib          disable bzlib [autodetect]
>>> +  --disable-coremedia      disable Apple CoreMedia framework
>>> [autodetect]
>>>    --disable-coreimage      disable Apple CoreImage framework
>>> [autodetect]
>>>    --enable-chromaprint     enable audio fingerprinting with
>>> chromaprint [no]
>>>    --enable-frei0r          enable frei0r video filtering [no]
>>> @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
>>>      appkit
>>>      avfoundation
>>>      bzlib
>>> +    coremedia
>>>      coreimage
>>>      iconv
>>>      libxcb
>>> @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
>>>  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
>>>  avfoundation_indev_suggest="coregraphics applicationservices"
>>>  avfoundation_indev_extralibs="-framework Foundation"
>>> +audiotoolbox_indev_deps="coremedia audiotoolbox"
>>> +audiotoolbox_indev_extralibs="-framework CoreMedia -framework
>>> AudioToolbox"
>>>  audiotoolbox_outdev_deps="audiotoolbox pthreads"
>>>  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework
>>> CoreAudio"
>>>  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
>>> dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
>>> @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h
>>> camera/NdkCameraManager.h" ACameraManag
>>>  enabled appkit       && check_apple_framework AppKit
>>>  enabled audiotoolbox && check_apple_framework AudioToolbox
>>>  enabled avfoundation && check_apple_framework AVFoundation
>>> +enabled coremedia    && check_apple_framework CoreMedia
>>>  enabled coreimage    && check_apple_framework CoreImage
>>>  enabled metal        && check_apple_framework Metal
>>>  enabled videotoolbox && check_apple_framework VideoToolbox
>>> diff --git a/doc/indevs.texi b/doc/indevs.texi
>>> index 858c0fa4e4..30a91d304f 100644
>>> --- a/doc/indevs.texi
>>> +++ b/doc/indevs.texi
>>> @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer.
>>> Default is 5.
>>>
>>>  @end table
>>>
>>> +@section AudioToolbox
>>> +
>>> +AudioToolbox input device.
>>> +
>>> +Allows native input from CoreAudio devices on OSX.
>> Nit: Nowadays it's macOS instead of OSX
>>
>>> +
>>> +All available devices can be enumerated by using
>>> @option{-list_devices true}, listing
>>> +all device names, and corresponding unique ID.
>>
>> Instead of adding another device that uses a custom list-devices 
>> option,
>> could you
>> instead implement the .get_device_list callback? (See alsa or pulse
>> modules for an
>> example) Then listing would work properly with the `ffmpeg -sources`
>> command and
>> devices could be iterated over using the avdevice APIs as well.
>>
>> (Ideally we would have that for AVFoundation too but its really hard 
>> now
>> to do that
>> in a backwards compatible manner)
>>
>>> +
>>> +@subsection Options
>>> +
>>> +AudioToolbox supports the following options:
>>> +
>>> +@table @option
>>> +
>>> +@item channels
>>> +Set the number of channels. Default is device's default.
>>> +
>>> +@item frames_queue_length
>>> +Maximum of buffers in the input queue
>>> +
>>> +@item buffer_frame_size
>>> +Buffer frame size, gouverning internal latency
>>> +
>>> +@item big_endian
>>> +Return big endian samples
>>> +
>>> +@item sample_format
>>> +Sample format
>>> +
>>> +@end table
>>> +
>>> +@subsection Examples
>>> +
>>> +@itemize
>>> +
>>> +@item
>>> +Print the list of supported devices
>>> +@example
>>> +$ ffmpeg -f audiotoolbox -list_devices true -i ""
>>> +@end example
>>> +
>>> +@end itemize
>>> +
>>>  @section avfoundation
>> […]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-24 16:19       ` Marvin Scholz
@ 2022-01-24 16:20         ` Romain Beauxis
  0 siblings, 0 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-24 16:20 UTC (permalink / raw)
  To: Marvin Scholz; +Cc: Thilo Borgmann, FFmpeg development discussions and patches

Le lun. 24 janv. 2022 à 10:19, Marvin Scholz <epirat07@gmail.com> a écrit :
>
>
>
> On 24 Jan 2022, at 16:42, Romain Beauxis wrote:
>
> > Hi Marvin,
> >
> > Le mer. 19 janv. 2022 à 10:59, Marvin Scholz <epirat07@gmail.com> a
> > écrit :
> >> On 19 Jan 2022, at 15:42, Romain Beauxis wrote:
> >>
> >> Hi, thanks for the patch. I've not done a full code review yet, just
> >> a
> >> few
> >> initial remarks below:
> >>
> >>> This patch adds support for a new, audio-specific input device using
> >>> the documented and battle-tested AUHAL input. This provides a
> >>> pendant
> >>> to the AudioToolbox audio-only output.
> >>>
> >>> A couple of advantages for this:
> >>> * It avoids a lot of the complexity of supporting audio and video in
> >>> a
> >>> single input
> >>> * The AUHAL API seems tested, documented and robust
> >>> * This implementation hopefully gives good control over audio
> >>> latency
> >>> and also minimizes data copy
> >
> > Thanks!
> >
> > Do you need more time for this review? We discovered another issue
> > with the dynamic array of video devices and I'd like to send a revised
> > series soon.
>
> Well if you want to address the things I mentioned last time
> it will anyway change a bunch of things probably, so it
> might be easier if I just wait for the new patch.
>
> Additionally it might be useful to send it independent of the
> whole patchset as IIUC it does not really depend on any of the
> previous patches.

Will do, thanks!

> > Also, I think I'll reorder the patches so that the most
> > trivial one (unique device name, probing API call updates) can be
> > applied right away.
> >
> > Let me know!
> > Romain
> >
> >>> From: Romain Beauxis <toots@rastageeks.org>
> >>> To: ffmpeg-devel@ffmpeg.org
> >>> Subject: [PATCH] Add AudioToolbox audio input device.
> >>> Date: 18. January 2022 at 23:29
> >>> Signed-off-by: Romain Beauxis <toots@rastageeks.org>
> >>> ---
> >>>  configure                      |   5 +
> >>>  doc/indevs.texi                |  44 ++++
> >>>  libavdevice/Makefile           |   1 +
> >>>  libavdevice/alldevices.c       |   1 +
> >>>  libavdevice/audiotoolbox_dec.m | 466
> >>> +++++++++++++++++++++++++++++++++
> >>>  5 files changed, 517 insertions(+)
> >>>  create mode 100644 libavdevice/audiotoolbox_dec.m
> >>>
> >>> diff --git a/configure b/configure
> >>> index 1413122d87..80e39aae44 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -204,6 +204,7 @@ External library support:
> >>>    --disable-avfoundation   disable Apple AVFoundation framework
> >>> [autodetect]
> >>>    --enable-avisynth        enable reading of AviSynth script files
> >>> [no]
> >>>    --disable-bzlib          disable bzlib [autodetect]
> >>> +  --disable-coremedia      disable Apple CoreMedia framework
> >>> [autodetect]
> >>>    --disable-coreimage      disable Apple CoreImage framework
> >>> [autodetect]
> >>>    --enable-chromaprint     enable audio fingerprinting with
> >>> chromaprint [no]
> >>>    --enable-frei0r          enable frei0r video filtering [no]
> >>> @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
> >>>      appkit
> >>>      avfoundation
> >>>      bzlib
> >>> +    coremedia
> >>>      coreimage
> >>>      iconv
> >>>      libxcb
> >>> @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
> >>>  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
> >>>  avfoundation_indev_suggest="coregraphics applicationservices"
> >>>  avfoundation_indev_extralibs="-framework Foundation"
> >>> +audiotoolbox_indev_deps="coremedia audiotoolbox"
> >>> +audiotoolbox_indev_extralibs="-framework CoreMedia -framework
> >>> AudioToolbox"
> >>>  audiotoolbox_outdev_deps="audiotoolbox pthreads"
> >>>  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework
> >>> CoreAudio"
> >>>  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
> >>> dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
> >>> @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h
> >>> camera/NdkCameraManager.h" ACameraManag
> >>>  enabled appkit       && check_apple_framework AppKit
> >>>  enabled audiotoolbox && check_apple_framework AudioToolbox
> >>>  enabled avfoundation && check_apple_framework AVFoundation
> >>> +enabled coremedia    && check_apple_framework CoreMedia
> >>>  enabled coreimage    && check_apple_framework CoreImage
> >>>  enabled metal        && check_apple_framework Metal
> >>>  enabled videotoolbox && check_apple_framework VideoToolbox
> >>> diff --git a/doc/indevs.texi b/doc/indevs.texi
> >>> index 858c0fa4e4..30a91d304f 100644
> >>> --- a/doc/indevs.texi
> >>> +++ b/doc/indevs.texi
> >>> @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer.
> >>> Default is 5.
> >>>
> >>>  @end table
> >>>
> >>> +@section AudioToolbox
> >>> +
> >>> +AudioToolbox input device.
> >>> +
> >>> +Allows native input from CoreAudio devices on OSX.
> >> Nit: Nowadays it's macOS instead of OSX
> >>
> >>> +
> >>> +All available devices can be enumerated by using
> >>> @option{-list_devices true}, listing
> >>> +all device names, and corresponding unique ID.
> >>
> >> Instead of adding another device that uses a custom list-devices
> >> option,
> >> could you
> >> instead implement the .get_device_list callback? (See alsa or pulse
> >> modules for an
> >> example) Then listing would work properly with the `ffmpeg -sources`
> >> command and
> >> devices could be iterated over using the avdevice APIs as well.
> >>
> >> (Ideally we would have that for AVFoundation too but its really hard
> >> now
> >> to do that
> >> in a backwards compatible manner)
> >>
> >>> +
> >>> +@subsection Options
> >>> +
> >>> +AudioToolbox supports the following options:
> >>> +
> >>> +@table @option
> >>> +
> >>> +@item channels
> >>> +Set the number of channels. Default is device's default.
> >>> +
> >>> +@item frames_queue_length
> >>> +Maximum of buffers in the input queue
> >>> +
> >>> +@item buffer_frame_size
> >>> +Buffer frame size, gouverning internal latency
> >>> +
> >>> +@item big_endian
> >>> +Return big endian samples
> >>> +
> >>> +@item sample_format
> >>> +Sample format
> >>> +
> >>> +@end table
> >>> +
> >>> +@subsection Examples
> >>> +
> >>> +@itemize
> >>> +
> >>> +@item
> >>> +Print the list of supported devices
> >>> +@example
> >>> +$ ffmpeg -f audiotoolbox -list_devices true -i ""
> >>> +@end example
> >>> +
> >>> +@end itemize
> >>> +
> >>>  @section avfoundation
> >> […]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-19 16:59   ` Marvin Scholz
  2022-01-24 15:42     ` Romain Beauxis
@ 2022-01-29 20:35     ` Romain Beauxis
  2022-01-29 20:41       ` Andreas Rheinhardt
  1 sibling, 1 reply; 22+ messages in thread
From: Romain Beauxis @ 2022-01-29 20:35 UTC (permalink / raw)
  To: Marvin Scholz; +Cc: Thilo Borgmann, FFmpeg development discussions and patches

Le mer. 19 janv. 2022 à 10:59, Marvin Scholz <epirat07@gmail.com> a écrit :
>
>
>
> On 19 Jan 2022, at 15:42, Romain Beauxis wrote:
>
> Hi, thanks for the patch. I've not done a full code review yet, just a
> few
> initial remarks below:
>
> > This patch adds support for a new, audio-specific input device using
> > the documented and battle-tested AUHAL input. This provides a pendant
> > to the AudioToolbox audio-only output.
> >
> > A couple of advantages for this:
> > * It avoids a lot of the complexity of supporting audio and video in a
> > single input
> > * The AUHAL API seems tested, documented and robust
> > * This implementation hopefully gives good control over audio latency
> > and also minimizes data copy
> > From: Romain Beauxis <toots@rastageeks.org>
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: [PATCH] Add AudioToolbox audio input device.
> > Date: 18. January 2022 at 23:29
> > Signed-off-by: Romain Beauxis <toots@rastageeks.org>
> > ---
> >  configure                      |   5 +
> >  doc/indevs.texi                |  44 ++++
> >  libavdevice/Makefile           |   1 +
> >  libavdevice/alldevices.c       |   1 +
> >  libavdevice/audiotoolbox_dec.m | 466
> > +++++++++++++++++++++++++++++++++
> >  5 files changed, 517 insertions(+)
> >  create mode 100644 libavdevice/audiotoolbox_dec.m
> >
> > diff --git a/configure b/configure
> > index 1413122d87..80e39aae44 100755
> > --- a/configure
> > +++ b/configure
> > @@ -204,6 +204,7 @@ External library support:
> >    --disable-avfoundation   disable Apple AVFoundation framework
> > [autodetect]
> >    --enable-avisynth        enable reading of AviSynth script files
> > [no]
> >    --disable-bzlib          disable bzlib [autodetect]
> > +  --disable-coremedia      disable Apple CoreMedia framework
> > [autodetect]
> >    --disable-coreimage      disable Apple CoreImage framework
> > [autodetect]
> >    --enable-chromaprint     enable audio fingerprinting with
> > chromaprint [no]
> >    --enable-frei0r          enable frei0r video filtering [no]
> > @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
> >      appkit
> >      avfoundation
> >      bzlib
> > +    coremedia
> >      coreimage
> >      iconv
> >      libxcb
> > @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
> >  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
> >  avfoundation_indev_suggest="coregraphics applicationservices"
> >  avfoundation_indev_extralibs="-framework Foundation"
> > +audiotoolbox_indev_deps="coremedia audiotoolbox"
> > +audiotoolbox_indev_extralibs="-framework CoreMedia -framework
> > AudioToolbox"
> >  audiotoolbox_outdev_deps="audiotoolbox pthreads"
> >  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework
> > CoreAudio"
> >  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
> > dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
> > @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h
> > camera/NdkCameraManager.h" ACameraManag
> >  enabled appkit       && check_apple_framework AppKit
> >  enabled audiotoolbox && check_apple_framework AudioToolbox
> >  enabled avfoundation && check_apple_framework AVFoundation
> > +enabled coremedia    && check_apple_framework CoreMedia
> >  enabled coreimage    && check_apple_framework CoreImage
> >  enabled metal        && check_apple_framework Metal
> >  enabled videotoolbox && check_apple_framework VideoToolbox
> > diff --git a/doc/indevs.texi b/doc/indevs.texi
> > index 858c0fa4e4..30a91d304f 100644
> > --- a/doc/indevs.texi
> > +++ b/doc/indevs.texi
> > @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer.
> > Default is 5.
> >
> >  @end table
> >
> > +@section AudioToolbox
> > +
> > +AudioToolbox input device.
> > +
> > +Allows native input from CoreAudio devices on OSX.
> Nit: Nowadays it's macOS instead of OSX
>
> > +
> > +All available devices can be enumerated by using
> > @option{-list_devices true}, listing
> > +all device names, and corresponding unique ID.
>
> Instead of adding another device that uses a custom list-devices option,
> could you
> instead implement the .get_device_list callback? (See alsa or pulse
> modules for an
> example) Then listing would work properly with the `ffmpeg -sources`
> command and
> devices could be iterated over using the avdevice APIs as well.
>
> (Ideally we would have that for AVFoundation too but its really hard now
> to do that
> in a backwards compatible manner)

Is there a way to access the result of the get_devices_callback from
the ffmpeg CLI? I have searched but haven't found any so far..

> > +
> > +@subsection Options
> > +
> > +AudioToolbox supports the following options:
> > +
> > +@table @option
> > +
> > +@item channels
> > +Set the number of channels. Default is device's default.
> > +
> > +@item frames_queue_length
> > +Maximum of buffers in the input queue
> > +
> > +@item buffer_frame_size
> > +Buffer frame size, gouverning internal latency
> > +
> > +@item big_endian
> > +Return big endian samples
> > +
> > +@item sample_format
> > +Sample format
> > +
> > +@end table
> > +
> > +@subsection Examples
> > +
> > +@itemize
> > +
> > +@item
> > +Print the list of supported devices
> > +@example
> > +$ ffmpeg -f audiotoolbox -list_devices true -i ""
> > +@end example
> > +
> > +@end itemize
> > +
> >  @section avfoundation
> […]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-29 20:35     ` Romain Beauxis
@ 2022-01-29 20:41       ` Andreas Rheinhardt
  2022-01-29 20:43         ` Romain Beauxis
  0 siblings, 1 reply; 22+ messages in thread
From: Andreas Rheinhardt @ 2022-01-29 20:41 UTC (permalink / raw)
  To: ffmpeg-devel

Romain Beauxis:
> Le mer. 19 janv. 2022 à 10:59, Marvin Scholz <epirat07@gmail.com> a écrit :
>>
>>
>>
>> On 19 Jan 2022, at 15:42, Romain Beauxis wrote:
>>
>> Hi, thanks for the patch. I've not done a full code review yet, just a
>> few
>> initial remarks below:
>>
>>> This patch adds support for a new, audio-specific input device using
>>> the documented and battle-tested AUHAL input. This provides a pendant
>>> to the AudioToolbox audio-only output.
>>>
>>> A couple of advantages for this:
>>> * It avoids a lot of the complexity of supporting audio and video in a
>>> single input
>>> * The AUHAL API seems tested, documented and robust
>>> * This implementation hopefully gives good control over audio latency
>>> and also minimizes data copy
>>> From: Romain Beauxis <toots@rastageeks.org>
>>> To: ffmpeg-devel@ffmpeg.org
>>> Subject: [PATCH] Add AudioToolbox audio input device.
>>> Date: 18. January 2022 at 23:29
>>> Signed-off-by: Romain Beauxis <toots@rastageeks.org>
>>> ---
>>>  configure                      |   5 +
>>>  doc/indevs.texi                |  44 ++++
>>>  libavdevice/Makefile           |   1 +
>>>  libavdevice/alldevices.c       |   1 +
>>>  libavdevice/audiotoolbox_dec.m | 466
>>> +++++++++++++++++++++++++++++++++
>>>  5 files changed, 517 insertions(+)
>>>  create mode 100644 libavdevice/audiotoolbox_dec.m
>>>
>>> diff --git a/configure b/configure
>>> index 1413122d87..80e39aae44 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -204,6 +204,7 @@ External library support:
>>>    --disable-avfoundation   disable Apple AVFoundation framework
>>> [autodetect]
>>>    --enable-avisynth        enable reading of AviSynth script files
>>> [no]
>>>    --disable-bzlib          disable bzlib [autodetect]
>>> +  --disable-coremedia      disable Apple CoreMedia framework
>>> [autodetect]
>>>    --disable-coreimage      disable Apple CoreImage framework
>>> [autodetect]
>>>    --enable-chromaprint     enable audio fingerprinting with
>>> chromaprint [no]
>>>    --enable-frei0r          enable frei0r video filtering [no]
>>> @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
>>>      appkit
>>>      avfoundation
>>>      bzlib
>>> +    coremedia
>>>      coreimage
>>>      iconv
>>>      libxcb
>>> @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
>>>  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
>>>  avfoundation_indev_suggest="coregraphics applicationservices"
>>>  avfoundation_indev_extralibs="-framework Foundation"
>>> +audiotoolbox_indev_deps="coremedia audiotoolbox"
>>> +audiotoolbox_indev_extralibs="-framework CoreMedia -framework
>>> AudioToolbox"
>>>  audiotoolbox_outdev_deps="audiotoolbox pthreads"
>>>  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework
>>> CoreAudio"
>>>  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
>>> dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
>>> @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h
>>> camera/NdkCameraManager.h" ACameraManag
>>>  enabled appkit       && check_apple_framework AppKit
>>>  enabled audiotoolbox && check_apple_framework AudioToolbox
>>>  enabled avfoundation && check_apple_framework AVFoundation
>>> +enabled coremedia    && check_apple_framework CoreMedia
>>>  enabled coreimage    && check_apple_framework CoreImage
>>>  enabled metal        && check_apple_framework Metal
>>>  enabled videotoolbox && check_apple_framework VideoToolbox
>>> diff --git a/doc/indevs.texi b/doc/indevs.texi
>>> index 858c0fa4e4..30a91d304f 100644
>>> --- a/doc/indevs.texi
>>> +++ b/doc/indevs.texi
>>> @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer.
>>> Default is 5.
>>>
>>>  @end table
>>>
>>> +@section AudioToolbox
>>> +
>>> +AudioToolbox input device.
>>> +
>>> +Allows native input from CoreAudio devices on OSX.
>> Nit: Nowadays it's macOS instead of OSX
>>
>>> +
>>> +All available devices can be enumerated by using
>>> @option{-list_devices true}, listing
>>> +all device names, and corresponding unique ID.
>>
>> Instead of adding another device that uses a custom list-devices option,
>> could you
>> instead implement the .get_device_list callback? (See alsa or pulse
>> modules for an
>> example) Then listing would work properly with the `ffmpeg -sources`
>> command and
>> devices could be iterated over using the avdevice APIs as well.
>>
>> (Ideally we would have that for AVFoundation too but its really hard now
>> to do that
>> in a backwards compatible manner)
> 
> Is there a way to access the result of the get_devices_callback from
> the ffmpeg CLI? I have searched but haven't found any so far..
> 

-sources or -sinks; you can also add a specific device like "-sources alsa".

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device.
  2022-01-29 20:41       ` Andreas Rheinhardt
@ 2022-01-29 20:43         ` Romain Beauxis
  0 siblings, 0 replies; 22+ messages in thread
From: Romain Beauxis @ 2022-01-29 20:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Le sam. 29 janv. 2022 à 14:42, Andreas Rheinhardt
<andreas.rheinhardt@outlook.com> a écrit :
>
> Romain Beauxis:
> > Le mer. 19 janv. 2022 à 10:59, Marvin Scholz <epirat07@gmail.com> a écrit :
> >>
> >>
> >>
> >> On 19 Jan 2022, at 15:42, Romain Beauxis wrote:
> >>
> >> Hi, thanks for the patch. I've not done a full code review yet, just a
> >> few
> >> initial remarks below:
> >>
> >>> This patch adds support for a new, audio-specific input device using
> >>> the documented and battle-tested AUHAL input. This provides a pendant
> >>> to the AudioToolbox audio-only output.
> >>>
> >>> A couple of advantages for this:
> >>> * It avoids a lot of the complexity of supporting audio and video in a
> >>> single input
> >>> * The AUHAL API seems tested, documented and robust
> >>> * This implementation hopefully gives good control over audio latency
> >>> and also minimizes data copy
> >>> From: Romain Beauxis <toots@rastageeks.org>
> >>> To: ffmpeg-devel@ffmpeg.org
> >>> Subject: [PATCH] Add AudioToolbox audio input device.
> >>> Date: 18. January 2022 at 23:29
> >>> Signed-off-by: Romain Beauxis <toots@rastageeks.org>
> >>> ---
> >>>  configure                      |   5 +
> >>>  doc/indevs.texi                |  44 ++++
> >>>  libavdevice/Makefile           |   1 +
> >>>  libavdevice/alldevices.c       |   1 +
> >>>  libavdevice/audiotoolbox_dec.m | 466
> >>> +++++++++++++++++++++++++++++++++
> >>>  5 files changed, 517 insertions(+)
> >>>  create mode 100644 libavdevice/audiotoolbox_dec.m
> >>>
> >>> diff --git a/configure b/configure
> >>> index 1413122d87..80e39aae44 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -204,6 +204,7 @@ External library support:
> >>>    --disable-avfoundation   disable Apple AVFoundation framework
> >>> [autodetect]
> >>>    --enable-avisynth        enable reading of AviSynth script files
> >>> [no]
> >>>    --disable-bzlib          disable bzlib [autodetect]
> >>> +  --disable-coremedia      disable Apple CoreMedia framework
> >>> [autodetect]
> >>>    --disable-coreimage      disable Apple CoreImage framework
> >>> [autodetect]
> >>>    --enable-chromaprint     enable audio fingerprinting with
> >>> chromaprint [no]
> >>>    --enable-frei0r          enable frei0r video filtering [no]
> >>> @@ -1750,6 +1751,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
> >>>      appkit
> >>>      avfoundation
> >>>      bzlib
> >>> +    coremedia
> >>>      coreimage
> >>>      iconv
> >>>      libxcb
> >>> @@ -3493,6 +3495,8 @@ alsa_outdev_deps="alsa"
> >>>  avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
> >>>  avfoundation_indev_suggest="coregraphics applicationservices"
> >>>  avfoundation_indev_extralibs="-framework Foundation"
> >>> +audiotoolbox_indev_deps="coremedia audiotoolbox"
> >>> +audiotoolbox_indev_extralibs="-framework CoreMedia -framework
> >>> AudioToolbox"
> >>>  audiotoolbox_outdev_deps="audiotoolbox pthreads"
> >>>  audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework
> >>> CoreAudio"
> >>>  bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h
> >>> dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
> >>> @@ -6340,6 +6344,7 @@ check_lib camera2ndk "stdbool.h stdint.h
> >>> camera/NdkCameraManager.h" ACameraManag
> >>>  enabled appkit       && check_apple_framework AppKit
> >>>  enabled audiotoolbox && check_apple_framework AudioToolbox
> >>>  enabled avfoundation && check_apple_framework AVFoundation
> >>> +enabled coremedia    && check_apple_framework CoreMedia
> >>>  enabled coreimage    && check_apple_framework CoreImage
> >>>  enabled metal        && check_apple_framework Metal
> >>>  enabled videotoolbox && check_apple_framework VideoToolbox
> >>> diff --git a/doc/indevs.texi b/doc/indevs.texi
> >>> index 858c0fa4e4..30a91d304f 100644
> >>> --- a/doc/indevs.texi
> >>> +++ b/doc/indevs.texi
> >>> @@ -103,6 +103,50 @@ Set the maximum number of frames to buffer.
> >>> Default is 5.
> >>>
> >>>  @end table
> >>>
> >>> +@section AudioToolbox
> >>> +
> >>> +AudioToolbox input device.
> >>> +
> >>> +Allows native input from CoreAudio devices on OSX.
> >> Nit: Nowadays it's macOS instead of OSX
> >>
> >>> +
> >>> +All available devices can be enumerated by using
> >>> @option{-list_devices true}, listing
> >>> +all device names, and corresponding unique ID.
> >>
> >> Instead of adding another device that uses a custom list-devices option,
> >> could you
> >> instead implement the .get_device_list callback? (See alsa or pulse
> >> modules for an
> >> example) Then listing would work properly with the `ffmpeg -sources`
> >> command and
> >> devices could be iterated over using the avdevice APIs as well.
> >>
> >> (Ideally we would have that for AVFoundation too but its really hard now
> >> to do that
> >> in a backwards compatible manner)
> >
> > Is there a way to access the result of the get_devices_callback from
> > the ffmpeg CLI? I have searched but haven't found any so far..
> >
>
> -sources or -sinks; you can also add a specific device like "-sources alsa".

Yeah. I re-read Marvin's initial message and the answer was right
there... :facepalm:
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-01-29 20:43 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 14:17 [FFmpeg-devel] [PATCH 0/5] macos avdevice fixes and improvements Romain Beauxis
2022-01-19 14:23 ` [FFmpeg-devel] [PATCH 1/5] libavdevice/avfoundation.m: use setAudioSettings, extend supported formats Romain Beauxis
2022-01-19 14:27   ` Marvin Scholz
2022-01-19 14:28   ` Andreas Rheinhardt
2022-01-19 16:48     ` Thilo Borgmann
2022-01-19 14:31   ` Gyan Doshi
2022-01-19 15:14     ` Romain Beauxis
2022-01-19 15:19       ` Gyan Doshi
2022-01-19 15:21         ` Romain Beauxis
2022-01-19 15:45           ` Gyan Doshi
2022-01-19 15:52             ` Romain Beauxis
2022-01-19 14:35 ` [FFmpeg-devel] [PATCH 2/5] libavdevice/avfoundation.m: Replace mutex-based concurrency by a thread-safe fifo queue with maximum length Romain Beauxis
2022-01-19 14:38 ` [FFmpeg-devel] [PATCH 3/5] libavdevice/avfoundation.m: Allow to select devices by unique ID Romain Beauxis
2022-01-19 14:39 ` [FFmpeg-devel] [PATCH 4/5] Use appropriate method for device discovery Romain Beauxis
2022-01-19 14:42 ` [FFmpeg-devel] [PATCH 5/5] Add AudioToolbox audio input device Romain Beauxis
2022-01-19 16:59   ` Marvin Scholz
2022-01-24 15:42     ` Romain Beauxis
2022-01-24 16:19       ` Marvin Scholz
2022-01-24 16:20         ` Romain Beauxis
2022-01-29 20:35     ` Romain Beauxis
2022-01-29 20:41       ` Andreas Rheinhardt
2022-01-29 20:43         ` Romain Beauxis

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git