We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Pages: 1 2 3 
Using a dvcam as a web-cam in Linux (Read 13158 times)
Re: Using a dvcam as a web-cam in Linux
Reply #30 - Jan 5th, 2010, 5:23am
 
Wow! that works great! thanks you SO MUCH!
Re: Using a dvcam as a web-cam in Linux
Reply #31 - Feb 9th, 2010, 8:22pm
 
hello,
i'm having the same problem here using sony dv handycam.
i was carefuly reading this topic and everything worked in my case except this last thing

Quote:
pipe = new GSPipeline(this, "dv1394src port=0 ! video/x-dv ! dvdemux ! dvdec ! ffmpegcolorspace ! video/x-raw-rgb, width=720, height=480, bpp=32, depth=24);

i'm unable to perform that.
gst-launch gives "internal data flow error"
and without conversion i'm stuck with "buffer underflow exception" in processing.
i searched for numerous other examples but could not find single one that does conversion from yuv to rgb.
im using latest 0.6-pre0 gsvideo library and gstreamer from karmic repo


im just hoping you have some other ideas
Re: Using a dvcam as a web-cam in Linux
Reply #32 - Feb 10th, 2010, 9:07am
 
As it has been suggested before, the first thing to test would be to try the pipeline from the command line with gst-launch, i.e.:

gst-launch-0.10 dv1394src port=0 ! video/x-dv ! dvdemux ! dvdec ! ffmpegcolorspace ! video/x-raw-rgb, width=720, height=480, bpp=32, depth=24 ! xvimagesink

Does this test shows the image from the camera? If the problem persists, then it means it is an issue with gstreamer and not with gsvideo itself.
Re: Using a dvcam as a web-cam in Linux
Reply #33 - Feb 14th, 2010, 2:15pm
 
i tried pipline and as soon as i add rgb as in video/x-raw-rgb anywhere in pipeline i ends with internal dataflow error.
without rgb conversion in pipeline it works fine, but then it does not work in processing

for capturing kino says:
>>> formats supported: 4
>>>     0x32595559 (YUY2) packed
>>>     0x32315659 (YV12) planar
>>>     0x59565955 (UYVY) packed
>>>     0x30323449 (I420) planar

i could try to compile gstreamer from git but i dont see how could that help
Re: Using a dvcam as a web-cam in Linux
Reply #34 - Feb 14th, 2010, 3:58pm
 
the problem here is that processing requires frames in rgb format, and the camera only seems to provide in YUY2, YV12, UYVY and I420 formats.

After some online browsing, I have the impression that the colorspace conversions you need (YUY2->RGB, YV12->RGB, etc) are not implemented in gstreamer yet Sad

But maybe I'm wrong...
Re: Using a dvcam as a web-cam in Linux
Reply #35 - Feb 14th, 2010, 4:25pm
 
i found out that xvimage sink cannot display rgb for some reason (while ximagesink can)
example
Code:
gst-launch -v videotestsrc ! ffmpegcolorspace ! video/x-raw-rgb ! xvimagesink 


gives "cannot negotiate format"
but in our case we have "internal dataflow error" with xvimagesink and ximagesink .. something between dv to rgb conversion.

then i found ARToolkit forum thread about some axis cam, where they say that it is not possible to display cam output with gst-launch but that it does not matter since artoolkit can process stream, and they use fakesink.

then i tried normal web cam with v4l2 and same "buffer underflow" error happend.. that when i got crazy...
after removing spaces between capsfilter parameters it suddenly worked..
Code:
"v4l2src ! ffmpegcolorspace ! video/x-raw-rgb,width=320,height=240,bpp=32,depth=24" 



than i did same thing to dv1394src.. it WORKED!

now it works even with spaces beetwen parameters...
i can not explain it  Smiley

so finaly this works.. tnx for replies
Code:
cam = new GSPipeline(this, "dv1394src ! video/x-dv ! dvdemux ! dvdec ! ffmpegcolorspace ! video/x-raw-rgb, width=720, height=480, bpp=32, depth=24"); 



Re: Using a dvcam as a web-cam in Linux
Reply #36 - Feb 15th, 2010, 12:11pm
 
I'm glad to know you managed to make it work, although you are not sure exactly how Smiley A gstreamer mystery, I guess.
Re: Using a dvcam as a web-cam in Linux
Reply #37 - May 5th, 2010, 6:05am
 
Hello,

i will also use the gsvideo for a firewire cam on Windows XP.
USB works very fine. But, if i use the pipe with Firewire 1394, the i get the message:
Quote:
0:00:01.218750000  3968   17164B78 ERROR           GST_PIPELINE grammar.tab.c:1975:_gst_parse_yyparse: no element "dv1394src"
0:00:01.218750000  3968   17164B78 ERROR           GST_PIPELINE grammar.tab.c:2564:_gst_parse_launch: Unrecoverable syntax error while parsing pipeline dv1394src ! video/x-dv ! dvdemux ! dvdec ! ffmpegcolorspace ! video/x-raw-rgb, width=720, height=480, bpp=32, depth=24 ! fakesink name=VideoSink
processing.app.debug.RunnerException: GstException: no element "dv1394src"
     at processing.app.Sketch.placeException(Unknown Source)
     at processing.app.debug.Runner.findException(Unknown Source)
     at processing.app.debug.Runner.reportException(Unknown Source)
     at processing.app.debug.Runner.exception(Unknown Source)
     at processing.app.debug.EventThread.exceptionEvent(Unknown Source)
     at processing.app.debug.EventThread.handleEvent(Unknown Source)
     at processing.app.debug.EventThread.run(Unknown Source)
Exception in thread "Animation Thread" org.gstreamer.GstException: no element "dv1394src"
     at org.gstreamer.Pipeline.launch(Pipeline.java:128)
     at codeanticode.gsvideo.GSPipeline.<init>(GSPipeline.java:93)
     at Test.setup(Test.java:58)
     at processing.core.PApplet.handleDraw(Unknown Source)
     at processing.core.PApplet.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:619)

Re: Using a dvcam as a web-cam in Linux
Reply #38 - May 5th, 2010, 6:13am
 
and when i use the 1394 firewire cam over GSCapture, then i get following error:
Quote:
0:00:01.515625000  4640   17165320 ERROR          dshowvideosrc gstdshowvideosrc.cpp:897:gst_dshowvideosrc_getcaps_from_streamcaps: Failed to retrieve IAMStreamConfig (error=0x80004002)
0:00:01.609375000  4640   17165320 ERROR          dshowvideosrc gstdshowvideosrc.cpp:751:gst_dshowvideosrc_set_caps: Can't connect capture filter with fakesink filter (error=0x80070057)
Re: Using a dvcam as a web-cam in Linux
Reply #39 - May 6th, 2010, 10:18am
 
Did you try the ksvideosrc element?

Code:

pipe = new GSPipeline(this, "ksvideosrc device-index=0 ! decodebin2 ! ffmpegcolorspace ! video/x-raw-rgb, bpp=32, depth=24");


I tested it with a fire-i camera, and works ok. I also recommend you to use the latest preview release (0.6-pre3).
Re: Using a dvcam as a web-cam in Linux
Reply #40 - May 7th, 2010, 4:54am
 
hi AC,

you are the man!!! Smiley
But i use this simple code:
i Code:
mport codeanticode.gsvideo.*;
GSPipeline pipe;
void setup()
{
size(720, 576);
pipe = new GSPipeline(this, "ksvideosrc device-index=0 ! decodebin2 ! ffmpegcolorspace ! video/x-raw-rgb, bpp=32, depth=24");
}

void draw()
{
if (pipe.available() == true)
{
pipe.read();
image(pipe, 0, 0);
}
}


and i get following errors:
Quote:
** (java.exe:3684): WARNING **: ks_video_format_to_structure returned NULL


I have deleoped a realtime echo video effect.
Windows XP (SP3), Processing, GSVIDEO, USB Microsoft HD Webcam:
http://www.flashalbum.info/#/1d770934d44de09b0d24f04fd01708ba/f213545e059a398626...

Now i will use for better quality a good mini-DV cam from sony over firewire. The Signal is 50 fps (half frames) interlaced.
I have programmed a deinterlacer for 25 fps fullframes progressiv.
Re: Using a dvcam as a web-cam in Linux
Reply #41 - May 7th, 2010, 9:27pm
 
Very neat effect!

You shouldn't worry too much about the message from gstreamer, it is just a warning. If the video capture works fine, then it is not very important Smiley
Pages: 1 2 3