First of all, visit the FreeBSD WebcamCompat page to check that your TV Tuner device is supported. Most popular webcams are compatible. Then follow the instructions on this page to install the webcamd
program.
In some fewer cases, you may own a compatible PCI card, which is recognised by the system as a native PCI device. Those devices need their own special kernel module, and do not use webcamd at all. For example the Hauppauge WinTV HVR-4000. Which require the cx88 kernel modules to be loaded. You will instead need to follow the steps here for installing the cx88 device driver.
Most of these commands can just be copy-pasted. The webcamd program must be installed directly in Finch's chroot. This is because webcamd needs to create new device nodes e.g. /dev/dvb, etc. in '/dev/'. Such special files require 'mknod' cmd. That can't be created in a jail.
Update finch to version 1.27 or newer.
# Finch users should first update to get the latest fixes
[ "$(echo "$(finch --shortver) >= 1.27" | bc)" = 1 ] || sudo finch update -y
# Enter the finch chroot environment, as root
sudo finch chroot
# Update local pkgng database, to avoid 'failed checksum' for 'pkg install'
pkg update -f
# Download the cuse4bsd kernel module from pkgng
ASSUME_ALWAYS_YES="yes" pkg install "cuse4bsd-kmod"
# Finch users: Configure kldload to start cuse4bsd kernel module on boot up
# (other users should edit their loader.conf file instead).
sysrc "kldload_modules=$(sysrc -n kldload_modules 2&> /dev/null) cuse4bsd"
# Enable, start kldload system service
sysrc "kldload_enable=YES"
service "kldload" start
# Build webcamd from ports (to avoid HAL dependancy)
cd /usr/ports/multimedia/webcamd && BATCH=YES make "WITHOUT=HAL" "WITH=VT_CLIENT VT_SERVER" install clean
# Replace the webcamd rc.d script with this improved version
fetch -q -o - "https://gist.githubusercontent.com/dreamcat4/3518679d6acf46d2ea41/raw/0f730e04363eac806af18adfa08bf34870f501d1/webcamd" > /usr/local/etc/rc.d/webcamd
# Make sure it is executable
chmod +x /usr/local/etc/rc.d/webcamd
# Identify your TV Tuner device in the list of attached USB devices
usbconfig
# Check compatibility @ https://wiki.freebsd.org/WebcamCompat
# Look for it's firmware file @ http://linuxtv.org/downloads/firmware/
# If necessary, download your TV Tuner's firmware file from the web
# cd /boot/modules/ && fetch http://linuxtv.org/downloads/firmware/dvb-usb-dib0700-1.20.fw
# Find the USB device name. In this example, it is "SCEH-0036 SONY"
freenas // root^> usbconfig | grep -i sony
ugen7.3: <SCEH-0036 SONY> at usbus7, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
# Test that webcamd recognizes your TV Tuner, and will create /dev/dvb/ device nodes
freenas webcamd/ root^> webcamd -d 7.3
Attached to ugen7.3[0]
Creating /dev/dvb/adapter0/demux0
Creating /dev/dvb/adapter1/demux0
Creating /dev/dvb/adapter0/dvr0
Creating /dev/dvb/adapter1/dvr0
Creating /dev/dvb/adapter0/frontend0
Creating /dev/dvb/adapter1/frontend0
Creating /dev/input/event0
^C
# Webcamd won't start unless you tell it which USB devices to connect to
sysrc "webcamd_device_0_name=SCEH-0036 SONY"
# For more ways to configure webcamd, please see the comments in the rc.d script
head -72 /usr/local/etc/rc.d/webcamd
# Enable the webcamd system service
sysrc "webcamd_enable=YES"
service "webcamd" start
# Check that webcamd comes up automatically during system startup
reboot
ls -lsa /dev/