Skip to content

Instantly share code, notes, and snippets.

@jayendra13
Created May 3, 2023 16:37
Show Gist options
  • Save jayendra13/b0c99ce46cb9086e9046d01afd2412d7 to your computer and use it in GitHub Desktop.
Save jayendra13/b0c99ce46cb9086e9046d01afd2412d7 to your computer and use it in GitHub Desktop.
# sample command to capture camera output, makesure ffmpeg is installed
ffmpeg -f video4linux2 -i /dev/video0 -vframes 1 -video_size 640x480 test.jpeg
# To run the same thing inside the docker image
# run docker in privilaged mode with binding appropriate dirs
docker run --privileged \
--mount type=bind,source=/dev,target=/dev \
--mount type=bind,source=/home/fatlady,target=/root \
--rm -it alpine /bin/sh
# install ffmpeg inside the container
apk add ffmpeg
# run the same command as above to capture the output
ffmpeg -f video4linux2 -i /dev/video0 -vframes 1 -video_size 640x480 test.jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment