当前位置: 首页>>技术问答>>正文


什么比奶酪更适合拍摄视频?

ubuntuer 技术问答 , , , , 去评论

问题描述

我需要从我的网络摄像头录制一些视频,而在Cheese工作时,它缺少设置,只输出充满口吃等的webm格式。

似乎找不到任何替代方案……

最佳解决办法

Guvcview旨在提供一个简单的GTK界面,用于从Linux UVC驱动程序支持的设备捕获和查看视频,但它也适用于任何v4l2兼容设备。

该项目基于luvcview进行视频渲染,但所有控件都是使用GTK2界面构建的。

Guvcview(从版本0.9.9开始)有一个仅控制窗口,(来自控制台:guvcview --control_only),这允许对其他应用程序进行图像控制,如ekiga,cheese,mplayer,skype ……

音频。

Guvcview音频支持基于portaudio库,直到版本0.9.3,阻塞API用于音频捕获,因为版本0.9.4使用了回调方法,这提供了更好的性能,它也是portaudio API。

portaudio支持的所有接口(ALSA,OSD,JACK,…)都应该在guvcview中可用。只需确保在启用所需接口的情况下编译portaudio。

UVC动态控件。

Linux UVC驱动程序具有扩展控件的实现(这些是供应商特定的控件,在UVC规范中受支持。),它们被称为动态控件,因为它们必须动态加载到驱动程序中。

直到今天,只有罗技为他们的UVC网络摄像头扩展控件提供了规格,guvcview支持这些规范。

在新的驱动程序修订版中,为了将这些控件添加到驱动程序,需要管理员权限,因此基本上有两个解决方案:

  1. 每个会话至少以root身份(使用sudo)启动guvcview一次,自版本1.2.0起,您可以使用选项--add_ctrls执行此操作,从而无需完全启动guvcview

  2. 安装libwebcam这个软件有一个udev脚本,应该为您的罗技相机添加必要的控件。

通过ppa将Guvcview安装到Ubuntu 12.04

sudo add-apt-repository ppa:pj-assis/ppa
sudo apt-get update
sudo apt-get install guvcview

次佳解决办法

如果你需要一个新的应用程序,guvcview是好的。

video,webcam,cheese,video-recording,ubuntu

https://launchpad.net/guvcview

第三种解决办法

这个问题的部分来自这个问题的答案:Record from VHS tapes

我们需要确保软件正在从正确的设备收集适当的数据。让我们在终端中放一个查询,让我们看看有多少设备连接到您的计算机,可用于收集图像,在终端中使用此命令:

ls -l /dev/video*

结果应该是这样的:

geppettvs@DYLAN:~$ ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 2012-04-17 19:53 /dev/video0
crw-rw----+ 1 root video 81, 1 2012-04-17 19:53 /dev/video1
crw-rw----+ 1 root video 81, 2 2012-04-18 17:54 /dev/video2
geppettvs@DYLAN:~$ 

在我的情况下,我有3个视频设备,其中一个是我用于观看/录制直播电视节目/VTR /VCR /RF-DVD /视频转换器和其他RF信号的USB电视调谐器。

其他设备是USB网络摄像头连接到计算机上的USB插槽。

如果您的网络摄像头配有麦克风,则可以使用tvcap-script by Andreas Schalk录制音频和视频,为方便起见,我将这些代码放在此处:

