libav options

The command line options specified in this section apply only to libav video backend.

To enable the libav backend, pass the codec option the value libav.

To pass one of the following options to an application, prefix the option name with --. If the option requires a value, pass the value immediately after the option name, separated by a single space. If the value contains a space, surround the value in quotes.

Some options have shorthand aliases, for example -h instead of --help. Use these shorthand aliases instead of the full option name to save space and time at the expense of readability.

libav-format

Sets the libav output format. Accepts the following values:

  • mkv encoding

  • mp4 encoding

  • avi encoding

  • h264 streaming

  • mpegts streaming

If you do not provide this option, the file extension passed to the output option determines the file format.

libav-audio

Enables audio recording. When enabled, you must also specify an audio-codec. Does not accept a value.

audio-codec

Default value: aac

Selects an audio codec for output. For a list of available codecs, run ffmpeg -codecs.

audio-bitrate

Sets the bitrate for audio encoding in bits per second. Accepts numeric input.

Example: rpicam-vid --codec libav -o test.mp4 --audio_codec mp2 --audio-bitrate 16384 (Records audio at 16 kilobits/sec with the mp2 codec)

audio-samplerate

Default value: 0

Sets the audio sampling rate in Hz. Accepts numeric input. 0 uses the input sample rate.

audio-device

Select an ALSA input device for audio recording. For a list of available devices, run the following command:

$ pactl list | grep -A2 'Source #' | grep 'Name: '

You should see output similar to the following:

Name: alsa_output.platform-bcm2835_audio.analog-stereo.monitor
Name: alsa_output.platform-fef00700.hdmi.hdmi-stereo.monitor
Name: alsa_output.usb-GN_Netcom_A_S_Jabra_EVOLVE_LINK_000736B1214E0A-00.analog-stereo.monitor
Name: alsa_input.usb-GN_Netcom_A_S_Jabra_EVOLVE_LINK_000736B1214E0A-00.mono-fallback

av-sync

Shifts the audio sample timestamp by a value in microseconds. Accepts positive and negative numeric values.