vladimirvivien / go4vl

A Go library for working with the Video for Linux API (V4L2).
MIT License
245 stars 45 forks source link

Are there plans to provide a utility to convert YUYV format to go image.Image? #48

Closed vincent-vinf closed 1 year ago

vincent-vinf commented 1 year ago

Now, we can get the source data in YUV format, but there is no corresponding tool to convert it to the image format supported by go. Is there a support plan?

vladimirvivien commented 1 year ago

Hi @vincent-vinf Great question. From the beginning I wanted to add format conversion code. However, I hesitate and focus only on abstracting v4l2 directly. Maybe later I will.

If you do need one, checkout project Pion, specifically project MediaDevices here.

vincent-vinf commented 1 year ago

Thank you very much, I have found what I need. https://github.com/pion/mediadevices/blob/87486146d585018bef1ea4a4d2ebf99c65ba7b30/pkg/frame/yuv_nocgo.go#LL10C9-L10C9