<commit_before>### picam

#### Features

- Capture video from Raspberry Pi Camera (up to 720p) and encode it to H.264 using hardware encoder
- Capture audio from USB microphone via ALSA and encode it to AAC-LC using libavcodec (FFmpeg)
- Record to an MPEG-TS file
- Generate files for HTTP Live Streaming with optional encryption
- If USB microphone is not available, it only records the video


### Required hardware

- Raspberry Pi
- Raspberry Pi Camera Board
- USB microphone (see [Recommended hardware](#recommended-hardware))


### Installation

#### Install libraries

Build and install these libraries on a Raspberry Pi (Raspbian):

- [alsa-lib](http://www.alsa-project.org/main/index.php/Main_Page)
- [fdk-aac](http://sourceforge.net/projects/opencore-amr/)
- [FFmpeg](http://www.ffmpeg.org/) with "--enable-libfdk-aac" configure option

The output of `ffmpeg -codecs | grep aac` should contain the following line:

     DEA.L. aac                  AAC (Advanced Audio Coding) (decoders: aac libfdk_aac ) (encoders: aac libfdk_aac )

#### Compile libilclient

On a Raspberry Pi, issue the following command:

    $ cd /opt/vc/src/hello_pi/libs/ilclient
    $ make

#### Compile picam

    $ git clone https://github.com/iizukanao/picam.git
    $ cd picam
    $ make

If you want to save some disk space, run:

    $ strip picam


### Usage

picam command continuously reads video from Raspberry Pi Camera and audio from ALSA.

    $ ./picam
    video_width=1280
    video_height=720
    video_fps=30.0
    gop_size=30
    video_bitrate=2000000
    alsa_dev=hw:0,0
    audio_sample_rate=48000
    audio_bitrate=40000
    audio_volume_multiply=1.000000
    is_hlsout_enabled=0<commit_msg>README: Add support for Arch Linux<commit_after>### picam

#### Features

- Capture video from Raspberry Pi Camera (up to 720p) and encode it to H.264 using hardware encoder
- Capture audio from USB microphone via ALSA and encode it to AAC-LC using libavcodec (FFmpeg)
- Record to an MPEG-TS file
- Generate files for HTTP Live Streaming with optional encryption
- If USB microphone is not available, it only records the video


### Required hardware

- Raspberry Pi
- Raspberry Pi Camera Board
- USB microphone (see [Recommended hardware](#recommended-hardware))


### Supported operating systems

- Raspbian
- Arch Linux


### Installation

#### Install libraries

Build and install these libraries on a Raspberry Pi (Raspbian):

- [alsa-lib](http://www.alsa-project.org/main/index.php/Main_Page)
- [fdk-aac](http://sourceforge.net/projects/opencore-amr/)
- [FFmpeg](http://www.ffmpeg.org/) with "--enable-libfdk-aac" configure option

The output of `ffmpeg -codecs | grep aac` should contain the following line:

     DEA.L. aac                  AAC (Advanced Audio Coding) (decoders: aac libfdk_aac ) (encoders: aac libfdk_aac )

#### Compile libilclient

On a Raspberry Pi, issue the following command:

    $ cd /opt/vc/src/hello_pi/libs/ilclient
    $ make

#### Compile picam

    $ git clone https://github.com/iizukanao/picam.git
    $ cd picam
    $ make

If you want to save some disk space, run:

    $ strip picam

#### Configuration for Arch Linux

You need to have these two lines in /boot/config.txt.

    start_file=start_x.elf
    fixup_file=fixup_x.dat

Also, assign at least 128MB for GPU memory.

    gpu_mem_512=128

Reboot the Raspberry Pi for the changes to take effect.


### Usage

picam command continuously reads video from Raspberry Pi Camera and audio from ALSA.

    $ ./picam
    video_width=1280
    video_height=720
    video_fps=30.0
    gop_size=30
    video_bitrate=2000000
    alsa_dev=hw:0,0
    audio_sample_rate=48000
    audio_bitrate=40000
    audio_volume_multiply=1.000000
    is_hlsout_enabled=0
{'fraction_non_alphanumeric': 0.09207708779443255, 'fraction_numerical': 0.026498929336188436, 'mean_word_length': 3.4861944777911162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6998737', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1199, 'n_words': 392}