#!/bin/bash
#
#  tvcap-script by Andreas Schalk, easycap.blogspot.com (Dec. 2011)
#  This script is based an a template TV-script from Jose Catre-Vandis (Jan 2006).
#  The ascii artwork is based on a template i found here: http://www.retrojunkie.com/asciiart/electron/tv.txt
#  Contact: easycapdc60-blogspot@yahoo.de
#-----------------------------------------------------------------------------
#
#  FUNCTION: This script provides Zenity menues for viewing an capturing video with a tv-card on Linux.
#
#  Supported programs: MPlayer, MEncoder, VLC, Tvtime, Cheese und Sox
# 
#-----------------------------------------------------------------------------
#  
#  Basic options:
#
#  Change the following parameters for viewing/ capturing according to your needs
#
#-----------------------------------------------------------------------------
VERBOSE=1   # if '0', this script does not show messages window and does not ask for norm and input number anymore
NORM="PAL"  # preselect tv norm 'PAL' or 'NTSC'
INPUT_NR=0      # preselect input number of your easycap where video source is plugged in
input_width=720     # preselect width an height of video source (mplayer, vlc, mencoder)
input_height=576    # other possible combinations: 640/480; 320/240 
ASPECT=169          # '169' (16:9) or '43' (4:3); this value affects video playback with mplayer or vlc only!
FREQ="48000"        # on soundproblems reduce audio frequency (44100 oder 32000 oder 8000)
TV_INPUT="no"       # if 'yes' the analogue antenna input of the tv-card will be used (mplayer only)
CHAN="chanlist=europe-west:channel=60"      # channel setting (nur mplayer/ mencoder) the analogue antenna input of the tv-card is used
NORM="PAL"          # preselect TV-norm 'PAL' oder 'NTSC'
INPUT_NR=1          # preselct the Input on the TV-card, where the videosource is plugged in ('0' normally is the antenna, '1' the first CVBS ...
#-----------------------------------------------------------------------------

MESSAGE=()
R_MESSAGE=()
EXITCODE=0

#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#   test videodevices
##-----------------------------------------------------------------------------

declare -a VIDEO_DEV

VIDEO_DEV=( TRUE    none
            FALSE   none
            FALSE   none
            FALSE   none
            ) 
i1=0;
i2=0;
while `test -e "/dev/video${i1}"`; do
  VIDEO_DEV[$i2+1]="/dev/video${i1}"; 
  i1=$[$i1+1];
  i2=$[$i2+2];
done
if [ "xnone" = "x${VIDEO_DEV[1]}" ]; then 
  zenity  --error --timeout=5 --text "Cannot find /dev/video0!\n Script ends in 5 seconds" --title "No videodevice!";
  exit 1;
fi

if [ "x${VIDEO_DEV[$i2+1]}" = "xnone" ];  then
    VIDEO_DEV[$i2]="" && VIDEO_DEV[$i2+1]="" && VIDEO_DEV[$i2+2]="" && VIDEO_DEV[$i2+3]="" && VIDEO_DEV[$i2+4]="" && VIDEO_DEV[$i2+5]="";
fi

DEV_VIDEO=$(zenity --list --text "Select videodevice" --radiolist --column "Choice" --column "Device" ${VIDEO_DEV[@]}) || exit 0 

if [ ${VERBOSE} = 1 ]; then
#-----------------------------------------------------------------------------
#  select TV norm
#-----------------------------------------------------------------------------
title="Select tv norm"
NORM=`zenity --title="$title" --list --radiolist --column="Choice" \
    --column="Norm" --column="Description" \
    TRUE "PAL" "PAL Norm" \
    FALSE "NTSC" "NTSC Norm" \
    ` || exit 0 
fi
#-----------------------------------------------------------------------------
#  select Input number
#-----------------------------------------------------------------------------
title="Select Input NR"
INPUT_NR=`zenity --title="$title" --list --radiolist --column="Choice" \
    --column="Input NR" --column="Description" \
    TRUE "0" "Input 1 (TV)" \
    FALSE "1" "Input 2" \
    FALSE "2" "Input 3" \
    FALSE "3" "Input 4" \
    FALSE "4" "Input 5" \
    FALSE "5" "Input 6"
    ` || exit 0 
#-----------------------------------------------------------------------------


#-----------------------------------------------------------------------------
#  Check if snd_usb_audio module is loaded
#-----------------------------------------------------------------------------
SND_USB=`lsmod | grep snd_usb_audio | wc -l`
if  [ "${SND_USB}" -ge "1" ]; then
#  MESSAGE=("${MESSAGE[@]}" "\nNOTE: snd_usb_audio module was loaded and may conflict with your USB capture device")
   zenity  --info --text "NOTE: The snd_usb_audio module was loaded\nand may conflict with your USB capture device.\n \nIf sound problems appear,\nplug out your USB capturedevice and run\n rmmod snd_usb_audio \nas root in the terminal!" --title "Snd_usb_audio module loaded!"
