AVFoundation audio device

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

AVFoundation audio device

neve_capricorn@gmx.de
the latest git version that i compiled for osx works great with the
avfoundation devices.

ffmpeg -f avfoundation -video_device_index 0 -i "default" out.mpg

captures fine videoframes into an mpg stream. the underlaying
avfoundation core audio is not possible as i seen, so i tried:

ffmpeg -f avfoundation -audio_device_index 0 -i "default" out.mpg

a short look in the avfoundation source seems that it´s only for video
right now.

is there a way how i can capture a audio stream with ffmpeg under osx
10.9 together with avfoundation to one muxed mpg or similar file container?

thx for help
tom

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

realrunner
Any updates on this? I'd like to do the same thing. I tried to get OpenAL to work as well but without any luck. Is there any way at all to get FFmpeg to stream/capture audio?
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

DopeLabs
have you tried sox?  It’s in macports.


Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopt]]...

SPECIAL FILENAMES (infile, outfile):
-                        Pipe/redirect input/output (stdin/stdout); may need -t
-d, --default-device     Use the default audio device (where available)
-n, --null               Use the `null' file handler; e.g. with synth effect
-p, --sox-pipe           Alias for `-t sox -'

SPECIAL FILENAMES (infile only):
"|program [options] ..." Pipe input from external program (where supported)
http://server/file       Use the given URL as input file (where supported)

GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect):
--buffer BYTES           Set the size of all processing buffers (default 8192)
--clobber                Don't prompt to overwrite output file (default)
--combine concatenate    Concatenate all input files (default for sox, rec)
--combine sequence       Sequence all input files (default for play)
-D, --no-dither          Don't dither automatically
--effects-file FILENAME  File containing effects and options
-G, --guard              Use temporary files to guard against clipping
-h, --help               Display version number and usage information
--help-effect NAME       Show usage of effect NAME, or NAME=all for all
--help-format NAME       Show info on format NAME, or NAME=all for all
--i, --info              Behave as soxi(1)
--input-buffer BYTES     Override the input buffer size (default: as --buffer)
--no-clobber             Prompt to overwrite output file
-m, --combine mix        Mix multiple input files (instead of concatenating)
--combine mix-power      Mix to equal power (instead of concatenating)
-M, --combine merge      Merge multiple input files (instead of concatenating)
--magic                  Use `magic' file-type detection
--norm                   Guard (see --guard) & normalise
--play-rate-arg ARG      Default `rate' argument for auto-resample with `play'
--plot gnuplot|octave    Generate script to plot response of filter effect
-q, --no-show-progress   Run in quiet mode; opposite of -S
--replay-gain track|album|off  Default: off (sox, rec), track (play)
-R                       Use default random numbers (same on each run of SoX)
-S, --show-progress      Display progress while processing audio data
--single-threaded        Disable parallel effects channels processing
--temp DIRECTORY         Specify the directory to use for temporary files
-T, --combine multiply   Multiply samples of corresponding channels from all
                        input files (instead of concatenating)
--version                Display version number of SoX and exit
-V[LEVEL]                Increment or set verbosity level (default 2); levels:
                          1: failure messages
                          2: warnings
                          3: details of processing
                          4-6: increasing levels of debug messages
FORMAT OPTIONS (fopts):
Input file format options need only be supplied for files that are headerless.
Output files will have the same format as the input file where possible and not
overriden by any of various means including providing output format options.

-v|--volume FACTOR       Input file volume adjustment factor (real number)
--ignore-length          Ignore input file length given in header; read to EOF
-t|--type FILETYPE       File type of audio
-e|--encoding ENCODING   Set encoding (ENCODING may be one of signed-integer,
                        unsigned-integer, floating-point, mu-law, a-law,
                        ima-adpcm, ms-adpcm, gsm-full-rate)
-b|--bits BITS           Encoded sample size in bits
-N|--reverse-nibbles     Encoded nibble-order
-X|--reverse-bits        Encoded bit-order
--endian little|big|swap Encoded byte-order; swap means opposite to default
-L/-B/-x                 Short options for the above
-c|--channels CHANNELS   Number of channels of audio data; e.g. 2 = stereo
-r|--rate RATE           Sample rate of audio
-C|--compression FACTOR  Compression factor for output format
--add-comment TEXT       Append output file comment
--comment TEXT           Specify comment text for the output file
--comment-file FILENAME  File containing comment text for the output file
--no-glob                Don't `glob' wildcard match the following filename

AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au avr awb caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu mat mat4 mat5 maud mp2 mp3 nist ogg paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wv wve xa xi
PLAYLIST FORMATS: m3u pls
AUDIO DEVICE DRIVERS: coreaudio

EFFECTS: allpass band bandpass bandreject bass bend biquad chorus channels compand contrast dcshift deemph delay dither divide+ downsample earwax echo echos equalizer fade fir firfit+ flanger gain highpass hilbert input# loudness lowpass mcompand mixer* noiseprof noisered norm oops output# overdrive pad phaser pitch rate remix repeat reverb reverse riaa silence sinc spectrogram speed splice stat stats stretch swap synth tempo treble tremolo trim upsample vad vol
 * Deprecated effect    + Experimental effect    # LibSoX-only effect
EFFECT OPTIONS (effopts): effect dependent; see --help-effect
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

realrunner
It appears that sox is supported in ffmpeg as a format but not as a device:


/configure --list-indevs
alsa iec61883 pulse
avfoundation jack qtkit
bktr lavfi sndio
dshow libcdio v4l2
dv1394 libdc1394 vfwcap
fbdev openal x11grab
gdigrab oss

So I don't see how it will help with audio capture.


On Tue, Jun 3, 2014 at 9:17 PM, DopeLabs <[hidden email]> wrote:

> have you tried sox?  It’s in macports.
>
>
> Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect
> [effopt]]...
>
> SPECIAL FILENAMES (infile, outfile):
> -                        Pipe/redirect input/output (stdin/stdout); may
> need -t
> -d, --default-device     Use the default audio device (where available)
> -n, --null               Use the `null' file handler; e.g. with synth
> effect
> -p, --sox-pipe           Alias for `-t sox -'
>
> SPECIAL FILENAMES (infile only):
> "|program [options] ..." Pipe input from external program (where supported)
> http://server/file       Use the given URL as input file (where supported)
>
> GLOBAL OPTIONS (gopts) (can be specified at any point before the first
> effect):
> --buffer BYTES           Set the size of all processing buffers (default
> 8192)
> --clobber                Don't prompt to overwrite output file (default)
> --combine concatenate    Concatenate all input files (default for sox, rec)
> --combine sequence       Sequence all input files (default for play)
> -D, --no-dither          Don't dither automatically
> --effects-file FILENAME  File containing effects and options
> -G, --guard              Use temporary files to guard against clipping
> -h, --help               Display version number and usage information
> --help-effect NAME       Show usage of effect NAME, or NAME=all for all
> --help-format NAME       Show info on format NAME, or NAME=all for all
> --i, --info              Behave as soxi(1)
> --input-buffer BYTES     Override the input buffer size (default: as
> --buffer)
> --no-clobber             Prompt to overwrite output file
> -m, --combine mix        Mix multiple input files (instead of
> concatenating)
> --combine mix-power      Mix to equal power (instead of concatenating)
> -M, --combine merge      Merge multiple input files (instead of
> concatenating)
> --magic                  Use `magic' file-type detection
> --norm                   Guard (see --guard) & normalise
> --play-rate-arg ARG      Default `rate' argument for auto-resample with
> `play'
> --plot gnuplot|octave    Generate script to plot response of filter effect
> -q, --no-show-progress   Run in quiet mode; opposite of -S
> --replay-gain track|album|off  Default: off (sox, rec), track (play)
> -R                       Use default random numbers (same on each run of
> SoX)
> -S, --show-progress      Display progress while processing audio data
> --single-threaded        Disable parallel effects channels processing
> --temp DIRECTORY         Specify the directory to use for temporary files
> -T, --combine multiply   Multiply samples of corresponding channels from
> all
>                         input files (instead of concatenating)
> --version                Display version number of SoX and exit
> -V[LEVEL]                Increment or set verbosity level (default 2);
> levels:
>                           1: failure messages
>                           2: warnings
>                           3: details of processing
>                           4-6: increasing levels of debug messages
> FORMAT OPTIONS (fopts):
> Input file format options need only be supplied for files that are
> headerless.
> Output files will have the same format as the input file where possible
> and not
> overriden by any of various means including providing output format
> options.
>
> -v|--volume FACTOR       Input file volume adjustment factor (real number)
> --ignore-length          Ignore input file length given in header; read to
> EOF
> -t|--type FILETYPE       File type of audio
> -e|--encoding ENCODING   Set encoding (ENCODING may be one of
> signed-integer,
>                         unsigned-integer, floating-point, mu-law, a-law,
>                         ima-adpcm, ms-adpcm, gsm-full-rate)
> -b|--bits BITS           Encoded sample size in bits
> -N|--reverse-nibbles     Encoded nibble-order
> -X|--reverse-bits        Encoded bit-order
> --endian little|big|swap Encoded byte-order; swap means opposite to default
> -L/-B/-x                 Short options for the above
> -c|--channels CHANNELS   Number of channels of audio data; e.g. 2 = stereo
> -r|--rate RATE           Sample rate of audio
> -C|--compression FACTOR  Compression factor for output format
> --add-comment TEXT       Append output file comment
> --comment TEXT           Specify comment text for the output file
> --comment-file FILENAME  File containing comment text for the output file
> --no-glob                Don't `glob' wildcard match the following filename
>
> AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au
> avr awb caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm
> gsrt hcom htk ima ircam la lpc lpc10 lu mat mat4 mat5 maud mp2 mp3 nist ogg
> paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd
> sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw
> vms voc vorbis vox w64 wav wavpcm wv wve xa xi
> PLAYLIST FORMATS: m3u pls
> AUDIO DEVICE DRIVERS: coreaudio
>
> EFFECTS: allpass band bandpass bandreject bass bend biquad chorus channels
> compand contrast dcshift deemph delay dither divide+ downsample earwax echo
> echos equalizer fade fir firfit+ flanger gain highpass hilbert input#
> loudness lowpass mcompand mixer* noiseprof noisered norm oops output#
> overdrive pad phaser pitch rate remix repeat reverb reverse riaa silence
> sinc spectrogram speed splice stat stats stretch swap synth tempo treble
> tremolo trim upsample vad vol
>  * Deprecated effect    + Experimental effect    # LibSoX-only effect
> EFFECT OPTIONS (effopts): effect dependent; see --help-effect
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

