Skip to content

Commit

Permalink
Add FFMPEG entries
Browse files Browse the repository at this point in the history
  • Loading branch information
bwookieeeee committed Aug 31, 2020
1 parent 2243b03 commit 2177cca
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 1 deletion.
13 changes: 13 additions & 0 deletions controller/video/ffmpeg-arecord.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
==============
FFMPEG arecord
==============

Configuration Options
=====================
+------------------+--------------------+------------------------+
|Variable |Default Value |Description |
+==================+====================+========================+
|``arecord_path`` |``/usr/bin/arecord``|Full path to ``arecord``|
+------------------+--------------------+------------------------+
|``arecord_format``|``S16_LE`` |Audio format |
+------------------+--------------------+------------------------+
80 changes: 80 additions & 0 deletions controller/video/ffmpeg-on-macos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
===============
FFMPEG on MacOS
===============

FFMPEG can run on MacOS with AVFoundation software provided in the operating
system.

Installation
============
Homebrew
--------
Installing FFMPEG via `homebrew <https://brew.sh>`_ is the easiest way if you
have administrator access.
#. Install Homebrew ::

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

.. note:: You may need to reboot after installation finishes.

#. Install FFMPEG ::

brew install ffmpeg


Changes to `controller.conf`
============================

.. code-block:: python
[camera]
type = ffmpeg
camera_device = "YourCameraDeviceOrNumber"
mic_device = "YourMicDeviceOrNumber"
[ffmpeg]
ffmpeg_location = /usr/local/bin/ffmpeg
audio_input_format = avfoundation
video_input_format = avfoundation
Your device id's can be gotten from running ::

ffmpeg -f avfoundation -list_devices true -i ""


You'll get an output similar to

.. code-block:: bash
[AVFoundation input device @ 0x7ff8e171e580] AVFoundation video devices:
[AVFoundation input device @ 0x7ff8e171e580] [0] FaceTime HD Camera (Built-in)
[AVFoundation input device @ 0x7ff8e171e580] [1] Capture screen 0
[AVFoundation input device @ 0x7ff8e171e580] [2] Capture screen 1
[AVFoundation input device @ 0x7ff8e171e580] AVFoundation audio devices:
[AVFoundation input device @ 0x7ff8e171e580] [0] Built-in Microphone
[AVFoundation input device @ 0x7ff8e171e580] [1] Built-in Input
In my case I want to use the FaceTime HD Camera and the Built-in Microphone so
I can choose the following:

* video
* ``"0"``
* ``"FaceTime"``
* ``"FaceTime HD Camera (Built-in)"``
* ``"default"``
* audio
* ``":0"``
* ``":Built-in Microphone"``
* ``":default"``
* The colon (``:``) before every item is very important because that's how
AVFoundation differentiates between a camera and a microphone. If you
don't get any sound or have errors relating to audio in your console,
check that you have a colon before the device in your conf file.

Note that I can't use the first word of the device name because there's another
device that shares the same name (``Built-in``).

The name ``default`` means that it will pick the first item in the list ``"0"``.

50 changes: 50 additions & 0 deletions controller/video/ffmpeg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
======
FFMPEG
======

Configuration Options
=====================

+------------------------+-----------------------+-----------------------------+
|Variable |Default Value |Description |
+========================+=======================+=============================+
|``ffmpeg_location`` |``/usr/bin/ffmpeg`` |Full path to the location of |
| | |FFMPEG. |
+------------------------+-----------------------+-----------------------------+
|``v4l2-ctl_location`` |``/usr/bin/v4l2-ctl`` |Full path to the location of |
| | |``v4l2-ctl`` |
+------------------------+-----------------------+-----------------------------+
|``audio_codec`` |``mp2`` |Audio codec FFMPEG should |
| | |use. Only ``mp2`` is |
| | |supported but ``twolame`` |
| | |will work when compiled into |
| | |FFMPEG. |
+------------------------+-----------------------+-----------------------------+
|``audio_channels`` |``1`` |Audio channels, 1 for mono, |
| | |2 for stereo. |
+------------------------+-----------------------+-----------------------------+
|``audio_bitrate`` |``32`` |Bitrate for the audio stream |
| | |in kilobits |
+------------------------+-----------------------+-----------------------------+
|``audio_sample_rate`` |``44100`` |sample rate for the audio in |
| | |hertz |
+------------------------+-----------------------+-----------------------------+
|``video_codec`` |``mpeg1video`` |Video codec FFMPEG should |
| | |use. Currently only |
| | |``mpeg1video`` is supported. |
+------------------------+-----------------------+-----------------------------+
|``video_bitrate`` |``350`` |Bitrate for the video stream |
| | |in kilobits |
+------------------------+-----------------------+-----------------------------+
|``audio_input_format`` |``alsa`` | |
+------------------------+-----------------------+-----------------------------+
|``audio_input_options`` | |Leave this blank if |
| | |``audio_input_format`` is |
| | |``alsa`` |
+------------------------+-----------------------+-----------------------------+
|``audio_output_options``|``-nostats`` | |
+------------------------+-----------------------+-----------------------------+
|``video_output_format`` |``v4l2`` | |
+------------------------+-----------------------+-----------------------------+
|``video_output_options``|``-nostats -threads 2``| |
+------------------------+-----------------------+-----------------------------+
9 changes: 8 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ Welcome to Remo's documentation!
:caption: Controller - TTS
:glob:

controller/tts/*
controller/tts/*

.. toctree::
:maxdepth: 2
:caption: Controller - Video
:glob:

controller/video/*

0 comments on commit 2177cca

Please sign in to comment.