随着USB摄像头的普及以及Linux系统桌面应用的推广,基于Linux系统的视频播放程序设计有着现实应用的意义。采用应用编程接口Vide04Linux2所提供的数据结构、应用函数等,实现在Linux环境下USB摄像头图像数据的采集功能,并运用GTK库显示和播放其视频图像。运用Linux标准库函数实现了数字图像的采集,对基于Linux内核的后续图像应用开发具有实用意义。该程序采用Linux系统下新的视频编程接口和标准库函数,以模块化结构实现所需功能,具有良好移植性,基于此平台可方便加入图像处理等其他应用模块。
With widely and rapidly using of USB camera and the popularization of Linux system desktop,it's meaning to program for the display video on the Linux system. This paper makes use of the data configuration and the application function which belongs to Video4Linux2 application programming interface, capturing the video picture of the USB camera on the Linux system,and displaying it with GTK are implemented. Programming for the capture of image data on the standard library of Linux,it is usefully significative to exploit the application of image on the Linux kernel. This program uses new API of video and standard library on the Linux, the function is achieved by modularize structure so that it can be transplanted easily and added to other application module such as image processing.