DopeLabs
either jack or pulse (maybe), alsa? you can use one or some those to create mappings to a standard hardware style device such as '/dev/audio' , which you specify when configuring, you should then be able to use ffmpeg... i know this works ive done/seen it im just trying to remember / locate my bash hist. i had it working so that i could have a real time showspecturm filtergraph up on another display... but i was just trying all the weird combinations using sox, jack, portaudio, au-net send/receive, ice/shoutcast, until i found one that worked.... i will update if i find it...
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

Thilo Borgmann-2
In reply to this post by neve_capricorn@gmx.de
Am 15.04.14 12:32, schrieb [hidden email]:

> the latest git version that i compiled for osx works great with the avfoundation
> devices.
>
> ffmpeg -f avfoundation -video_device_index 0 -i "default" out.mpg
>
> captures fine videoframes into an mpg stream. the underlaying avfoundation core
> audio is not possible as i seen, so i tried:
>
> ffmpeg -f avfoundation -audio_device_index 0 -i "default" out.mpg
>
> a short look in the avfoundation source seems that it´s only for video right now.

A patch for audio is on the way. Unfortunately, I've not much time to work on it
right now. If you're in hurry you might test the patch already posted on devel
and see if it already works for you.

-Thilo

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

realrunner
Thanks Thilo. I've applied your patch and everything seems to work great.
Do you mind explaining what you feel is lacking before this is prime time?


On Wed, Jun 4, 2014 at 1:47 AM, Thilo Borgmann <[hidden email]>
wrote:

> Am 15.04.14 12:32, schrieb [hidden email]:
> > the latest git version that i compiled for osx works great with the
> avfoundation
> > devices.
> >
> > ffmpeg -f avfoundation -video_device_index 0 -i "default" out.mpg
> >
> > captures fine videoframes into an mpg stream. the underlaying
> avfoundation core
> > audio is not possible as i seen, so i tried:
> >
> > ffmpeg -f avfoundation -audio_device_index 0 -i "default" out.mpg
> >
> > a short look in the avfoundation source seems that it´s only for video
> right now.
>
> A patch for audio is on the way. Unfortunately, I've not much time to work
> on it
> right now. If you're in hurry you might test the patch already posted on
> devel
> and see if it already works for you.
>
> -Thilo
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: AVFoundation audio device

Thilo Borgmann-2
Am 04.06.14 19:06, schrieb Mike Nelson:
> Thanks Thilo. I've applied your patch and everything seems to work great.
> Do you mind explaining what you feel is lacking before this is prime time?

Timestamps are not handled correctly in all cases by now.
And maybe some other major bugs not yet found.

-Thilo

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