Quasar > Video Processing

Video Processing

Quasar.Video.dll

The video input/output library is a wrapper around FFMPEG encoding / decoding routines and provides a small number of functions that make video processing really easy.
Use the function <vidopen> to open a webcam video stream. To connect to a webcam, it is necessary to specify a special camera connection string. These connection strings start with "cam:". On Windows platforms, the video camera is accessed using the DirectShow API. On Linux platforms, video4linux is normally used. The user specifies which camera to use using the connection string of the following form:

cam:video=[],video_size=[XXxYY],frame_rate=XX

For example:
file_name = "cam:video=Integrated Webcam"
file_name = "cam:video=QuickCam Orbit/Sphere MP,video_size=640x480,frame_rate=30"

Remark that it is also possible to specify the frame size and frame rate, through the camera connection string. You can list the installed cameras using the FFMPEG tool:
ffmpeg -f dshow -list_devices true -i list

On Linux platforms, we support two types of devices: VideoForLinux and DV1394. Again, the user specifies which camera to use with the filename:

cam:[device_type][:standard]

where device_type - 'v4l' for VideoForLinux, 'dv1394' for DV1394. By default 'v4l' standard - 'pal', 'secam' or 'ntsc'. By default 'ntsc' The driver name is constructed automatically from the device type:
v4l : /dev/video
dv1394: /dev/dv1394/

If you have different driver name, you can specify the driver name explicitly instead of device type. Examples of valid camera connection strings:

cam:/dev/v4l/video0:pal
cam:/dev/ieee1394/1:ntsc
cam:dv1394:secam
cam:v4l:pal

This video library supports all video codecs of FFMPEG. You can obtain a list through the command
ffmpeg -decoders
ffmpeg -encoders

