Questions about coding own source and sink

Derek Kulinski takeda at takeda.tk
Thu Dec 22 13:26:02 PST 2011


Hello everyone,

I'm writing my own source and sink which is intended for network
transmission and I have several questions.

I'm using Python to code it and I am using
http://pygstdocs.berlios.de/pygst-reference/index.html as a reference.
I noticed that the page (and also the reference on on the svn
repository) haven't been updated since 2007.
Many functions and even some classes e.g. BaseSrc class is not even
described there.
I tried to follow the source of py-gst, but it's a bit hard since
looks like the file is automatically generated.
Is there a more up to date reference? I eventually figured out based
on examples how I can make my own source and sink in python and it
seems to work, but having a complete reference would be extremely
useful.
If you can only provide answers to some of the questions that's still
extremely helpful.

I also have other questions, having answers how to do it in Python is
welcomed, but anything that would direct me where to find the answer
is also appreciated.

I must say I am fairly new to GST, or video streaming in general so
please excuse me if those questions are dumb.

The GST provides a time stamp with each buffer. The time is in
resolution of nanoseconds. I'm wondering if it is possible to receive
a timecode from device (if it provides) or if not I can calculate it
myself, if I have fps of the source.
How I can I get that information when I'm at the last part of the
pipeline and I'm receiving already encoded binary data?

Similarly how can I get current frame number? From the documentation
it looks like if the stream is not encoded, the offset often will be a
frame, but since at that stage I'm receiving encoded stream, the
offset is a byte offset.

If I can get the above information, is there also a way of getting a
frame type? (e.g. key frame, I/B frame etc?) How can I do that?

I'm testing my code with a capture card that has 4 inputs and 1
virtual one (with 4 all of them combined). The card is compatible with
video4linux2 and uses /dev/video0 to provide all of those inputs.
For example in mplayer I can access the inputs using
tv:///0 - first
tv:///3 - fourth
tv:///4 - all combined

Is there a way to specify which inputs I want to use in GST? I
currently can use v4l2-ctl with -i option to switch, but that probably
won't work if I would want to stream all 4 inputs at the same time.

Thank you for any help.
-- 
Best regards,
 Derek                          mailto:takeda at takeda.tk

I couldn't repair your brakes, so I made your horn louder.



More information about the gstreamer-devel mailing list