mjpegtools.1

来自「Motion JPEG编解码器源代码」· 1 代码 · 共 2,296 行 · 第 1/5 页

1
2,296
字号
.\".TH "MJPEG tools" "MJPEG Linux Square" "MJPEG tools manual".LPMJPEG HOWTO - An introduction to the MJPEG-toolsPraschinger Bernhardv1.48MJPEG capture/editting/replay and MPEG encoding toolset description.PPIntroduction.PPI wrote this things down, because I had many sheets with notes on them.This should be some kind of summary of collected knowledge of this sheets.Andrew Stevens helped with encoding and VCD knowledge and hints..PPThe mjpegtools are a set of programs that can do recording, playback, editingand eventual MPEG compression of audio and video under Linux..PPAlthough primarily intended for use with capture / playback boards based on theZoran ZR36067 MJPEG codec chip, the mjpegtools can easily be used to processand compress MJPEG video streams captured using xawtv using simpleframe-buffer devices..PPThe HOWTO for the tools intended to give an an introduction to the MJPEG-toolsand the creation of MPEG 1/2 videos. VCD and SVCD, and the transcoding of existing mpeg streams..PPFor more information about the programs read the corresponding man-page..PPAchtung es gibt auch eine deutsche Version bei:.PPThere is also a manpage of this text, you can read it with\(rqman mjpegtools\(rq if installed. .PPThe text version of this text is available via cvs, you should get it with atarball or the precompiled package (RPM and deb)..PPIn the following picture you see the typical workflow when you record a video.Cut it afterwards and encode it. In the picture you also see the connectionsto other programs. These parts are in grey, the parts in blue can be done withthe mjpegtools. .PPVideo encoding workflow.PP.PPUnsorted list of useful Hints.PPYou have to compile and install the mjpeg_play package, for this read theREADME & REQUIRED_SOFTWARE & INSTALL.If you do not want to compile it, you can download the mjpeg .RPM or .DEBpackage at Sourceforge..PPThere is a script in the scripts/ directory. This script is something thatshow's you a way how it can be done. It also creates (under certaincircumstances) videos that look quite good. Better videos you only get bytuning the parameters yourself. .PPYou will usually have to load the drivers for the Buz or DC10 or LML33 cards.So you have to run the update script providing as option the name of your cardyou have. The script is usually in /usr/src/driver-zoran/.The zoran kernel driver below the kernel 2.4.4 do not work.You have to use the driver available from:.PPThe driver for the Matrox Marvel card also works, more information about it:.PPIf you compile the tools on a P6 based computer (PPro, P-II, P-III, P-4,Athlon,Duron) then never try to let them run on a P5 based computer(Pentium, Pentium-MMX, K6, K6-x, Cyrix, Via, Winchip). You'll get a \(rqillegal instruction\(rq and the program won't work..PPIf lav2yuv dumps core then one possible cause isno dv support was included. To enable it make sure that libdv is installedon the system.  This will be necessary if you are using a digital camera (or analog to DV converter such as the Canopus ADVC100) and converting the dv avi format into the MPEG format..PPStart xawtv to see if you get an picture. If you want to use HW-playback ofthe recorded streams you have to start xawtv (any TV application works) onceto get the streams played back. You should also check the settings of yourmixer in the sound card..PPIf you compile the tools on a platform other than Linux not all tools will work.   Mjpegtools on a OS/X system for example will not have V4L(video4linux) capability..PPNever try to stop or start the TV application when lavrec runs. If you startor stop the TV application lavrec will stop recording, or your computer couldget \(rqfrozen\(rq\&. This is a problem of v4l (video4linux)..PPThis problem is solved with v4l2. If you use v4l2 you can record the video and stop and start the tv application whenever you want.But v4l2 is currently (7. Jan. 2003) only supported for the zoran based cards (BUZ, DC10, DC10+, LML33) if you use the CVS driver from mjpeg.sf.net tagged with ZORAN_VIDEODEV_2.And this driver only works with the 2.4.20 kernel and the 2.5.* development kernel..PPOne last thing about the data you get before we start:.PP.DS.sp .ft RR.nfAudio: ( Samplerate * Channels * Bitsize ) / (8 * 1024)CD Quality:(44100 Samples/sec * 2 Chanels * 16 Bit) / (8 * 1024)=172,2 kB/secThe 8 * 1024 convert the value from bit/sec to kByte/secVideo: (width * height * framerate * quality ) / (200 * 1024)PAL HALF Size : (352 * 288 * 25 * 80) / (200 * 1024) = 990 kB/secPAL FULL size : (720 * 576 * 25 * 80) / (200 * 1024) = 4050 kB/secNTSC HALF size: (352 * 240 * 30 * 80) / (200 * 1024) = 990 kB/secNTSC FULL size: (720 * 480 * 30 * 80) / (200 * 1024) = 4050 kB/sec.DE.fi .ec.ft P.sp.PPThe 1024 converts the Bytes to kBytes. Not every card can record the sizementioned. The Buz and Marvel G400 for example can only record a size of 720x576 when using -d 1, the DC10 records a size of 384x288 when using -d 2..PPWhen you add audio and video datarate this is what your hard disk has to be able to write constantly streaming, else you will have lost frames..PPIf you want to play with the \fB--mjpeg-buffer-size\fP\&. Remember the value should be at least big enough that one frame fits in it. The size of one frame is: (width * height * quality ) / (200 * 1024) = kB If the buffer is too small the rate calculation doesn't match any more and buffer overflows can happen. The maximum value is 512kB..PPHow video works and the difference between the video types is explained here:.PPThere you also find how to create MPEG Still Images for VCD/SVCD..PPA good description of DV (Digital Video) can be found here:.PP.SH Some books we found usefull.PPwritten in English:.nr ll +1.nr t\n(ll 0.if \n(ll>1 .RS.nr bi 1.PPDigital Video and HDTV by Charles Poyton (ISBN 1-55860-792-7).nr bi 1.PPDigital Video Compression by Peter Symes (ISBN 0-07-142487-3).nr bi 1.PPVideo Demystified by Keith Jack (ISBN 1-878707-56-6).if \n(ll>1 .RE.nr ll -1.PP.PPwritten in German:.nr ll +1.nr t\n(ll 0.if \n(ll>1 .RS.nr bi 1.PPFernsehtechnik von Rudolf Maeusl (ISBN 3-7785-2374-0).nr bi 1.PPProfessionelle Videotechnik - analoge und digitale Grundlagen vonU. Schmidt (ISBN 3-540-43974-9).nr bi 1.PPDigitale Film- und Videotechnik von U. Schmidt (ISBN 3-446-21827-0).if \n(ll>1 .RE.nr ll -1.PP.PPIf you know some other really good book about that, write us!.PPRecording videos.PP.SH lavrec examples.PPRecording with lavrec look's like this:.PP\fB> lavrec -f a -i P -d 2 record.avi\fP.PP.nr ll +1.nr t\n(ll 2.if \n(ll>1 .RS.IP "".nr bi 1.PPShould start recording now,.IP "-f a".nr bi 1.PPuse AVI as output format,.IP "-i P".nr bi 1.PPuse as input source the SVHS-In with PAL format,.IP "-d 2".nr bi 1.PPthe size of the pictures are half size (352x288).IP "record.avi".nr bi 1.PPname of the created file..if \n(ll>1 .RE.nr ll -1.PPRecording is finished by pressing Crtl-C (nowadays: Strg-C). Sometimes using \fB-f A\fP instead of \fB-f a\fP might be necessary.PPOther example:.PP\fB> lavrec -f q -i n -d 1 -q 80 -s -l 80 -R l -U record.avi \fP.PP.nr ll +1.nr t\n(ll 2.if \n(ll>1 .RS.IP "".nr bi 1.PPShould start recording now, .IP "-f q".nr bi 1.PPuse Quicktime as output format, .IP "-i n".nr bi 1.PPuse Composite-In with NTSC format, .IP "-d 1".nr bi 1.PPrecord pictures with full size (640x480) .IP "-q 80".nr bi 1.PPset the quality to 80% of the captured image .IP "-s".nr bi 1.PPuse stereo mode (default mono) .IP "-l 80".nr bi 1.PPset the recording level to 80% of the max during recording .IP "-R l".nr bi 1.PPset the recording source to Line-In .IP "-U".nr bi 1.PPWith this lavrec uses the read instead of mmap for recording this is needed if your sound card does notsupport the mmap for recording..if \n(ll>1 .RE.nr ll -1.PPSetting the mixer does not work with every sound card.  If you record with 2different settings and both recordings are equally loud you should setup the mixer with a mixer program.  After that you should use the \fB-l -1\fP option when you record using lavrec.PPThe size of the image depends on the card you use.  At full size (-d 1)you get these image sizes: BUZ and LML33: 720x576, the DC10: 768x576.PPOther example:.PP\fB> lavrec -w -f a -i S -d 2 -l -1 record%02d.avi\fP.PP.nr ll +1.nr t\n(ll 2.if \n(ll>1 .RS.IP "".nr bi 1.PPShould start recording,.IP "-w".nr bi 1.PPWaits for user confirmation to start (press enter) .IP "-f a".nr bi 1.PPuse AVI as output format, .IP "-i S".nr bi 1.PPuse SECAM SVHS-Input (SECAM Composite recording is also possible: -i s).IP "-d 2".nr bi 1.PPthe size of the pictures are half size.IP "-l -1".nr bi 1.PPdo not touch the mixer settings.IP "record%02d.avi".nr bi 1.PPHere lavrec creates the first file named record00.avi after the file has reached a size of 1.6GB (after about 20 Minutes recording) it starts a new sequence named record01.avi and so on till the recording is stopped or the disk is full.if \n(ll>1 .RE.nr ll -1.PPOther example:.PP\fB> lavrec -f a -i t -q 80 -d 2 -C europe-west:SE20 test.avi\fP.PP.nr ll +1.nr t\n(ll 2.if \n(ll>1 .RS.IP "".nr bi 1.PPShould start recording now, .IP "-f a".nr bi 1.PPuse AVI as output format, .IP "-i t".nr bi 1.PPuse tuner input, .IP "-q 80".nr bi 1.PPset the quality to 80% of the captured image .IP "-d 2".nr bi 1.PPthe size of the pictures are half size (352x288) .IP "-C".nr bi 1.PPchoose TV channels, and the corresponding -it and -iT (video source:TV tuner) can currently be used on the Marvel G200/G400 and the MatroxMillenium G200/G400 with Rainbow Runner extension (BTTV-Support is underconstruction). For more information on how to make the TV tuner parts of thesecards work, see the Marvel/Linux project on:.if \n(ll>1 .RE.nr ll -1.PPLast example:.PP\fB> lavrec -f a -i p -g 352x288 -q 80 -s -l 70 -R l --software-encodingtest03.avi\fP.PPThe two new options are \fB-g 352x288\fP, which sets the size of thevideo to be recorded when using \fB--software-encoding\fP, this enablesthe software encoding of the recorded images. With this option you can alsorecord from a bttv based card. The processor load is high. This option onlyworks for generic video4linux cards (such as the brooktree-848/878 based cards), it doesn't work for zoran-based cards..PP.SH Other recording hints.PPAll lavtools accept a file description like file*.avi, so you do not haveto name each file, but that would also be a posibillity to do. .PPNote: More options are described in the man-page, but with this you should be able to get started..PPHere are some hints for sensible settings. Turn the quality to 80%or more for -d 2 capture. At full resolution as low as 40% seems tobe visually \(rqperfect\(rq\&. -d 2 is already better than VHS video(a *lot*!). For a Marvel you should not set the quality higher than 50 whenyou record at full size (-d 1). If you use higher settings (-q 60) it ismore likely that you will encounter problems. Higher settingswill result in framedrops. If you're aiming to create VCD's then there is little to be gained

⌨️ 快捷键说明

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