After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 387251 - New Plugin! : dc1394 Adds Support for firewire (1394) IIDC Cameras
New Plugin! : dc1394 Adds Support for firewire (1394) IIDC Cameras
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-18 19:00 UTC by Antoine Tremblay
Modified: 2007-06-29 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add the new dc1394 plugin to bad cvs 20061218 (35.87 KB, patch)
2006-12-18 19:03 UTC, Antoine Tremblay
none Details | Review
Patch for IIDC cameras (40.48 KB, patch)
2007-06-16 19:25 UTC, eric jonas
none Details | Review
Fixed IIDC patch with debugging printfs removed (2.35 KB, patch)
2007-06-16 19:31 UTC, eric jonas
none Details | Review
Complete patch for dc1394 (40.08 KB, patch)
2007-06-16 21:40 UTC, eric jonas
none Details | Review
Result with dc1394 and ffmpegcolorspace (510.43 KB, image/png)
2007-06-18 21:05 UTC, Étienne Bersac
  Details

Description Antoine Tremblay 2006-12-18 19:00:51 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
Comment 1 Antoine Tremblay 2006-12-18 19:02:22 UTC
Errors in last post read:

It was tested with and ,, Left to be done...

sorry
Comment 2 Antoine Tremblay 2006-12-18 19:03:21 UTC
Created attachment 78587 [details] [review]
Patch to add the new dc1394 plugin to bad cvs 20061218
Comment 3 Snark 2007-02-21 19:29:06 UTC
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.
Comment 4 Christian Fredrik Kalager Schaller 2007-03-02 11:47:50 UTC
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
Comment 5 Antoine Tremblay 2007-03-02 22:10:48 UTC
I'll look at it next week...

Thanks
Comment 6 Antoine Tremblay 2007-03-08 22:44:43 UTC
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...






Comment 7 Christian Fredrik Kalager Schaller 2007-03-09 16:16:58 UTC
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.
Comment 8 Antoine Tremblay 2007-03-09 16:26:08 UTC
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 

Comment 9 Christian Fredrik Kalager Schaller 2007-03-09 16:37:28 UTC
could you also please grab gcc 4.1 and compile so we can get rid of any warnings related to that?
Comment 10 Antoine Tremblay 2007-03-09 16:38:43 UTC
I will...
Comment 11 Christian Fredrik Kalager Schaller 2007-06-07 16:44:21 UTC
Hi Antione, still hoping for an updated patch for this one :)
Comment 12 Antoine Tremblay 2007-06-07 17:41:00 UTC
Hi,

Eric Jonas, is working on it.. He's adding support for format7 cameras which he uses also

It's comming soon... :)
Comment 13 eric jonas 2007-06-16 19:25:55 UTC
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
Comment 14 eric jonas 2007-06-16 19:31:59 UTC
Created attachment 90091 [details] [review]
Fixed IIDC patch with debugging printfs removed

This is the patch without my printfs for debugging.
Comment 15 Christian Fredrik Kalager Schaller 2007-06-16 20:58:53 UTC
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 

Comment 16 eric jonas 2007-06-16 21:34:18 UTC
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. 
Comment 17 eric jonas 2007-06-16 21:40:06 UTC
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.
Comment 18 Christian Fredrik Kalager Schaller 2007-06-16 23:01:29 UTC
Thanks, this patch works well. I will try to get it comitted as soon as the current code freeze is ended.
Comment 19 Étienne Bersac 2007-06-17 12:28:00 UTC
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.
Comment 20 eric jonas 2007-06-17 19:47:53 UTC
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. 
Comment 21 Étienne Bersac 2007-06-17 19:58:04 UTC
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.
Comment 22 Étienne Bersac 2007-06-17 20:02:50 UTC
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.
Comment 23 eric jonas 2007-06-18 12:44:44 UTC
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.  
Comment 24 Étienne Bersac 2007-06-18 13:27:37 UTC
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.
Comment 25 eric jonas 2007-06-18 19:59:15 UTC
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!) 
Comment 26 Étienne Bersac 2007-06-18 20:56:56 UTC
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:~$ 

Comment 27 Étienne Bersac 2007-06-18 21:05:31 UTC
Created attachment 90238 [details]
Result with dc1394 and ffmpegcolorspace

This is not exactly the result i got, but, very similar.
Comment 28 Jan Schmidt 2007-06-29 11:26:15 UTC
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?
Comment 29 eric jonas 2007-06-29 12:10:55 UTC
(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. 

Comment 30 Jan Schmidt 2007-06-29 12:28:27 UTC
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?

Comment 31 Jan Schmidt 2007-06-29 13:05:36 UTC
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
Comment 32 Jan Schmidt 2007-06-29 13:08:54 UTC
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 >