wyatt8740

ffmpeg video capture usb example

May 15th, 2017
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #! /bin/bash
  2. # run as:
  3. #   capture.sh /dev/video0 hw:2,0 output.mkv
  4. # Be sure pulseaudio is dead if this isn't working.
  5. VIDEO_DEVICE="$1"
  6. AUDIO_DEVICE="$2"
  7. OUTPUT_FILE="$3"
  8. v4l2-ctl --device "$VIDEO_DEVICE" --set-fmt-video=width=640,height=480
  9. ffmpeg -f v4l2 -i "$VIDEO_DEVICE" -f alsa -i "$AUDIO_DEVICE" -vcodec libx264 -crf 22 -acodec libfdk_aac -ab 128k "$OUTPUT_FILE"
Advertisement
Add Comment
Please, Sign In to add comment