On 09/29/2010 09:42 AM, Albrecht Schlosser wrote:
> On 28.09.2010, at 23:27, Paul E. Rybski wrote:
>
>> My question is:  has anybody tried integrating FLTK and gstreamer (or
>> even GTK+) into the same application?  I'm concerned that gstreamer may
>> be far too deeply embedded into GTK+ that it may be more efficient for
>> me to learn GTK+ and just re-do my GUI in that framework.  I hope that
>> this isn't the case...
>>
> 
> I'd say it depends on what you're doing and what you want to do. If you're
> only using gstreamer like library functions w/o opening windows, then
> you may be able to use FLTK for your GUI w/o hassle. It's still tricky
> to synchronize a data stream with a GUI to view videos, but that's
> another story.
> 
> However, it becomes tricky if gstreamer would open windows and interpret
> the system messages (be it Windows messages or X11 or ...). You should
> maybe describe more detailed what the part of gstreamer would be in
> your app and what else you want to do.
> 
> I took a short look at gstreamer.net, but didn't see any relations to
> GUI dependencies (but it was really short).

Hi,
        The basic idea is that I'm transmitting audio and video streams from
one linux box and capturing them on another linux box.  Currently I'm
using gstreamer from the command-line (using gst-launch--see below for
my exact commands) to both of these.  gstreamer has a number of video
"sinks" that will display a video stream in a pop-up window.  Now, what
I *want* to do is to capture this video stream and display the live
frames of video in an fltk window instead of the gstreamer pop-up that I
get from the command line.  I've done this kind of video display in fltk
before but those times I was reading directly from a V4L or dc1394
interface with my application.

Now, I'm still learning what gstreamer can and can't do and I've only
explored the command-line usage of it rather than the C API that appears
to be heavily embedded into the GTK framework.  As far as I can tell,
what I need to try to do is to use the gstreamer C API and embed the
receive pipeline into my fltk application.  What I have no clue about is
how I actually take the data from the pipeline and display it in an fltk
application.  I'd *like* to be able to unpack the raw RGB data from each
received frame of video and then use the fl_draw* commands to display it
(which is how I've done that in the past).  However, gstreamer is very
hard to get into and the documentation appears to be very sketchy at
best so I haven't found any easy way for me to be able to do that yet.
Alternatively, I might try to use a GTK widget embedded into the FLTK
application (kind of like how FLTK embeds GL) and use the existing GTK
API to display the gstreamer video instead.

Another option I'm considering is to have the client receive the video
stream and then re-transmit it over a TCP socket that my FLTK
application listens to.  I think I can re-encode the video as a series
of JPEG images and then I think I could use libjpeg to decompress the
received data and display it in my GUI.  To me that seems a bit kludgy
but I understand sockets a lot better than I do GTK...

For anybody who is interested, here's the command line that I use to
capture video from my V4L webcam and audio from the built-in microphone
using ALSA.  I save the combined stream to an ogg movie file and then
send the audio and video on separate UDP streams:

gst-launch-0.10 -vm oggmux name=mux ! filesink location=movie.ogg v4lsrc
! video/x-raw-yuv,width=320,height=240 ! tee name=t_vnet ! queue !
ffmpegcolorspace ! smokeenc qmin=1 qmax=50 ! udpsink port=5000
host=localhost sync=false t_vnet. ! queue ! videorate !
'video/x-raw-yuv' ! theoraenc ! mux. alsasrc device=hw:0,0 !
audio/x-raw-int,rate=48000,channels=2,depth=16 ! tee name=t_anet ! queue
! audioconvert ! flacenc ! udpsink port=4000 host=localhost sync=false
t_anet. !queue ! audioconvert ! vorbisenc ! mux.

Then on the other end, here's the stream that I use to receive the audio
and video.  The video is displayed in its own window and the audio goes
through the speakers:

gst-launch-0.10 -vm tee name=vid -vm udpsrc port=5000 ! smokedec !
xvimagesink vid. !tee name=aud udpsrc port=4000 ! flacdec ! audioconvert
! audioresample ! alsasink sync=false aud.


-Paul

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to