fi

#-----------------------------------------------------------------------------
# test and select soundcard
#-----------------------------------------------------------------------------

if `test ! -e /dev/dsp` && [ -z "`ls -1 /proc/asound`" ]; then
    if_audio="no";
    echo "No soundcard detected";
    MESSAGE=("${MESSAGE[@]}" "Note: No soundcard can be found!\nSound is not supported.\n");
else
if_audio="yes"
declare -a SOUND_DEV

SOUND_DEV=( FALSE   /dev/dsp    OSS
            FALSE   card1   ALSA    
            TRUE    card2   ALSA
            FALSE   card3   ALSA
            ) 

test ! -e /dev/dsp && echo "No dsp" && SOUND_DEV[0]="" && SOUND_DEV[1]="" && SOUND_DEV[2]=""

ALSA_CARD=$(cat /proc/asound/cards | cut -d":" -f1 -s)
declare -a ALSA_CARDS
ALSA_CARDS=(${ALSA_CARD})

i5=1
for P in ${ALSA_CARDS[@]}; do
    ALSA_NAME=$(echo ${ALSA_CARDS[$i5]} | tr -d [=[=] );
    SOUND_DEV[$i5+3]=$ALSA_NAME
    if [ "x${ALSA_NAME}" = "x" ];  then
    SOUND_DEV[$i5+2]="" && SOUND_DEV[$i5+3]="" && SOUND_DEV[$i5+4]=""
    fi
    i5=$[$i5+3];
done
fi

DEV_AUDIO=$(zenity --list --text "Select soundcard" --radiolist --column "Choice" --column "Device" --column "Type" ${SOUND_DEV[@]}) || exit 0 

if [ $DEV_AUDIO = "/dev/dsp" ]; then 
    AUDIO_TYPE="oss"
    else
    AUDIO_TYPE="alsa"
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#   test, if devicenodes are read- and writable for unprivileged users
#-----------------------------------------------------------------------------

if [ -r ${DEV_VIDEO} ] && [ -w ${DEV_VIDEO} ]; then
MESSAGE=("${MESSAGE[@]}" "\nSUCCESS! ${DEV_VIDEO} is read- and writable!\n")
elif [ -e ${DEV_VIDEO} ]; then
zenity --info --text "Cannot access ${DEV_VIDEO}!\nRun 'sudo chmod a+rw ${DEV_VIDEO}'\nin the terminal!" --title "Message"
EXITCODE=1
fi

    if [ -r ${DEV_AUDIO} ] && [ -w ${DEV_AUDIO} ]; then
    MESSAGE=("${MESSAGE[@]}" "\nSUCCESS! ${DEV_AUDIO} is read- and writable!")
    elif [ -e ${DEV_AUDIO} ]; then
    zenity --info --text "\nCannot access ${DEV_AUDIO}!\nRun 'sudo chmod a+rw ${DEV_AUDIO}'\nin the terminal!" --title "Message"
    MESSAGE=("${MESSAGE[@]}" "\n\nCannot access ${DEV_AUDIO}!\nRun 'sudo chmod a+rw ${DEV_AUDIO}'\nin the terminal!!")
    if_audio="no"
    fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  find executable programs
#-----------------------------------------------------------------------------
PROG_LIST=( TRUE    vlc     #
            FALSE   mplayer     #
            FALSE   cheese      #
            FALSE   tvtime      #
            FALSE   mencoder    #
            FALSE   sox         #
            ) 

PROGS=(vlc mplayer cheese tvtime mencoder sox)
i4=0
for P in ${PROGS[@]}; do
            PROG=`which $P`
            if [ "x" = "x${PROG}" ] || [ ! -x ${PROG} ]; then
            echo "Cannot find or execute $P. Is t installed?"
            MESSAGE=("${MESSAGE[@]}" "\nCannot find or execute $P. Is it installed?")
            PROG_LIST[$i4]=""
            PROG_LIST[$i4+1]=""
                if [ "${PROG_LIST[11]}" = "" ]; then
                echo "Sox is needed for sound with tvtime!"
                MESSAGE=("${MESSAGE[@]}" "\nSox is needed for sound with tvtime!")
                fi          
            fi
            i4=$i4+2
done
PROG_LIST[10]=""        # Sox does not show up on list
PROG_LIST[11]=""        #
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  messages are displayed and script ends
#-----------------------------------------------------------------------------
if [ ${EXITCODE} = 1 ]; then
    MESSAGE=("${MESSAGE[@]}" "\nScript ends")
fi
echo ${MESSAGE[*]}
#########################
if [ ${VERBOSE} = 1 ]; then
zenity --height="50" --info --text "${MESSAGE[*]}" --title "Messages"
fi

if [ ${EXITCODE} = 1 ]; then
    exit 1
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  create logfile
#-----------------------------------------------------------------------------
LOGFILE="./test`echo "${DEV_VIDEO}" | sed -e "s,/dev/,," - `.log"

# echo "Log file is:  ${LOGFILE}"
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  zenity list - program choice
#-----------------------------------------------------------------------------

view_cap=$(zenity --list --width=250 --height=400 --text "  ___________\n |  .----------.  o|\n | |   Easy  | o|\n | |   CAP_  | o|\n |_\`-----------´ _|\n   ´\`          ´\`\\nTv-norm: $NORM  Input-Nr:$INPUT_NR\nVideodevice: $DEV_VIDEO $input_width x $input_height \nAudiodevice: $AUDIO_TYPE $DEV_AUDIO $FREQ Hz\nIs audio on? $if_audio\nLogfile: $LOGFILE " --radiolist --column "Choice" --column "program" ${PROG_LIST[@]}) || exit 0

#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  mplayer command
#-----------------------------------------------------------------------------
if [ "alsa" = "${AUDIO_TYPE}" ]; then
M_AUDIO="buffersize=16:alsa:amode=1:forcechan=2:audiorate=${FREQ}:adevice=plughw.${DEV_AUDIO}"
elif [ "oss" = "${AUDIO_TYPE}" ]; then
M_AUDIO="adevice=${DEV_AUDIO}"
fi

if [ "$NORM" = "PAL" ]; then
    fps_count=25
else 
    fps_count=30
fi

if [ "$ASPECT" = 169 ]; then
    M_ASPECT="-aspect 1.78"
#   elif [ "$ASPECT" = 43 ]; then
#   M_ASPECT="-aspect 1"
    else
    M_ASPECT=""
    fi

if [ "yes" = "${TV_INPUT}" ]; then
M_VIDEO="${CHAN}"
elif [ "no" = "${TV_INPUT}" ]; then
M_VIDEO="norm=${NORM}:width=${input_width}:height=${input_height}:outfmt=uyvy:device=${DEV_VIDEO}:input=${INPUT_NR}:fps=${fps_count}"
fi

#echo $M_VIDEO
#echo $M_AUDIO
#echo $view_cap

if [ "mplayer" = "${view_cap}" ]; then


if [ "$if_audio" = "yes" ]; then    
1>${LOGFILE} 2>&1 \
mplayer tv:// -tv driver=v4l2:${M_VIDEO}:${M_AUDIO}:forceaudio:immediatemode=0 -hardframedrop ${M_ASPECT} -ao sdl, ${AUDIO_TYPE} -msglevel all=9

elif [ "$if_audio" = "no" ]; then
1>${LOGFILE} 2>&1 \
mplayer tv:// -tv driver=v4l2:${M_VIDEO} -hardframedrop ${M_ASPECT} -msglevel all=9 -nosound
fi
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  vlc command
#-----------------------------------------------------------------------------
if [ "vlc" = "${view_cap}" ]; then

    if [ "alsa" = "${AUDIO_TYPE}" ]; then
    V_AUDIO="//plughw:${DEV_AUDIO}"
    elif [ "oss" = "${AUDIO_TYPE}" ]; then
    V_AUDIO="//${DEV_AUDIO}"
    fi

    if [ "$NORM" = "PAL" ]; then
    V_NORM="pal"
    elif [ "$NORM" = "NTSC" ]; then
    V_NORM="ntsc"
    fi

    if [ "$ASPECT" = 169 ]; then
    V_ASPECT="--aspect-ratio=16:9"
    elif [ "$ASPECT" = 43 ]; then
    V_ASPECT="--aspect-ratio=4:3"
    else
    V_ASPECT=""
    fi

1>${LOGFILE} 2>&1 \
vlc -vvv v4l2://${DEV_VIDEO}:input=${INPUT_NR}:width=$input_width:height=$input_height:norm=${V_NORM} ${V_ASPECT} :input-slave=${AUDIO_TYPE}:${V_AUDIO} --demux rawvideo 
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  tvtime command
#-----------------------------------------------------------------------------
if [ "tvtime" = "${view_cap}" ]; then
    if [ "alsa" = "${AUDIO_TYPE}" ]; then
    T_AUDIO="-t alsa plughw:${DEV_AUDIO} -s2 -c 2 -r ${FREQ} -s2 -t alsa default"
    elif [ "oss" = "${AUDIO_TYPE}" ]; then
    T_AUDIO="-t raw -s2 ${DEV_AUDIO} -c 2 -r ${FREQ} -s2 -t ossdsp /dev/dsp"
    fi
echo $T_AUDIO
1>${LOGFILE} 2>&1 \
>./tvtime.err
(tvtime -d ${DEV_VIDEO} -i 0 -n "${NORM}" 1>/dev/null 2>>./tvtime.err) &
rc=1
while [ 0 -ne ${rc} ];
do
  tvtime-command run_command "(sox -c 2 -r ${FREQ} ${T_AUDIO} 1>/dev/null 2>>./tvtime.err)" 1>/dev/null 2>>./tvtime.err
  rc=$?
  if [ 0 -eq ${rc} ]; then break; fi
  sleep 0.5
done
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  cheese command
#-----------------------------------------------------------------------------
if [ "cheese" = "${view_cap}" ]; then
1>${LOGFILE} 2>&1 \
cheese
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  mencoder command - recording section
#-----------------------------------------------------------------------------

if [ "mencoder" = "${view_cap}" ]; then

#Auswahl des Seitenverhältnisses der Aufnahme?
title="Chose aspect of your target file!"
aspect_type=`zenity  --width="400" --height="220" --title="$title" --list --radiolist --column="Click Here" \
    --column="choice" --column="source >> target" \
    TRUE "1" "4:3 > 4:3"\
    FALSE "2" "4:3 > scale=16:9" \
    FALSE "3" "4:3 > crop borders=16:9" \
    ` || exit 0 

if [ "$aspect_type" = "1" ]; then
    crop_scale="scale=640:480"
elif [ "$aspect_type" = "2" ]; then
    crop_scale="scale=720:406"
elif [ "$aspect_type" = "3" ]; then
    crop_scale="crop=720:406:0:72"
fi  

#################################################################################
#Quality?
title="What quality do you want to record at ?"
qual_type=`zenity  --width="380" --height="380" --title="$title" --list --radiolist --column="Click Here" \
    --column="Record Time" --column="Description" \
    FALSE "500" "Passable Quality"\
    FALSE "900" "OK Quality"\
    FALSE "1100" "VHS Quality"\
    TRUE "1300" "SVHS Quality"\
    FALSE "1500" "VCD Quality"\
    FALSE "1800" "SVCD Quality" \
    FALSE "2000" "Very Good Quality"\
    FALSE "2500" "High Quality" \
    FALSE "3000" "Excellent Quality"\
    ` || exit 0

##################################################################################
#How Long?
title="How long do you want to record for ?"
time_type=`zenity  --width="380" --height="500" --title="$title" --list --radiolist --column="Click Here" \
    --column="Record Time" --column="Description" \
    FALSE "00:00:00" "unlimited"\
    TRUE "00:00:30" "30 seconds for testing"\
    FALSE "00:10:00" "0.2 hours"\
    FALSE "00:30:00" "0.5 hours"\
    FALSE "00:45:00" "0.75 hours"\
    FALSE "01:00:00" "1 hour"\
    FALSE "01:15:00" "1.25 hours"\
    FALSE "01:30:00" "1.5 hours" \
    FALSE "01:45:00" "1.75 hours"\
    FALSE "02:00:00" "2 hours" \
    FALSE "02:15:00" "2.25 hours"\
    FALSE "02:30:00" "2.5 hours" \
    FALSE "02:45:00" "2.75 hours"\
    FALSE "03:00:00" "3 hours" \
    FALSE "03:15:00" "3.25 hours" \
    FALSE "03:30:00" "3.5 hours" \
    ` || exit 0

#M_TIME="-endpos $time_type"

#################################################################################
#user must enter a filename
filedate=$(date +%F_%H:%M-%S)
title="Please enter a filename for your recording, no spaces"
file_name=`zenity  --width="480" --height="150" --title="$title" --file-selection --save --confirm-overwrite --filename="tvcap_$filedate"` || exit 0

###########################################################################################
# summary
R_MESSAGE=("${R_MESSAGE[@]}" "\nRecording options:")
R_MESSAGE=("${R_MESSAGE[@]}" "\nRecording audio: $if_audio")
R_MESSAGE=("${R_MESSAGE[@]}" "\nRecording from Input $INPUT_NR - Norm: $NORM $fps_count fps")
R_MESSAGE=("${R_MESSAGE[@]}" "\nCrop and scale options: $crop_scale")
R_MESSAGE=("${R_MESSAGE[@]}" "\nEncoding quality: $qual_type kb/s")
R_MESSAGE=("${R_MESSAGE[@]}" "\nRecording time:$time_type hours")
R_MESSAGE=("${R_MESSAGE[@]}" "\nFile name: $file_name.avi ")

echo ${R_MESSAGE[*]}

if [ ${VERBOSE} = 1 ]; then
zenity --info --text "${R_MESSAGE[*]}" --title "Recording options"
fi
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
#  mencoder line
#-----------------------------------------------------------------------------
if [ "$if_audio" = "yes" ]; then

zenity --info --title="Start recording with audio" --text="Press OK to start."

mencoder tv:// -tv driver=v4l2:norm=$NORM:width=$input_width:height=$input_height:outfmt=uyvy:device=${DEV_VIDEO}:input=${INPUT_NR}:fps=$fps_count:${M_AUDIO}:forceaudio:immediatemode=0 -msglevel all=9 -ovc lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:mbd=2:turbo:vbitrate=$qual_type:keyint=15 -vf pp=lb,$crop_scale -oac mp3lame -endpos $time_type -o $file_name.avi | tee ${LOGFILE} | zenity --progress --pulsate --auto-close --auto-kill --text="Processing Video - length: $time_type H:M:S" 

zenity --info --title="Job complete" --text="The recording is now complete."


elif [ "$if_audio" = "no" ]; then

zenity --info --title="Start recording without audio" --text="Press ok to start recording"
1>${LOGFILE} 2>&1 \
mencoder tv:// -tv driver=v4l2:norm=$NORM:width=$input_width:height=$input_height:outfmt=uyvy:device=${DEV_VIDEO}:input=${INPUT_NR}:fps=$fps_count -msglevel all=9 -nosound -ovc lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:mbd=2:turbo:vbitrate=$qual_type:keyint=15 -vf pp=lb,$crop_scale -endpos $time_type -o $file_name.avi | tee ${LOGFILE} | zenity --progress --pulsate --auto-close --auto-kill --text="Processing Video - length: $time_type H:M:S" 

zenity --info --title="Job complete" --text="The recording is now complete."

fi

fi
exit 1

只需将所有这些代码复制/粘贴到名为tvcap-script.sh的文件中,授予执行权限并在终端中运行。这个过程非常简单,我将解释如下:

1.-按Enter后,将要求您提供捕获源,并依赖设备的位置(之前测试过),您可以在我的情况下使用-as几个视频源,我正在使用/dev /video2例如,这是指我的USB电视调谐器。请注意,此屏幕截图没有获得窗口装饰器,但可以在那里看到选项和”OK”按钮。

video,webcam,cheese,video-recording,ubuntu

2.-现在我们需要定义规范,在墨西哥我们使用NTSC,除非您希望使用具有方形宽高比的不同标准捕获视频,否则不应使用PAL,这确实会损害您的视频质量。这还取决于你的居住地和国家的标准。

video,webcam,cheese,video-recording,ubuntu

3.-我的电视调谐器有几个输入,你的输入可以有不同的输入,检查输出并运行尽可能多的测试,以确定哪一个最适合你的捕获。我将使用那个指电视的那个。 (输入1(电视))

video,webcam,cheese,video-recording,ubuntu

4.-接下来,如果在声音捕获期间出现问题,您可能(或不会)被警告并提供解决方案(音频和视频将立即被捕获,但如果您的snd_usb_audio模块已经加载,它可能会崩溃音频捕获,从而视频捕获本身)

video,webcam,cheese,video-recording,ubuntu

5.-我的电视调谐器支持多个音频输入,包括与我主板上的嵌入式声音设备集成(通过连接到aux-line的电缆并由混音器控制),您可以检查哪一个最适合您和请记住,默认值通常标记为“最适合您”。

video,webcam,cheese,video-recording,ubuntu

6.-如果一切顺利,你会看到一个小窗口,上面写着如下所示的信息:

“SUCCESS! /dev/video2 is read- and writable!”

单击”OK”继续。

video,webcam,cheese,video-recording,ubuntu

7.-之后,您可以从系统上可用的录制选项列表中进行选择。我已经在下一个屏幕截图中安装了您可以看到的内容。任何人都有效,质量不反映重大变化,但我个人更喜欢mencoder。如果您没有安装任何这些,则应安装它以运行测试。

video,webcam,cheese,video-recording,ubuntu

8.-选择编码软件首选项后(在上一步中),将要求您提供宽高比。如果您没有这方面的经验,请保持原样。它通常默认为更适合您的电视调谐器信号。

video,webcam,cheese,video-recording,ubuntu

9.-根据您选择的宽高比,您将有几个视频质量选项,也基于比特率,下一个窗口中的描述非常具体。请记住:较高的比特率(最佳质量)视频文件大小可能会变得很大。

video,webcam,cheese,video-recording,ubuntu

10.-之后,我们只需要选择我们的视频拍摄时间。有几个预设,我在这个例子中选择了“30秒进行测试”,但您可以选择任意一个,甚至可以选择”unlimited”,以便决定何时停止录制。

video,webcam,cheese,video-recording,ubuntu

11.-接下来,系统会要求您输入一个文件名,默认情况下会提供一个文件名,您可以在此屏幕中进行更改。

video,webcam,cheese,video-recording,ubuntu

12.-系统将提示您在下一个屏幕中检查”Recording options”,只需单击”OK”即可。

video,webcam,cheese,video-recording,ubuntu

13.-再点击一下即可开始。

video,webcam,cheese,video-recording,ubuntu

14.-录制时,终端可能会显示一些活动,以及如下所示的小窗口:

video,webcam,cheese,video-recording,ubuntu

15.-在流程结束时,您将收到一个确认窗口。

video,webcam,cheese,video-recording,ubuntu

而且……就是这样……

您可以随时按ESC取消录制或进程本身,根本不会有任何更改。

在录制结束时,您将在步骤11中选择的位置播放视频,并附带名称为:”testvideo0.log”之类的日志文件。

这是从RF信号电视调谐器编码的最简单方法,在同一文件中收集音频和视频。

我有另一个使用python进程实现的进程,该进程具有GUI,您可以在其中处理几个有用的东西,例如更改频道,运行pre-recording测试甚至记录,但有时它会让我失败。如果您愿意,请告诉我如何与您联系。我不想写羊皮纸或圣经……哈哈!

如果此程序不适用于您的情况,请在删除此答案之前告知我们您的结果,以便提供一些支持。谢谢你然后…

祝好运!

第四种办法

您必须尝试”QtCAM” – 一个免费的开源Linux Webcamera软件,具有10个以上的图像控制设置。

QtCAM image capture settings

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/1727.html,未经允许,请勿转载。