正如標題所說,我不確定如何將IplImage寫入V4l2回送設備。我知道如何寫入設備,因爲我已經發布在這裏How to write/pipe to a virtual webcam created by V4L2loopback module?如何將opencv圖像(IplImage)寫入V4L2環回設備?
但是現在我不知道如何將IplImage對象完全寫入設備。如果我只寫image-> imageData,其中圖像是IplImage *,當我使用「luvcview」查看設備時,格式錯誤的幀顯示大約一秒鐘,則會引發以下錯誤。
luvcview 0.2.6
SDL information:
Video driver: x11
A window manager is available
Device information:
Device path: /dev/video3
Stream settings:
Frame format: YUYV (MJPG is not supported by device)
Frame size: 520x474 (requested size 640x480 is not supported by device)
Frame rate: 30 fps
libv4l2: error dequeuing buf: Invalid argument
Unable to dequeue buffer: Invalid argument
Error grabbing
Cleanup done. Exiting ...
難道是因爲我還沒有將opencv圖像轉換爲v4l2格式?或者v4l2參數與IplImage屬性不匹配?如果是這樣怎麼辦?
如果有人知道這個錯誤意味着什麼,請讓我知道。
我決定單獨發佈這個問題,因爲這個問題不是寫入設備,特別是寫入IplImage到設備。
任何人都可以請給我一個代碼片段,顯示如何寫一個IplImage到V4l2回送設備?