⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spcatools.html

📁 用于LINUX摄像头的相关程序
💻 HTML
📖 第 1 页 / 共 2 页
字号:
you have ask for an yuv420p palette that the stream is converted toa RGB24 before writing in the picture file. To get a picture onlypress key 's' from your keyboard.<P><H2><A NAME="SECTION00034000000000000000">2.4 Can i record video Stream ?</A></H2><P>Sure ,when streaming it is also possible to record the resulting videoin an avi file .We use the great ``avilib'' from Rainer Johanniall the necessary file are include in our package so you have nothingto install .<P><H3><A NAME="SECTION00034100000000000000">2.4.1 What are the suported codec ?</A></H3><P>Some Fourcc are always supported in most Linux or Mac OSX, Windoze,Player The raw jpeg camera can use ``MJPG'' the others have ``I420''for yuv420p palette .<P>because we can also record RGB non standard Fourcc are in use :<P><UL><LI>RGB2 for 16bits stream</LI><LI>RGB3 for 24 bits stream</LI><LI>RGB4 for 32bits stream</LI></UL>asking spcaview to record an avi will automatiquely set the rightfourcc code :<P>spcaview -f yuv -o myavifile.avi start record an avi with I420<P>spcaview -f r16 -o myavifile.avi start record an avi with RBG2<P>spcaview -f r24 -o myavifile.avi start record an avi with RBG3<P>spcaview -f r32 -o myavifile.avi start record an avi with RBG4<P>And the MJPG ?<P><B><I>If your cam are jpeg compatible </I></B><P>spcaview -o myavifile.avi start the record with MJPG<P><H3><A NAME="SECTION00034200000000000000">2.4.2 Is There A Way to Record Raw Data ?</A></H3><P>Sure RawData can be ask to the driver with<P>spcaview -v -o myrawdata.avi<P>That mean the grabber screen will be black but the data are writtingdirectly to the drive and so can be process in a second times withSpcaTools .The fourcc was RAWD of course<P><H3><A NAME="SECTION00034300000000000000">2.4.3 Record avi from RGB or YUV give large file what can we do ?</A></H3><P>Spcaview have a smart compressor that can compress in real times .<P>Differential Pixels Static Huffmann Encoding is GPL and are writtingby Alexander Sikamov (Russian) and me (French)<P>You can expect 50% less in size without any loss in data . The fourccwas DPSH of course .<P>spcaview -z -o myavifile.avi record compressed DPSH yuv stream inan avi<P><H3><A NAME="SECTION00034400000000000000">2.4.4 Is there a way to add sound with video picture ?</A></H3><P>Why not ? Sndlib from Bill Schottstaedt provide a great interfacefor that and is include in the package too so<P>spcaview -a 1 -o myavifile.avi will record an avi in MJPG with soundfrom the microphone .<P>spcaview -a 2 -f yuv -o myavifile.avi will record an avi file in I420with sound from the mixer.<P>Some camera have an Usb Microphone device that will be a good ideaif someone can experiment that :)<P><H1><A NAME="SECTION00040000000000000000">3 Spcaview Player</A></H1><P><H2><A NAME="SECTION00041000000000000000">3.1 Why a new player in Linux world?</A></H2><P>As designed in Spcaview grabbing some video encoding are specific. So we provide a great tools to read the avi get by spcaview grabber.All the Fourcc code from spcaview grabber are supported exept RAWDthat need spcatools to be decoded.<P><H2><A NAME="SECTION00042000000000000000">3.2 What Spcaview Player can do ?</A></H2><P>Play the video stream of course. All the setting are get trought theavi header so we have nothing todo exept looking the SDL output ofyour screen and listen the sound trought your loudspeaker .<P>just use:<P>spcaview -i myavifile.avi<P>tha's all<P><H3><A NAME="SECTION00042100000000000000">3.2.1 Is there a way to play frame by frame ?</A></H3><P>Yes press <P><UL><LI>down key will stop the stream</LI><LI>up key restart the stream</LI><LI>right key go one frame forward</LI><LI>left go one frame backward</LI></UL><P><H3><A NAME="SECTION00042200000000000000">3.2.2 I want a picture ?</A></H3><P>Press the down key to stop the stream select the right one with leftand right then press s <P>a Picture name is build from the avi name and the frame number .ThePicture will be record according your palette Rawjpeg give jpg pictureall the others give pnm 24 Bits<P><H1><A NAME="SECTION00050000000000000000">4 How Spcaview can be installed ?</A></H1><P>Spcaview is an unique package for grabbing or playing, only the commandline argument select the right mode.<P>http://mxhaard.free.fr/download.html<P>Spcaview come with all library exept libsdl and libjpeg you have toinstall first.<P>just type<P>make <P>make install<P>tha's all :)<P>what spcaview can't do ?<P>The Cafe of course .<P><H1><A NAME="SECTION00060000000000000000">5 Spcatools </A></H1><P>Spcatools perform frame analisys from the raw data get with spcaviewgrabber .That way we can in userspace decode the frame extract fromthe avi file .As in kernel spcace spcadecoder (the same) perform thedecoding according parameters send by the user on command line. Thattools is not for a large public audience you need knowledge of whatyou are doing before use .<P>you will first specify what is the camera type with -f parameter thatalso specify the incoming stream<P><UL><LI>-f yuyv</LI><LI>-f yyuv</LI><LI>-f yuvy</LI><LI>-f gbrg</LI><LI>-f jpeg</LI></UL>also output palette are need with -p parameters<P><UL><LI>-p r16 for RGB16 bits</LI><LI>-p r24 for RGB24 bits</LI><LI>-p r32 for RGB32 bits</LI><LI>-p yuv for yuv420p</LI></UL>The incoming avi rawdata file are set with -i parameter<P>incoming width and height are get from the avi file header. at leastyou can specify an outcoming size with -s parameters.You only needthat the output size is smaller that input size and for jpeg cameramodulo 16<P>for exemple a spca561 based camera have gbrg bayer stream the rawdata are get in 352x288 in the file raw561.avi we want an yuv420poutput with 176x144 .Let go<P>spcatools -i raw561.avi -f gbrg -p yuv -s 176x144<P><H2><A NAME="SECTION00061000000000000000">5.1 Spcatools extract</A></H2><P>Some time we need to perform a raw frame analisys so we have to extractthe frame from the avi file. <P>spcatools -i raw561.avi -f gbrg -p yuv -e<P>will extract all frame from the avi file the file name is build withavifile name number of frame and the stream type extension.<P><H2><A NAME="SECTION00062000000000000000">5.2 Spcatools Edit</A></H2><P>Well now what can we do with those frames ? After extracting a pictureeditor are open.some keys are used to perform picture setting .<P><UL><LI>Right goes next frame</LI><LI>Left goes last frame</LI><LI>f Filter RGB to BGR</LI><LI>s Take a Picture in pnm</LI><LI>Space bar enter in Edit mode</LI><LI>q Exit Spcatools</LI></UL><P><H3><A NAME="SECTION00062100000000000000">5.2.1 Edit Mode Commands</A></H3><P>That mode allow to change parameters of the Colors setting . EachColor channel can move with an Offset [+128..-128] and Gain [1/2.. 2] The resulting change is applied trought a gamma correctorcurve [0.4545.. 2.2]<P>All the setting are set with the keyboard :<P><UL><LI>F1 Adjust gamma +</LI><LI>F2 Adjust gamma -</LI><LI>f Filter RGB to BGR</LI><LI>r Enter Red Channel Change</LI><LI>g Enter Green Channel Change</LI><LI>b Enter Blue Cannel Change</LI><LI>UP Increase Offset for Channel</LI><LI>DOWN Decrease Offset for Channel</LI><LI>RIGHT Up Gain Value for Channel</LI><LI>LEFT Down Gain Value for Channel</LI><LI>s Take a picture in pnm </LI><LI>l or Space Lock the change and go back Edit frame</LI></UL><P><H2><A NAME="SECTION00063000000000000000">5.3 Spcatools Picture</A></H2><P>Is there a way to save a picture with that setting ?<P>Sure press key s will get a picture name according avifile name andframe number and save the file in pnm format.<P><H2><A NAME="SECTION00064000000000000000">5.4 Spcatools more ?</A></H2><P>That tools are new and we can add some stream or frame process ina small C function.<P>an exemple is given for a Labteck Camera we need to detect iso packetand remove header part at the beginning and the end of the each isopacket .<P>static processFilter(unsigned char *inbuff, unsigned char *outbuff,intsize)<P>{ char val;<P>int i,p,k,lastp;<P>int frameseq = 0x80;<P>for (i = 0, p=1 ,lastp=0,k=0;i &lt; size; i ++){<P>if (inbuff[p] == 0xFF &amp;&amp; inbuff[p+1]== 0xFF){<P>printf (&#34;found Packet End at 0x%04X size 0x%04X isoseq:0x%03X frameseq: 0x%03X &#92;n&#34;,p,p-lastp,inbuff[p-1],frameseq++);<P>lastp=p;<P>p += 2; /* advance 2 Bytes so skip the header of 2 iso desc Frame0xFF 0xFF Nbyte*/<P>k -= 8; /* rewind 8 bytes remove end marquer */<P>}<P>outbuff[k++] = inbuff[p++];<P>}<P>}<H1><A NAME="SECTION00070000000000000000">About this document ...</A></H1> <STRONG>SpcaView &amp; SpcaTools Howto</STRONG><P>This document was generated using the<A HREF="http://www-dsed.llnl.gov/files/programs/unix/latex2html/manual/"><STRONG>LaTeX</STRONG>2<tt>HTML</tt></A> translator Version 99.2beta8 (1.43)<P>Copyright &#169; 1993, 1994, 1995, 1996,<A HREF="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos Drakos</A>, Computer Based Learning Unit, University of Leeds.<BR>Copyright &#169; 1997, 1998, 1999,<A HREF="http://www.maths.mq.edu.au/~ross/">Ross Moore</A>, Mathematics Department, Macquarie University, Sydney.<P>The command line arguments were: <BR> <STRONG>latex2html</STRONG> <TT>-no_subdir -split 0 -show_section_numbers /tmp/lyx_tmpdir3832R7mIui/lyx_tmpbuf0/Spcatools.tex</TT><P>The translation was initiated by michel xhaard on 2004-03-13<HR><!--Navigation Panel--><IMG WIDTH="81" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next_inactive" SRC="file:/usr/lib/latex2html/icons/nx_grp_g.png"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/lib/latex2html/icons/up_g.png"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/lib/latex2html/icons/prev_g.png">   <BR><!--End of Navigation Panel--><ADDRESS>michel xhaard2004-03-13</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -