Hi, there. I'm reviving a mail from 2011... here it is the last of the thread: http://lists.puredata.info/pipermail/pd-list/2011-02/086741.html
I was looking for help to use Gem with v4l2loopback. These mails are the only ones where I found the way to do it (no other place in internet).
After installing v4l2loopback kernel module, I did what IOhannes said:
you should be able to use [pix_record] with v4l2loopback. just do:
backend #1='V4L2'" (this will only happen the first time you create a [pix_record] object for hygienic reasons)
whatever your loopback-device is). something like [codec v4l2, filename /dev/video1, record 1( should do the trick.
f gmasdr IOhannes
Now, there is /dev/video1 (also, /dev/video0 from Webcam). But, when I try to open that device with VLC, I got this error:
[0x7fed08000e28] v4l2 demux error: not a video capture device [0x7fed08000e28] v4l2 demux error: not a radio tuner device [0x7fed08000e08] v4l2 access error: not a video capture device [0x7fed18003898] main input error: open of `v4l2:///dev/video1' failed
I tried to open with Blender, videoOnTexture, but the texture is black. There's no error messages.
What am I doing wrong?
I have Pd-extended 0.44.0-extended-20130808, Ubuntu 14.04. I don't know how to know Gem version.
Hi,
the Iohannes' instructions are still relevant but there are few things you might pay attention to :
"[pix_record] : can't open /dev/video1" this could be the issue (if /dev/video1 exists of course)
v4l2device is undefined (nor a capture or a tuner device) until you send the first frame to it.
here is attached a sample patch that works with current Gem from git.
best
antoine
Le mer. 22 avr. 2015 à 15:06, Mario Mey mariomey@gmail.com a écrit :
Hi, there. I'm reviving a mail from 2011... here it is the last of the thread: http://lists.puredata.info/pipermail/pd-list/2011-02/086741.html
I was looking for help to use Gem with v4l2loopback. These mails are the only ones where I found the way to do it (no other place in internet).
After installing v4l2loopback kernel module, I did what IOhannes said:
you should be able to use [pix_record] with v4l2loopback. just do:
- create [pix_record]
- check at the console whether it prints something like "[pix_record]:
backend #1='V4L2'" (this will only happen the first time you create a [pix_record] object for hygienic reasons)
- if so, continue
- set the codec to "v4l2" and the output filename to /dev/video1 (or
whatever your loopback-device is). something like [codec v4l2, filename /dev/video1, record 1( should do the trick.
f gmasdr IOhannes
Now, there is /dev/video1 (also, /dev/video0 from Webcam). But, when I try to open that device with VLC, I got this error:
[0x7fed08000e28] v4l2 demux error: not a video capture device [0x7fed08000e28] v4l2 demux error: not a radio tuner device [0x7fed08000e08] v4l2 access error: not a video capture device [0x7fed18003898] main input error: open of `v4l2:///dev/video1' failed
I tried to open with Blender, videoOnTexture, but the texture is black. There's no error messages.
What am I doing wrong?
I have Pd-extended 0.44.0-extended-20130808, Ubuntu 14.04. I don't know how to know Gem version.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Well, I don't know if I was on 'video' group but I did the addition. I checked the file you sent me and it works. However, for the moment, I have 3 questions:
Blender nor VLC can get the image from /dev/video1 (VLC shows errors on console, Blender says nothing, but it makes black texture) Why is like that? Supposedly, being pix_record there and activated, I should get from where I want...
don't know about GEM, but I didn't find any object that do that.
I mean, not only the color and vertical inverted video, but the whole window...
Thank you very much!
El 22/04/15 a las 11:14, Antoine Villeret escibió:
Hi,
the Iohannes' instructions are still relevant but there are few things you might pay attention to :
- be sure you belong to "video" group, if you got an error like
"[pix_record] : can't open /dev/video1" this could be the issue (if /dev/video1 exists of course)
- set and start the capture *before* setting the device capture. The
v4l2device is undefined (nor a capture or a tuner device) until you send the first frame to it.
here is attached a sample patch that works with current Gem from git.
best
antoine
Le mer. 22 avr. 2015 à 15:06, Mario Mey <mariomey@gmail.com mailto:mariomey@gmail.com> a écrit :
Hi, there. I'm reviving a mail from 2011... here it is the last of the thread: http://lists.puredata.info/pipermail/pd-list/2011-02/086741.html I was looking for help to use Gem with v4l2loopback. These mails are the only ones where I found the way to do it (no other place in internet). After installing v4l2loopback kernel module, I did what IOhannes said: ------------ you should be able to use [pix_record] with v4l2loopback. just do: - - create [pix_record] - - check at the console whether it prints something like "[pix_record]: backend #1='V4L2'" (this will only happen the first time you create a [pix_record] object for hygienic reasons) - - if so, continue - - set the codec to "v4l2" and the output filename to /dev/video1 (or whatever your loopback-device is). something like [codec v4l2, filename /dev/video1, record 1( should do the trick. f gmasdr IOhannes ----------- Now, there is /dev/video1 (also, /dev/video0 from Webcam). But, when I try to open that device with VLC, I got this error: [0x7fed08000e28] v4l2 demux error: not a video capture device [0x7fed08000e28] v4l2 demux error: not a radio tuner device [0x7fed08000e08] v4l2 access error: not a video capture device [0x7fed18003898] main input error: open of `v4l2:///dev/video1' failed I tried to open with Blender, videoOnTexture, but the texture is black. There's no error messages. What am I doing wrong? I have Pd-extended 0.44.0-extended-20130808, Ubuntu 14.04. I don't know how to know Gem version. _______________________________________________ Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 2015-04-23 15:51, Mario Mey wrote:
Well, I don't know if I was on 'video' group but I did the addition. I checked the file you sent me and it works. However, for the moment, I have 3 questions:
- If I don't activate the device in the right side of the patch, nor
Blender nor VLC can get the image from /dev/video1 (VLC shows errors on console, Blender says nothing, but it makes black texture) Why is like that? Supposedly, being pix_record there and activated, I should get from where I want...
this could have a multitude of reasons. i would suggest first checking what those errors are that VLC throws (chances are they mean something). then try using gstreamer(-0.10!) to display the video. something like: $ gst-launch0.10 v4l2src device=/dev/video1 ! ffmpegcolorspace ! xvimagesink
- Look at the attached image: why the video is vertically inverted? I
don't know about GEM, but I didn't find any object that do that.
it's the olde discrepancy between openGL image coordinates (starting in the lower left corner) and most other pixel coordinates (starting in the upper left corner), and a small bug in the old recordV4L2 implementation of Gem (which should be fixed in recent git). iirc putting a [pix_flip] before [pix_record] might fix the problem.
anyhow, this means that the v4l2loopback output is working. so that leaves two more potential candidates for your problem:
gstreamer-1.0; which version are you using?)
v4l2loopback module i noticed that quite a number of v4l2 applications make unjustified assumptions about the v4l2 device, which sometimes are not satisfied by v4l2loopback. (like refusing to work when the card_name does not match the device-name...)
- How the patch should be if I want to send the GEM window to loopback?
I mean, not only the color and vertical inverted video, but the whole window...
checkout [pix_snap] to fetch a framebuffer into pixes.
fgasm IOhannes
At the end, I'm telling a bug...
El 23/04/15 a las 12:14, IOhannes m zmoelnig escibió:
On 2015-04-23 15:51, Mario Mey wrote:
Well, I don't know if I was on 'video' group but I did the addition. I checked the file you sent me and it works. However, for the moment, I have 3 questions:
- If I don't activate the device in the right side of the patch, nor
Blender nor VLC can get the image from /dev/video1 (VLC shows errors on console, Blender says nothing, but it makes black texture) Why is like that? Supposedly, being pix_record there and activated, I should get from where I want...
this could have a multitude of reasons. i would suggest first checking what those errors are that VLC throws (chances are they mean something). then try using gstreamer(-0.10!) to display the video. something like: $ gst-launch0.10 v4l2src device=/dev/video1 ! ffmpegcolorspace ! xvimagesink
After some tests (including using gst-launch0.10)... I realized that I was wrong. Blender and VLC can read from /dev/video1 without activating it on Pd.
But... I need to create gemwin before VLC or Blender or Gstreamer. Is this normal? Should I need gem window opened? It is for gemhead to make gemlists... isn't it?
- Look at the attached image: why the video is vertically inverted? I
don't know about GEM, but I didn't find any object that do that.
it's the olde discrepancy between openGL image coordinates (starting in the lower left corner) and most other pixel coordinates (starting in the upper left corner), and a small bug in the old recordV4L2 implementation of Gem (which should be fixed in recent git). iirc putting a [pix_flip] before [pix_record] might fix the problem.
[pix_flip] does the trick.
anyhow, this means that the v4l2loopback output is working. so that leaves two more potential candidates for your*problem*:
Do you mean the Blender and VLC getting "problem"? It is resolved. Well... maybe it never was there.
- the v4l2loopback kernel module (there are some known issues with e.g.
gstreamer-1.0; which version are you using?)
I didn't know I had gstreamer installed on the system. I have 1.0 and 0.10.
- the consumer applications (blender/vlc): while working on the
v4l2loopback module i noticed that quite a number of v4l2 applications make unjustified assumptions about the v4l2 device, which sometimes are not satisfied by v4l2loopback. (like refusing to work when the card_name does not match the device-name...)
Blender and VLC get the video correctly.
- How the patch should be if I want to send the GEM window to loopback?
I mean, not only the color and vertical inverted video, but the whole window...
checkout [pix_snap] to fetch a framebuffer into pixes.
I'll check it later.
fgasm IOhannes
Using the patch from Antoine, when I click in [device /dev/video1( from the right side of the patch, the rectangle with the video appears. But when I try to close Pd, it freezes. I have to kill it. I tried some things with no success:
Is this a bug?
On 04/23/2015 09:02 PM, Mario Mey wrote:
El 23/04/15 a las 12:14, IOhannes m zmoelnig escibió:
On 2015-04-23 15:51, Mario Mey wrote:
Well, I don't know if I was on 'video' group but I did the addition. I checked the file you sent me and it works. However, for the moment, I have 3 questions:
- If I don't activate the device in the right side of the patch, nor
Blender nor VLC can get the image from /dev/video1 (VLC shows errors on console, Blender says nothing, but it makes black texture) Why is like that? Supposedly, being pix_record there and activated, I should get from where I want...
this could have a multitude of reasons. i would suggest first checking what those errors are that VLC throws (chances are they mean something). then try using gstreamer(-0.10!) to display the video. something like: $ gst-launch0.10 v4l2src device=/dev/video1 ! ffmpegcolorspace ! xvimagesink
After some tests (including using gst-launch0.10)... I realized that I was wrong. Blender and VLC can read from /dev/video1 without activating it on Pd.
unfortunately i don't know what you mean exactly with "activating".
But... I need to create gemwin before VLC or Blender or Gstreamer. Is this normal? Should I need gem window opened? It is for gemhead to make gemlists... isn't it?
and you need gemlists for pix sources to emit pixel data. and you need pixel data for [pix_record] to set the output frame dimensions/colorspace. and you need to set the output frame dimensions/colorspace in order to turn a v4l2loopback OUTPUT device into a CAPTURE device. and you need a CAPTURE device in order to read it in blender, vlc,... or any other capturing application.
anyhow, this means that the v4l2loopback output is working. so that leaves two more potential candidates for your*problem*:
Do you mean the Blender and VLC getting "problem"? It is resolved. Well... maybe it never was there.
- the v4l2loopback kernel module (there are some known issues with e.g.
gstreamer-1.0; which version are you using?)
I didn't know I had gstreamer installed on the system. I have 1.0 and 0.10.
i was referring to the version of v4l2loopback. sorry for the confusion.
fngsrd IOhannes
El 23/04/15 a las 16:21, IOhannes m zmölnig escibió:
After some tests (including using gst-launch0.10)... I realized that I was wrong. Blender and VLC can read from /dev/video1 without activating it on Pd.
unfortunately i don't know what you mean exactly with "activating".
Sorry my english. I meant using the device first in Pd. I used that word because... never mind.
I didn't know I had gstreamer installed on the system. I have 1.0 and 0.10.
i was referring to the version of v4l2loopback. sorry for the confusion.
I downloaded v4l2loopback from git, some days ago (https://github.com/umlaeute/v4l2loopback). I don't know how to know the version, but I think it is 0.8.0....?
What about the freeze? This is what I do:
Is there a step by step to close the patch without freezing?
Ubuntu 14.04, Pd 0.44.0-extended-20130808