[FFmpeg-user] How to record audio and video from FaceTime HD Camera in OSX

Jay Muthialu jmuthialu at yahoo.com
Mon Sep 22 16:50:05 CEST 2014


Hi Roger,

 I will try the git master and update the thread. I also think there is something wrong in my command in OSX. When I run the below, it seems to recognize video device name as "FaceTime HD Camera":audio="Built-in Microphone"  which is not correct and hence it could not find the video device. What is the command I need to use to specifically identify audio and video streams. In windows it is very clear and it works good with this command ( ffmpeg –f dshow –i video=”USB2.0 Camera”:audio=”Microphone (Realtek High Definition Audio)”  -pix_fmt yuv420p out.mp4). How to do the same in OSX?

Command I used in OSX
$ ffmpeg -f avfoundation -i video="FaceTime HD Camera":audio="Built-in Microphone" -r 29.97 -y out.mov
Output
>> [AVFoundation input device @ 0x7fc133c15700] Video device not found
>> video=FaceTime HD Camera:audio=Built-in Microphone: Input/output error


Thanks
Jay
On Sep 22, 2014, at 10:30 AM, Roger Pack <rogerdpack2 at gmail.com> wrote:

> Could you try with git master [the patches were applied it seems, this
> weekend]?
> Also possibly run ffmpeg_g in gdb and see where it is hung?
> Cheers!
> 
> On Mon, Sep 22, 2014 at 8:20 AM, Jay Muthialu <
> jmuthialu-at-yahoo.com at ffmpeg.org> wrote:
> 
>> Hi Roger,
>> 
>> Thanks for your response. I tried to use it as input but still I could not
>> get it to work. Please see below:
>> 
>> Test#1- In this I used -i "0" and the terminal got frozen after I ran the
>> command. I had to force quit the terminal. However the FaceTime camera
>> light was on when I ran the command but  nothing was captured. Command and
>> the output is given below.
>> 
>> $ ffmpeg -f avfoundation -i "0" -r 29.97 -y out.mov
>> 
>> ffmpeg version 2.4.git Copyright (c) 2000-2014 the FFmpeg developers
>>  built on Sep 17 2014 18:11:13 with Apple LLVM version 5.1
>> (clang-503.0.40) (based on LLVM 3.4svn)
>>  configuration: --prefix=/usr/local/ffmpegavpatch
>> --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
>> --enable-shared --enable-pthreads --enable-gpl --enable-version3
>> --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda
>> --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac
>> --enable-libmp3lame --enable-libxvid --enable-libfreetype
>> --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp
>> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc
>> --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger
>> --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg
>> --disable-decoder=jpeg2000
>> --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
>>  libavutil      54.  7.100 / 54.  7.100
>>  libavcodec     56.  1.100 / 56.  1.100
>>  libavformat    56.  4.102 / 56.  4.102
>>  libavdevice    56.  0.100 / 56.  0.100
>>  libavfilter     5.  1.101 /  5.  1.101
>>  libavresample   2.  1.  0 /  2.  1.  0
>>  libswscale      3.  0.100 /  3.  0.100
>>  libswresample   1.  1.100 /  1.  1.100
>>  libpostproc    53.  0.100 / 53.  0.100
>> 
>> (Terminal was frozen and no output messages seen in the terminal)
>> 
>> 
>> Test#2 In this I tried to specify audio and video inputs separately as I
>> do in Windows but I got the error message below.
>> 
>> $ ffmpeg -f avfoundation -i video="FaceTime HD Camera":audio="Built-in
>> Microphone" -r 29.97 -y out.mov
>> 
>>  configuration: --prefix=/usr/local/ffmpegavpatch
>> --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
>> --enable-shared --enable-pthreads --enable-gpl --enable-version3
>> --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda
>> --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac
>> --enable-libmp3lame --enable-libxvid --enable-libfreetype
>> --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp
>> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc
>> --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger
>> --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg
>> --disable-decoder=jpeg2000
>> --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
>>  libavutil      54.  7.100 / 54.  7.100
>>  libavcodec     56.  1.100 / 56.  1.100
>>  libavformat    56.  4.102 / 56.  4.102
>>  libavdevice    56.  0.100 / 56.  0.100
>>  libavfilter     5.  1.101 /  5.  1.101
>>  libavresample   2.  1.  0 /  2.  1.  0
>>  libswscale      3.  0.100 /  3.  0.100
>>  libswresample   1.  1.100 /  1.  1.100
>>  libpostproc    53.  0.100 / 53.  0.100
>> [AVFoundation input device @ 0x7fc133c15700] Video device not found
>> video=FaceTime HD Camera:audio=Built-in Microphone: Input/output error
>> 
>> I also tried $ffmpeg -f avfoundation -i video="FaceTime HD Camera" -i
>> audio="Built-in Microphone" -r 29.97 -y out.mov and I got the same error
>> message as above.
>> 
>> 
>> 
>> Warm Regards
>> Jay
>> 
>> 
>> On Sep 19, 2014, at 9:11 AM, Roger Pack <rogerdpack2 at gmail.com> wrote:
>> 
>>> On Wed, Sep 17, 2014 at 4:43 PM, Jay Muthialu <
>>> jmuthialu-at-yahoo.com at ffmpeg.org> wrote:
>>> 
>>>> Hi Moritz,
>>>> 
>>>> Thanks for the information. I finally applied the patches. Although I
>>>> could not apply through git because the latest ffmpeg version I
>> downloaded
>>>> did not seem to match with the patches in the email and it failed. So I
>> had
>>>> to manually sync the patch file to the source file and I complied
>>>> sucessfully. The patched version works for all basics scenarios  but did
>>>> not fix the underlying issue. It now shows the inbuilt microphone which
>> is
>>>> an improvement, but the microphone is showing as error.
>>>> 
>>>> $ ffmpeg -f avfoundation -list_devices true -i ""
>>>> 
>>>> Output:
>>>> libavutil      54.  7.100 / 54.  7.100
>>>> libavcodec     56.  1.100 / 56.  1.100
>>>> libavformat    56.  4.102 / 56.  4.102
>>>> libavdevice    56.  0.100 / 56.  0.100
>>>> libavfilter     5.  1.101 /  5.  1.101
>>>> libavresample   2.  1.  0 /  2.  1.  0
>>>> libswscale      3.  0.100 /  3.  0.100
>>>> libswresample   1.  1.100 /  1.  1.100
>>>> libpostproc    53.  0.100 / 53.  0.100
>>>> [AVFoundation input device @ 0x7ff6c0c14de0] AVFoundation video devices:
>>>> [AVFoundation input device @ 0x7ff6c0c14de0] [0] FaceTime HD Camera
>>>> [AVFoundation input device @ 0x7ff6c0c14de0] AVFoundation audio devices:
>>>> [AVFoundation input device @ 0x7ff6c0c14de0] [0] Built-in Microphone
>>>> : Input/output error
>>>> 
>>>> Can you or anyone help me on this? Please note that I have applied all
>> the
>>>> 5 patches in the thread given below.
>>>> 
>>> 
>>> What if you try and use it as input?
>>> 
>>> 
>>>> 
>>>> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2014-April/156866.html
>>>> 
>>>> These patches only modified one file "avfoundation.m". I have attached
>> the
>>>> patched avfoundation.m for reference purpose.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Warm Regards
>>>> Jay
>>>> 
>>>> On Sep 8, 2014, at 3:52 AM, Moritz Barsnick <barsnick at gmx.net> wrote:
>>>> 
>>>>> Hi Jay,
>>>>> [oops, sent too early]
>>>>> 
>>>>> On Sun, Sep 07, 2014 at 12:01:25 -0400, Jay Muthialu wrote:
>>>>> 
>>>>>> I went through all the patches specified in the link but I am not
>>>>>> sure how to apply the patches. Could you please guide me on how to
>>>>>> apply the patches and also what would be command I would have to use
>>>>>> to take audio input ? Please note that I originally installed ffmpeg
>>>>>> using Homebrew.
>>>>> 
>>>>> You would need to compile yourself. Instructions are here:
>>>>> 
>>>>> https://trac.ffmpeg.org/wiki/CompilationGuide/MacOSX
>>>>> 
>>>>> I don't know how Homebrew works. To apply the patches, you would need
>>>>> to grab the patch files from the emails, i.e. sections like this:
>>>>> 
>>>>> diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
>>>>> index 3622be0..2ac1b3c 100644
>>>>> --- a/libavdevice/avfoundation.m
>>>>> +++ b/libavdevice/avfoundation.m
>>>>> <at>  <at>  -191,7 +191,7  <at>  <at>  static int
>>>>> avf_read_header(AVFormatContext *s)
>>>>>           goto fail;
>>>>>       }
>>>>>   } else {
>>>>> -        video_device = [AVCaptureDevice
>>>>> - defaultDeviceWithMediaType:AVMediaTypeMuxed];
>>>>> +        video_device = [AVCaptureDevice
>>>>> - defaultDeviceWithMediaType:AVMediaTypeVideo];
>>>>>   }
>>>>> 
>>>>>   // Video capture device not found, looking for AVMediaTypeVideo
>>>>> --
>>>>> 1.8.3.2
>>>>> 
>>>>> (I don't know where to get the proper ASCII versions of these patches)
>>>>> and apply each of them with
>>>>> patch -p1 -i <patchfilename>
>>>>> 
>>>>> before the configure of make stage. As said, I have no idea how to
>>>>> interrupt homebrew stages.
>>>>> 
>>>>> Moritz
>>>>> _______________________________________________
>>>>> ffmpeg-user mailing list
>>>>> ffmpeg-user at ffmpeg.org
>>>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>> 
>>>> 
>>>> _______________________________________________
>>>> ffmpeg-user mailing list
>>>> ffmpeg-user at ffmpeg.org
>>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>> 
>>>> 
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> ffmpeg-user at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> 
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> 
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list