Embedded System/Video4Linux2

[V4L2] Opening and Closing Devices

임베지수 2017. 4. 2. 14:43
v4l2

 

 

Video For Linux Two(V4L2) is a video capture application programming interface for Linux, supporting many USB 

webcams, TV tuners, and other devices. V4L2 is closely integrated with the Linux kernel. Video4Linux was named

after Video for Windows(which is sometimes abbreviated "V4W"), but is not technically related to it.

 

If you connect the right device, "video0" will appear in "/dev" directory. So, how we open the device?

 

Example Code

 

int fd;

fd = open("/dev/video0", O_RDWR);

if(fd < 0)
{
	printf("Failed to open device\n");
	return -1;
}

close(fd);

 

It's so easy. isn't it?

 

아...영어로 써봤는데 귀찮네 ㅋㅋㅋ 영어공부도 할겸 영어로 써야징.

'Embedded System > Video4Linux2' 카테고리의 다른 글

[V4L2] 이진화, 선 긋기  (5) 2017.04.02
[V4L2] Memory Mapping  (0) 2017.04.02
[V4L2] Data Formats  (3) 2017.04.02
[V4L2] Querying Capabilities  (0) 2017.04.02
V4L2 API를 이용하여 영상획득 성공!!  (0) 2017.04.02