Porting DC1394 plugin to 1.x

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Porting DC1394 plugin to 1.x

Ryan Talbot
Greetings!

I have a need to capture frames from a Point Grey Flea3, and later a Ximea brand camera, both connected via USB 3.0.  I've managed to write a small test program to capture frames in our required fromat from the Flea3 using libdc1394, but ultimately I need to feed these frames into a GStreamer pipeline.  I could not find a readily available plugin that acts as a source for IIDC cameras in general or Point Grey models in particular, save for the dc1394 plugin from the GStreamer 0.10 "bad" plugins repository.  I'd like to use GStreamer 1.x, though, so that doesn't help me out of the box, and I've decided to try and port it.

I'm a newcomer to GStreamer and GLib.  I've read through the plugin writer's guide and the porting 0.10-to-1.0 documents, and skimmed the code for v4l2src.  I currently have the dc1394src ported enough so that the following produces an output file of the expected size:

gst-launch-1.0 dc1394src num_buffers=20 ! video/x-bayer,width=2080,height=1552,framerate=60/1,vmode=88,bpp=8,format=rggb ! bayer2rgb ! videoconvert ! filesink location=testdc1394src.rgb

This also seems to produce an H264 stream that VLC can at least recognize (fails to play due to some inability to resize itself on this display, though):

gst-launch-1.0 dc1394src num_buffers=60 ! video/x-bayer,width=2080,height=1552,framerate=60/1,vmode=88,bpp=8 ! bayer2rgb ! videoconvert ! queue ! x264enc speed-preset=ultrafast ! filesink location=testdc1394src.h264

Where I'm running into trouble, is when I try to add an mp4mux element to the pipeline:

gst-launch-1.0 dc1394src num_buffers=60 ! video/x-bayer,width=2080,height=1552,framerate=60/1,vmode=88,bpp=8 ! bayer2rgb ! videoconvert ! queue ! x264enc speed-preset=ultrafast ! mp4mux ! filesink location=testdc1394src.mp4
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...

(gst-launch-1.0:21468): GStreamer-CRITICAL **: gst_segment_to_running_time: assertion 'segment->format == format' failed

...(repeated for each frame)...

Got EOS from element "pipeline0".
Execution ended after 0:00:01.645092401
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...


All I get is a garbage MP4 file that is only 1480 bytes in size.

I've turned debugging on in the various modules, but nothing is jumping out at me as being the problem.

I would love any insight as to where to go from here.

Thanks in advance,
Ryan Talbot

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porting DC1394 plugin to 1.x

Sebastian Dröge-3
On Di, 2016-04-12 at 10:22 +0000, Ryan Talbot wrote:

>
> (gst-launch-1.0:21468): GStreamer-CRITICAL **:
> gst_segment_to_running_time: assertion 'segment->format == format'
> failed

This probably means that your source does not produce a segment in TIME
format, it should.

Also for mp4mux, use the -e switch on gst-launch-1.0 to make sure it
has the opportunity to finalize the file. Without you will only get
broken files.

>
> I've turned debugging on in the various modules, but nothing is
> jumping out at me as being the problem.
>
> I would love any insight as to where to go from here.

The best would be if you could file a bug with your porting patch, and
then we can get it reviewed there and integrated once everything's
looking good :) Thanks!

https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Porting DC1394 plugin to 1.x

Ryan Talbot
>>
>>
>> (gst-launch-1.0:21468): GStreamer-CRITICAL **:
>> gst_segment_to_running_time: assertion 'segment->format == format'
>> failed
>
>This probably means that your source does not produce a segment in TIME
>format, it should.

That was the case, indeed!  It's working now, although the caps negotiation leaves a lot to be desired.  As long as all of the caps are spelled out downstream, it will perform.

>>
>> I would love any insight as to where to go from here.
>
>The best would be if you could file a bug with your porting patch, and
>then we can get it reviewed there and integrated once everything's
>looking good :) Thanks!

I will certainly do that as soon as I can :)!

Thanks, and another thanks to __tim on #gstreamer for also suggesting the TIME format fix!
________________________________________
From: gstreamer-devel [[hidden email]] on behalf of Sebastian Dröge [[hidden email]]
Sent: Wednesday, April 13, 2016 3:36 AM
To: Discussion of the development of and with GStreamer
Subject: Re: Porting DC1394 plugin to 1.x

On Di, 2016-04-12 at 10:22 +0000, Ryan Talbot wrote:

>
> (gst-launch-1.0:21468): GStreamer-CRITICAL **:
> gst_segment_to_running_time: assertion 'segment->format == format'
> failed

This probably means that your source does not produce a segment in TIME
format, it should.

Also for mp4mux, use the -e switch on gst-launch-1.0 to make sure it
has the opportunity to finalize the file. Without you will only get
broken files.

>
> I've turned debugging on in the various modules, but nothing is
> jumping out at me as being the problem.
>
> I would love any insight as to where to go from here.

The best would be if you could file a bug with your porting patch, and
then we can get it reviewed there and integrated once everything's
looking good :) Thanks!

https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel