GNOME Bugzilla – Bug 387251
New Plugin! : dc1394 Adds Support for firewire (1394) IIDC Cameras
Last modified: 2007-06-29 13:08:54 UTC
Here a new plugin for bad, dc1394 , it add support for 1394 IIDC cameras based on libdc1394 2.0 I was tested with the Apple iSight and the Fire-i from Unibrain Lef be done is : support for format7 (this should be done by Eric Jonas soon) and documentation Patch is against cvs from 20061218 (proper Makefile.am and configure.ac changes are done) .. just one thing I wasn't sure is if I should include in in DIST_SUBDIRS... if anyone want's to comment on that
Errors in last post read: It was tested with and ,, Left to be done... sorry
Created attachment 78587 [details] [review] Patch to add the new dc1394 plugin to bad cvs 20061218
Is it getting forward ? I'm asking because ekiga supports V4L, AVC and DC. Gstreamer has v4lsrc and dv1394src... and I'm writing support for gstreamer in ekiga.
Hi, I tried merging this today, but the code causes warnings when trying to compile it: gstdc1394.c: In function 'gst_dc1394_create': gstdc1394.c:325: warning: implicit declaration of function 'dc1394_capture_dequeue_dma' gstdc1394.c:325: error: 'DC1394_VIDEO1394_WAIT' undeclared (first use in this function) gstdc1394.c:325: error: (Each undeclared identifier is reported only once gstdc1394.c:325: error: for each function it appears in.) gstdc1394.c:325: warning: assignment makes pointer from integer without a cast gstdc1394.c:354: warning: implicit declaration of function 'dc1394_capture_enqueue_dma' gstdc1394.c: In function 'gst_dc1394_open_cam_with_best_caps': gstdc1394.c:994: warning: implicit declaration of function 'dc1394_capture_setup_dma' make[3]: *** [libgstdc1394_la-gstdc1394.lo] Error 1 Could you please fix these warnings and file an updated patch? Also the configure.ac part needs to use AG_GST_CHECK_FEATURE and not just GST_CHECK_FEATURE
I'll look at it next week... Thanks
Your errors are related to libdc1394.. what version are you using ? Either we don't have the same api or theres a problem in your cflags .. but pkgconfig should take care of it .. I'm using libdc1394 2.0.0-rc4.. I just patched the current cvs with my patch and tryed to compile with 2.0.0-rc4 and it worked ok...
Hi, I am using libdc1394-2.0.0-rc5. That said most of the time I get these kind errors it seems related to being the first one to compile the code with gcc 4.x as gcc 4.1 is more strict and thus generates more warnings for things like this.
I'm using gcc 3.4.6... Yesterday I could not d/l rc5 ,, but I have it now and it seems that the api changed :( I'll have to rework the patch
could you also please grab gcc 4.1 and compile so we can get rid of any warnings related to that?
I will...
Hi Antione, still hoping for an updated patch for this one :)
Hi, Eric Jonas, is working on it.. He's adding support for format7 cameras which he uses also It's comming soon... :)
Created attachment 90090 [details] [review] Patch for IIDC cameras This is my update of the first patch to: 1. build against rc7 / svn trunk for libdc1394 2. include support for IIDC format 7 cameras 3. build cleanly with gcc > 4.0
Created attachment 90091 [details] [review] Fixed IIDC patch with debugging printfs removed This is the patch without my printfs for debugging.
Hi Eric, The patch is not really applicable as it is as it seems to be a diff between two source structures which I don't have. Could you try to create the patch using: cvs diff -burN
Christian, I get $ cvs diff -burN ? ext/dc1394 cvs [diff aborted]: no such tag N I tried to make my patch just like Antoine made his, and when I do a checkout of the head of -bad followed by a patch -p0 < thepatch it patches cleanly. In my discussions with Antoine, it appeared that cvs can't handle the addition of new directories and new files with its diff command. I'm not really a cvs user, so please let me know if I'm doing anything obviously wrong here.
Created attachment 90101 [details] [review] Complete patch for dc1394 Okay, last time I uploaded an incorrect patch as well. The primary files to care about are the gstdc1394.[ch], everything else just modifies the build system. I can provide those independently if possible.
Thanks, this patch works well. I will try to get it comitted as soon as the current code freeze is ended.
Hi, I upgraded to gutsy. I applyied the patch, but i can't get it working flawlessly with FireWire Apple iSight. I reach to get it working one time, but it was very slow (about 1 image per second). Here is the result. Tell me if i'm wrong. bersace@thilivren:~$ sudo gst-launch-0.10 dc1394 ! ximagesink We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! Setting pipeline to PAUSED ... ERROR: Pipeline doesn't want to pause. ERROR: from element /pipeline0/dc13940: Could not negotiate format Additional debug info: gstbasesrc.c(2056): gst_base_src_start (): /pipeline0/dc13940: Check your filtered caps, if any Setting pipeline to NULL ... FREEING pipeline ... bersace@thilivren:~$ Could help me get it working ? Thanks, Étienne.
Okay, so there are a few things: 1. I often have to run it as root because I don't have my /dev permissions set up correctly for the firewire device. 2. I use sudo gst/bin/gst-launch -v dc1394 camera-number=0 buffer-size=10 ! xvimagesink sync=false The sync= is apparently necessary because of clock something something. 3. Sometimes, if the camera isn't shut down properly, the firewire stack or libdc1394 needs a reboot to come back on-line. Also, the libdc1394 distribution has a reset_bus program in the examples directory that can sometimes be of help. let me know if you have any more questions, or if that doesn't work.
Hi Eric, Ok, i too run it as root (like coriander). Your pipeline works nice except that the image is "sliced". It seems that some lines are shown at the bottom of the image. The border between the two images is random. I can't take screenshot with xvimagesink. The performances are a bit better, but it still less fluent than coriander. Regards, Étienne.
Hi, Retesting coriander, i got the same output. Also about 7 fps where i was able to get about 30 on the iMac G5 (currently testing on MacBook). Étienne.
Etienne, a screenshot of the problem would be great. Can you also give me the output of uname -a and try running your pipeline with --gst-debug=*dc1394*:5 and capture all the output? This will let me see which mode, etc. your camera is running in when using the pipeline.
Hi Eric, The screenshot is black due to Xv ! ximagesink does not work. autovideosink is slow and does not show in screenshot. bersace@thilivren:~$ uname -a Linux thilivren 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux debug output (sorry for the flood) : bersace@thilivren:~$ sudo gst-launch-0.10 -v --gst-debug=*dc1394*:5 dc1394 camera-number=0 buffer-size=10 ! xvimagesink sync=false We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! Mise du pipeline en PAUSE... 0:00:00.410953000 27648 0x804e050 LOG dc1394 gstdc1394.c:428:gst_dc1394_change_state:<dc13940> State change null to ready 0:00:00.411145000 27648 0x804e050 LOG dc1394 gstdc1394.c:431:gst_dc1394_change_state:<dc13940> State ready to paused 0:00:00.921254000 27648 0x804e050 LOG dc1394 gstdc1394.c:194:gst_dc1394_src_fixate:<dc13940> fixating caps to closest to 320x240 , 30 fps /pipeline0/dc13940.src: caps = video/x-raw-yuv, vmode=(int)67, format=(fourcc)UYVY, bpp=(int)16, width=(int)640, height=(int)480, framerate=(fraction)15/1 Le pipeline est en vie et ne nécessite pas de redémarrer ... Assignant le pipeline à PLAYING ... 0:00:00.922307000 27648 0x804e050 LOG dc1394 gstdc1394.c:446:gst_dc1394_change_state:<dc13940> State change paused to playing 0:00:00.922343000 27648 0x804e050 LOG dc1394 gstdc1394.c:1041:gst_dc1394_open_cam_with_best_caps:<dc13940> Opening the camera!!! 0:00:01.392932000 27648 0x804e050 LOG dc1394 gstdc1394.c:1049:gst_dc1394_open_cam_with_best_caps:<dc13940> Found 1 cameras 0:00:01.392978000 27648 0x804e050 LOG dc1394 gstdc1394.c:1056:gst_dc1394_open_cam_with_best_caps:<dc13940> Opening camera : 0 0:00:01.393003000 27648 0x804e050 LOG dc1394 gstdc1394.c:1072:gst_dc1394_open_cam_with_best_caps:<dc13940> The dma buffer queue size is 10 buffers 0:00:01.416830000 27648 0x804e050 LOG dc1394 gstdc1394.c:1084:gst_dc1394_open_cam_with_best_caps:<dc13940> Setting mode : 67 0:00:01.432833000 27648 0x804e050 LOG dc1394 gstdc1394.c:1092:gst_dc1394_open_cam_with_best_caps:<dc13940> Setting framerate : 35 0:00:01.628840000 27648 0x804e050 LOG dc1394 gstdc1394.c:1188:gst_dc1394_change_camera_transmission:<dc13940> got transmision status ON New clock: GstSystemClock /pipeline0/xvimagesink0.sink: caps = video/x-raw-yuv, vmode=(int)67, format=(fourcc)UYVY, bpp=(int)16, width=(int)640, height=(int)480, framerate=(fraction)15/1 ERREUR : de l'élément /pipeline0/xvimagesink0 : Output window was closed Informations de débogage supplémentaires : xvimagesink.c(1197): gst_xvimagesink_handle_xevents (): /pipeline0/xvimagesink0 Execution ended after 4439989000 ns. Mise du pipeline en PAUSE... 0:00:06.069080000 27648 0x804e050 LOG dc1394 gstdc1394.c:467:gst_dc1394_change_state:<dc13940> State change playing to paused Assignant le pipeline à READY ... /pipeline0/xvimagesink0.sink: caps = NULL /pipeline0/dc13940.src: caps = NULL 0:00:06.087213000 27648 0x804e050 LOG dc1394 gstdc1394.c:470:gst_dc1394_change_state:<dc13940> State change paused to ready 0:00:06.094294000 27648 0x804e050 LOG dc1394 gstdc1394.c:1197:gst_dc1394_change_camera_transmission:<dc13940> Stopping capture 0:00:06.095438000 27648 0x804e050 LOG dc1394 gstdc1394.c:1204:gst_dc1394_change_camera_transmission:<dc13940> Capture stoped successfully Assignant le pipeline à NULL ... 0:00:06.136231000 27648 0x804e050 LOG dc1394 gstdc1394.c:489:gst_dc1394_change_state:<dc13940> State change ready to null LIBERATION de la pipeline ... Thank you, Étienne.
can you try with ! ffmpegcolorspace ! ximagesink, and maybe capture the output? You are correctly setting the camera mode to mode 67, which is what I get as well. I have the isight working correctly with both xvimagesink and ximagesink under feisty on an amd64 box and a normal i32 box (with a crappy pcmcia firewire card to boot!)
Hi, Here is the debug output : bersace@thilivren:~$ sudo gst-launch-0.10 -v --gst-debug=*dc1394*:5 dc1394 camera-number=0 buffer-size=10 ! ffmpegcolorspace ! ximagesink We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! We should never get here; invalid color mode!! Mise du pipeline en PAUSE... 0:00:00.722085000 3986 0x804e050 LOG dc1394 gstdc1394.c:428:gst_dc1394_change_state:<dc13940> State change null to ready 0:00:00.722346000 3986 0x804e050 LOG dc1394 gstdc1394.c:431:gst_dc1394_change_state:<dc13940> State ready to paused 0:00:01.349624000 3986 0x804e050 LOG dc1394 gstdc1394.c:194:gst_dc1394_src_fixate:<dc13940> fixating caps to closest to 320x240 , 30 fps /pipeline0/dc13940.src: caps = video/x-raw-yuv, vmode=(int)67, format=(fourcc)UYVY, bpp=(int)16, width=(int)640, height=(int)480, framerate=(fraction)15/1, pixel-aspect-ratio=(fraction)1/1 Le pipeline est en vie et ne nécessite pas de redémarrer ... Assignant le pipeline à PLAYING ... 0:00:01.350814000 3986 0x804e050 LOG dc1394 gstdc1394.c:446:gst_dc1394_change_state:<dc13940> State change paused to playing 0:00:01.350851000 3986 0x804e050 LOG dc1394 gstdc1394.c:1041:gst_dc1394_open_cam_with_best_caps:<dc13940> Opening the camera!!! 0:00:01.905187000 3986 0x804e050 LOG dc1394 gstdc1394.c:1049:gst_dc1394_open_cam_with_best_caps:<dc13940> Found 1 cameras 0:00:01.905234000 3986 0x804e050 LOG dc1394 gstdc1394.c:1056:gst_dc1394_open_cam_with_best_caps:<dc13940> Opening camera : 0 0:00:01.905262000 3986 0x804e050 LOG dc1394 gstdc1394.c:1072:gst_dc1394_open_cam_with_best_caps:<dc13940> The dma buffer queue size is 10 buffers 0:00:01.932752000 3986 0x804e050 LOG dc1394 gstdc1394.c:1084:gst_dc1394_open_cam_with_best_caps:<dc13940> Setting mode : 67 0:00:01.952896000 3986 0x804e050 LOG dc1394 gstdc1394.c:1092:gst_dc1394_open_cam_with_best_caps:<dc13940> Setting framerate : 35 0:00:02.152853000 3986 0x804e050 LOG dc1394 gstdc1394.c:1188:gst_dc1394_change_camera_transmission:<dc13940> got transmision status ON New clock: GstSystemClock /pipeline0/ffmpegcsp0.src: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)640, height=(int)480, framerate=(fraction)15/1, pixel-aspect-ratio=(fraction)1/1, vmode=(int)67 /pipeline0/ffmpegcsp0.sink: caps = video/x-raw-yuv, vmode=(int)67, format=(fourcc)UYVY, bpp=(int)16, width=(int)640, height=(int)480, framerate=(fraction)15/1, pixel-aspect-ratio=(fraction)1/1 /pipeline0/ximagesink0.sink: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)640, height=(int)480, framerate=(fraction)15/1, pixel-aspect-ratio=(fraction)1/1, vmode=(int)67 ERREUR : de l'élément /pipeline0/ximagesink0 : Output window was closed Informations de débogage supplémentaires : ximagesink.c(1061): gst_ximagesink_handle_xevents (): /pipeline0/ximagesink0 Execution ended after 15856211000 ns. Mise du pipeline en PAUSE... 0:00:18.009362000 3986 0x804e050 LOG dc1394 gstdc1394.c:467:gst_dc1394_change_state:<dc13940> State change playing to paused Assignant le pipeline à READY ... /pipeline0/ximagesink0.sink: caps = NULL /pipeline0/ffmpegcsp0.src: caps = NULL /pipeline0/ffmpegcsp0.sink: caps = NULL /pipeline0/dc13940.src: caps = NULL 0:00:18.635312000 3986 0x804e050 LOG dc1394 gstdc1394.c:470:gst_dc1394_change_state:<dc13940> State change paused to ready 0:00:18.648908000 3986 0x804e050 LOG dc1394 gstdc1394.c:1197:gst_dc1394_change_camera_transmission:<dc13940> Stopping capture 0:00:18.649878000 3986 0x804e050 LOG dc1394 gstdc1394.c:1204:gst_dc1394_change_camera_transmission:<dc13940> Capture stoped successfully Assignant le pipeline à NULL ... 0:00:18.738597000 3986 0x804e050 LOG dc1394 gstdc1394.c:489:gst_dc1394_change_state:<dc13940> State change ready to null LIBERATION de la pipeline ... bersace@thilivren:~$
Created attachment 90238 [details] Result with dc1394 and ffmpegcolorspace This is not exactly the result i got, but, very similar.
I went to try this patch out today, and found out a while later that it only works with libdc1394 v2.0.0-rc5 and above. Even in Ubuntu Feisty, they've only got 1.1.0 however. Does anyone have any idea what the deal is with that? I wonder, is it hard to support both 1.1.0 and 2.0.0 APIs switching at compile time?
(In reply to comment #28) > Even in Ubuntu Feisty, they've only got 1.1.0 however. Does anyone have any > idea what the deal is with that? > It should build against the svn trunk, although there is some active churn. > I wonder, is it hard to support both 1.1.0 and 2.0.0 APIs switching at compile > time? The APIs are quite different, but you're welcome to submit a patch.
Sorry, I meant "what's the deal with Ubuntu not having a more recent libdc1394 available?" - the 1.1/1.2 and 2.0 libs are parallel installable, right?
Comitted with one small change - I renamed the element dc1394src instead of dc1394, to better match the naming convention of all our other source elements (and to save confusion in case someone one day creates a dc1394sink) Thanks! 2007-06-29 Jan Schmidt <thaytan@mad.scientist.com> * configure.ac: * ext/Makefile.am: * ext/dc1394/Makefile.am: * ext/dc1394/gstdc1394.c: (gst_dc1394_base_init), (gst_dc1394_class_init), (gst_dc1394_init), (gst_dc1394_src_fixate), (gst_dc1394_set_property), (gst_dc1394_get_property), (gst_dc1394_getcaps), (gst_dc1394_setcaps), (gst_dc1394_get_times), (gst_dc1394_create), (gst_dc1394_parse_caps), (gst_dc1394_change_state), (gst_dc1394_caps_set_format_vmode_caps), (gst_dc1394_set_caps_color), (gst_dc1394_set_caps_framesize), (gst_dc1394_set_caps_framesize_range), (gst_dc1394_caps_set_framerate_list), (gst_dc1394_framerate_const_to_frac), (gst_dc1394_get_all_dc1394_caps), (gst_dc1394_get_cam_caps), (gst_dc1394_framerate_frac_to_const), (gst_dc1394_open_cam_with_best_caps), (gst_dc1394_change_camera_transmission), (plugin_init): * ext/dc1394/gstdc1394.h: Commit new dc1394src element. Patch By: Eric Jonas < jonas at mit dot edu > Close: #387251
Oops, sorry - added an attribution for Antoine too to the ChangeLog, since he's the original author :) Patch By: Antoine Tremblay < hexa00 at gmail dot com >