title: How to access builtin webcam from a docker container using ffmpeg?
body: <p>I have wrote my code that captures videos by my builtin webcam of my MAC using <code>ffmpeg</code>.
  <br> On local machine, the code works fine. However, I built a docker container of my code, and tried to run it, but I got the following error:</p>
  <pre><code>error: Command failed: ffmpeg -f avfoundation -framerate 30 -i &quot;0&quot; -target pal-vcd -vf scale=640x480 -flags +global_header -f segment -segment_time 10 -segment_list ../out.csv -segment_format_options movflags=+faststart -reset_timestamps 1 -strftime 1 %Y%m%d-%H%M%S.mp4
  ffmpeg version git-2016-05-25-9591ca7 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
    configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-openssl
    libavutil      55. 24.100 / 55. 24.100
    libavcodec     57. 43.100 / 57. 43.100
    libavformat    57. 37.100 / 57. 37.100
    libavdevice    57.  0.101 / 57.  0.101
    libavfilter     6. 46.100 /  6. 46.100
    libswscale      4.  1.100 /  4.  1.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
  Unknown input format: 'avfoundation'
  </code></pre>
  <ol>
  <li>as far as what I understood from this log, is that the docker
  container doesn't have access to local devices.  <br> According to
  this discussion <a href="https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device">Docker - a way to give access to a host USB or
  serial device? </a>, I need to use the <code>--device</code> flag to pass my
  device's location.  <br> However, according to <a href="https://apple.stackexchange.com/a/16910/291670">this answer</a>,
  that is not possible?</li>
  <li>In addition to what I've mentioned
  above, I couldn't get my webcam's path at the first place. <a href="https://stackoverflow.com/q/49461222/6203203">what is
  a correct path for macbook webcam</a></li>
  </ol>
  <p>My question is: How to access my MAC's builtin camera to record from a docker container?</p>