The supported video formats are listed below.
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
V.S.BD mpeg1video MPEG-1 video
V.S.BD mpeg2video MPEG-2 video
V.S.BD mpegvideo MPEG-1 video (codec mpeg2video)
V....D h261 H.261
V...BD h263 H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2
V....D rv10 RealVideo 1.0
V....D rv20 RealVideo 2.0
V....D mjpeg MJPEG (Motion JPEG)
V....D mjpegb Apple MJPEG-B
V....D sp5x Sunplus JPEG (SP5X)
V....D jpegls JPEG-LS
VF..BD mpeg4 MPEG-4 part 2
V..... rawvideo raw video
V...BD msmpeg4v1 MPEG-4 part 2 Microsoft variant version 1
V...BD msmpeg4v2 MPEG-4 part 2 Microsoft variant version 2
V...BD msmpeg4 MPEG-4 part 2 Microsoft variant version 3 (codec msmpeg4v3)
V...BD wmv1 Windows Media Video 7
V...BD wmv2 Windows Media Video 8
V...BD h263p H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2
V...BD h263i Intel H.263
V...BD flv FLV / Sorenson Spark / Sorenson H.263 (Flash Video) (codec flv1)
V....D svq1 Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1
V...BD svq3 Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3
V.S..D dvvideo DV (Digital Video)
VF..BD huffyuv Huffyuv / HuffYUV
V....D cyuv Creative YUV (CYUV)
VFS..D h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
V..... indeo3 Intel Indeo 3
VF..BD vp3 On2 VP3
VF..BD theora Theora
V....D asv1 ASUS V1
V....D asv2 ASUS V2
V.S..D ffv1 FFmpeg video codec #1
V....D 4xm 4X Movie
V....D vcr1 ATI VCR1
V....D cljr Cirrus Logic AccuPak
VF...D mdec Sony PlayStation MDEC (Motion DECoder)
V....D roqvideo id RoQ video (codec roq)
V....D interplayvideo Interplay MVE video
V....D xan_wc3 Wing Commander III / Xan
V....D xan_wc4 Wing Commander IV / Xxan
V....D rpza QuickTime video (RPZA)
V....D cinepak Cinepak
V....D vqavideo Westwood Studios VQA (Vector Quantized Animation) video (codec ws_vqa)
V....D msrle Microsoft RLE
V....D msvideo1 Microsoft Video 1
V....D idcinvideo id Quake II CIN video (codec idcin)
V....D 8bps QuickTime 8BPS video
V....D smc QuickTime Graphics (SMC)
V....D flic Autodesk Animator Flic video
V....D truemotion1 Duck TrueMotion 1.0
V....D vmdvideo Sierra VMD video
V....D mszh LCL (LossLess Codec Library) MSZH
V....D zlib LCL (LossLess Codec Library) ZLIB
V....D qtrle QuickTime Animation (RLE) video
V....D snow Snow
V....D camtasia TechSmith Screen Capture Codec (codec tscc)
V....D ultimotion IBM UltiMotion (codec ulti)
V....D qdraw Apple QuickDraw
V....D xl Miro VideoXL (codec vixl)
V....D qpeg Q-team QPEG
V....D png PNG (Portable Network Graphics) image
V....D ppm PPM (Portable PixelMap) image
V....D pbm PBM (Portable BitMap) image
V....D pgm PGM (Portable GrayMap) image
V....D pgmyuv PGMYUV (Portable GrayMap YUV) image
V....D pam PAM (Portable AnyMap) image
VF..BD ffvhuff Huffyuv FFmpeg variant
VF...D rv30 RealVideo 3.0
VF...D rv40 RealVideo 4.0
V....D vc1 SMPTE VC-1
V....D wmv3 Windows Media Video 9
V....D loco LOCO
V....D wnv1 Winnov WNV1
V....D aasc Autodesk RLE
V....D indeo2 Intel Indeo 2
VF...D fraps Fraps
V....D truemotion2 Duck TrueMotion 2.0
V....D bmp BMP (Windows and OS/2 bitmap)
V....D camstudio CamStudio (codec cscd)
V....D mmvideo American Laser Games MM Video
V....D zmbv Zip Motion Blocks Video
V....D avs AVS (Audio Video Standard) video
V....D smackvid Smacker video (codec smackvideo)
V....D nuv NuppelVideo/RTJPEG
V....D kmvc Karl Morton's video codec
V....D flashsv Flash Screen Video v1
V....D cavs Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)
V..X.. j2k JPEG 2000 (codec jpeg2000)
VF...D libopenjpeg OpenJPEG JPEG 2000 (codec jpeg2000)
V....D vmnc VMware Screen Codec / VMware Video
V....D vp5 On2 VP5
V....D vp6 On2 VP6
V....D vp6f On2 VP6 (Flash version)
V....D targa Truevision Targa image
V....D dsicinvideo Delphine Software International CIN video
V....D tiertexseqvideo Tiertex Limited SEQ video
V....D tiff TIFF image
V....D gif GIF (Graphics Interchange Format)
V....D dxa Feeble Files/ScummVM DXA
VF...D dnxhd VC3/DNxHD
V....D thp Nintendo Gamecube THP video
V....D sgi SGI image
V....D c93 Interplay C93
V....D bethsoftvid Bethesda VID video
V....D ptx V.Flash PTX image
V....D txd Renderware TXD (TeXture Dictionary) image
V....D vp6a On2 VP6 (Flash version, with alpha channel)
V..... amv AMV Video
V..... vb Beam Software VB
V....D pcx PC Paintbrush PCX image
V....D sunrast Sun Rasterfile image
V..... indeo4 Intel Indeo Video Interactive 4
V..... indeo5 Intel Indeo Video Interactive 5
VF...D mimic Mimic
V....D rl2 RL2 video
V....D escape124 Escape 124
V..... dirac BBC Dirac VC-2
V..... libschroedinger libschroedinger Dirac 2.2 (codec dirac)
V....D bfi Brute Force & Ignorance
V....D eacmv Electronic Arts CMV video (codec cmv)
V....D motionpixels Motion Pixels video
V..... eatgv Electronic Arts TGV video (codec tgv)
V....D eatgq Electronic Arts TGQ video (codec tgq)
V....D eatqi Electronic Arts TQI Video (codec tqi)
V....D aura Auravision AURA
V....D aura2 Auravision Aura 2
V....D v210x Uncompressed 4:2:2 10-bit
V....D tmv 8088flex TMV
V....D v210 Uncompressed 4:2:2 10-bit
V....D dpx DPX image
V....D eamad Electronic Arts Madcow Video (codec mad)
V....D frwu Forward Uncompressed
V....D flashsv2 Flash Screen Video v2
V....D cdgraphics CD Graphics video
V....D r210 Uncompressed RGB 10-bit
V....D anm Deluxe Paint Animation
V..... binkvideo Bink video
V....D iff_ilbm IFF ILBM
V....D iff_byterun1 IFF ByteRun1
V..... kgv1 Kega Game Video
V..... yop Psygnosis YOP Video
VFS..D vp8 On2 VP8
V..... libvpx libvpx VP8 (codec vp8)
V....D pictor Pictor/PC Paint
V....D ansi ASCII/ANSI art
V....D r10k AJA Kona 10-bit RGB Codec
V....D mxpeg Mobotix MxPEG video
VF...D lagarith Lagarith lossless
V.S..D prores ProRes
V.S..D prores_lgpl Apple ProRes (iCodec Pro) (codec prores)
V....D jv Bitmap Brothers JV video
V....D dfa Chronomaster DFA
V....D wmv3image Windows Media Video 9 Image
V....D vc1image Windows Media Video 9 Image v2
VF...D utvideo Ut Video
V..... libutvideo Ut Video (codec utvideo)
V....D bmv_video Discworld II BMV video
V....D vble VBLE Lossless Codec
V....D dxtory Dxtory
V....D v410 Uncompressed 4:4:4 10-bit
V....D xwd XWD (X Window Dump) image
V....D cdxl Commodore CDXL video
V....D xbm XBM (X BitMap) image
V....D zerocodec ZeroCodec Lossless Video
V....D mss1 MS Screen 1
V....D msa1 MS ATC Screen
V....D tscc2 TechSmith Screen Codec 2
V....D mts2 MS Expression Encoder Screen
V....D cllc Canopus Lossless Codec
V....D mss2 MS Windows Media Video V9 Screen
V....D y41p Uncompressed YUV 4:1:1 12-bit
V....D escape130 Escape 130
VF...D exr OpenEXR image
V....D avrp Avid 1:1 10-bit RGB Packer
V....D avui AVID Meridien
V....D ayuv Uncompressed packed MS 4:4:4:4
V....D v308 Uncompressed packed 4:4:4
V....D v408 Uncompressed packed QT 4:4:4:4
V....D yuv4 Uncompressed packed 4:2:0
V....D sanm LucasArts SMUSH video
V....D paf_video Amazing Studio Packed Animation File Video
V....D avrn Avid AVI Codec
V....D cpia CPiA video format

See Quasar.Video.dll


An overview of the different functions and classes:

Quasar.Video.dllThe video input/output library is a wrapper around FFMPEG encoding / decoding routines and provides a small number of functions that make video processing really easy.
qvideostreamThe base class for all objects in Quasar
vidcamlistReturns a list of all the camera devices (e.g. webcams) in the system
vidopenOpens the specified video file for reading (and decoding)
vidplay (1)Opens and plays the specified video file using TNGVideoPlayer. The function also allows for real-time video filtering through the "filter" argument.
vidplay (2)Opens and plays the specified video file using TNGVideoPlayer. The function also allows for real-time video filtering through the "filter" argument.
vidplay (3)Opens and plays the specified video file using TNGVideoPlayer. The function also allows for real-time video filtering through the "filter" argument.
vidreadframeReads and decodes one frame of the video sequence
vidsave (1)Opens the specified video file for writing (by encoding)
vidsave (2)Opens the specified video file for writing (by encoding)
vidsave (3)Opens the specified video file for writing (by encoding)
vidseekJumps to the specified position within the video sequence