Skip to content

Instantly share code, notes, and snippets.

@hardaqa
Forked from brutella/rpi-enable-camera-module.md
Created January 31, 2021 16:30
Show Gist options
  • Save hardaqa/f9237b80127a9e20a0ccce7f95fea9e2 to your computer and use it in GitHub Desktop.
Save hardaqa/f9237b80127a9e20a0ccce7f95fea9e2 to your computer and use it in GitHub Desktop.

Revisions

  1. @brutella brutella revised this gist Aug 9, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion rpi-enable-camera-module.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,10 @@ Load `v4l2loopback` module via
    sudo modprobe v4l2loopback video_nr=1 # creates /dev/video1
    # sudo modprobe v4l2loopback devices=1

    or add `v4l2loopback video_nr=1` to `/etc/modules`.
    If you want to load the module on startup add `v4l2loopback` to `/etc/modules` and the options to `/etc/modprobe.d/v4l2loopback.conf`. https://askubuntu.com/a/822136

    # /etc/modprobe.d/v4l2loopback.conf
    options v4l2loopback video_nr=1

    Then copy the video from `/dev/video0` to `/dev/video1`.

  2. @brutella brutella revised this gist Aug 9, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions rpi-enable-camera-module.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,10 @@ The video device `/dev/video0` can only be accessed by one process at a time. Us
    ## Install v4l2loopback

    # Install kernel headers
    # Note: Kernel headers may not be up-to-date.
    # To downgrade the firmware to a specific firmware use sudo rpi-update <commit hash from https://github.com/Hexxeh/rpi-firmware>
    sudo apt-get install raspberrypi-kernel-headers

    # Download source and install
    git clone https://github.com/umlaeute/v4l2loopback
    cd v4l2loopback
  3. @brutella brutella revised this gist Aug 9, 2018. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions rpi-enable-camera-module.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,16 @@ or add `bcm2835-v4l2` to `/etc/modules`.

    The video device `/dev/video0` can only be accessed by one process at a time. Use a loopback device to allow mutli process access at `/dev/video1`. https://raspberrypi.stackexchange.com/a/19897

    ## Install v4l2loopback

    # Install kernel headers
    sudo apt-get install raspberrypi-kernel-headers
    # Download source and install
    git clone https://github.com/umlaeute/v4l2loopback
    cd v4l2loopback
    make
    sudo make install

    Load `v4l2loopback` module via

    sudo modprobe v4l2loopback video_nr=1 # creates /dev/video1
  4. @brutella brutella revised this gist Aug 9, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion rpi-enable-camera-module.md
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,8 @@ Load `v4l2loopback` module via
    sudo modprobe v4l2loopback video_nr=1 # creates /dev/video1
    # sudo modprobe v4l2loopback devices=1

    or add `v4l2loopback video_nr=1` to `/etc/modules`.
    or add `v4l2loopback video_nr=1` to `/etc/modules`.

    Then copy the video from `/dev/video0` to `/dev/video1`.

    ffmpeg -f video4linux2 -i /dev/video0 -vcodec copy -f v4l2 /dev/video1
  5. @brutella brutella revised this gist Aug 9, 2018. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion rpi-enable-camera-module.md
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,15 @@ Load `bcm2835-v4l2` module

    sudo modprobe bcm2835-v4l2

    or add `bcm2835-v4l2` to `/etc/modules`.
    or add `bcm2835-v4l2` to `/etc/modules`.

    # Create loopback device

    The video device `/dev/video0` can only be accessed by one process at a time. Use a loopback device to allow mutli process access at `/dev/video1`. https://raspberrypi.stackexchange.com/a/19897

    Load `v4l2loopback` module via

    sudo modprobe v4l2loopback video_nr=1 # creates /dev/video1
    # sudo modprobe v4l2loopback devices=1

    or add `v4l2loopback video_nr=1` to `/etc/modules`.
  6. @brutella brutella revised this gist Aug 1, 2018. No changes.
  7. @brutella brutella renamed this gist Aug 1, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @brutella brutella renamed this gist Aug 1, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. @brutella brutella created this gist Aug 1, 2018.
    13 changes: 13 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # Enable camera module

    Edit your /boot/config.txt file and make sure the following lines look like this:

    start_x=1 # essential
    gpu_mem=128 # at least, or maybe more if you wish
    disable_camera_led=1 # optional, if you don't want the led to glow

    Load `bcm2835-v4l2` module

    sudo modprobe bcm2835-v4l2

    or add `bcm2835-v4l2` to `/etc/modules`.