Creating elements for the first time takes ages

Ralph ralph.gucwa at racelogic.co.uk
Fri Jun 22 02:12:28 PDT 2012


Bruno Gonzalez-2 wrote
> 
> I have also experienced the same. You can try several solutions:
>  - Parallelize the creation of each pipeline element as much as possible
> [...]
> 

I'm already doing this - I'm creating all necessary pipelines when the
program starts, but this results in 11 second total startup time (2 seconds
for my application and 9 seconds for GStreamer) and that's on a very fast
machine.  For users with netbooks and old laptops (majority of users, the
software is mostly used in the field) this becomes unacceptably slow.  I try
to cheat - I display a welcome screen with recently used files and a few
other options and GStreamer is initialized in the background.  If the user
spends those 9 seconds choosing the file to be opened he will not notice any
delay, but when he clicks any of recently used files straight away (90% of
cases), the initialization will be long (extremely long on slow machines). 
Parallelizing does not help because it is creating the first element that
takes 8 seconds, creating all other elements required for 6 pipelines takes
less than 1 second.



David  Hoyt wrote
> 
> I would advocate a shift to using the official gstreamer SDK. The provided
> build is a little more up-to-date. However, I don't believe the .NET
> bindings are provided...
> 

I would be happy to start using GStreamer SDK, but as you noticed there are
no .NET bindings.  This is real pain - accessing GStreamer from .NET is so
buggy and unreliable, that I am not surprised there are just a few .NET
applications using it and it is extremely difficult to find any
documentation and examples on the net.  I have spent days trying to do
things that "just work" in other languages, but for some reason do not work
at all or crash when doing them using C# bindings.  What a shame, GStreamer
is probably the most powerful video library ever created.



David  Hoyt wrote
> 
> Have you tried to build a similar pipeline using gst-launch? If so, how
> quickly does that work? It would help to isolate if it's the .NET or the C
> side of the house. Sometimes the initial call can take longer as the
> gstreamer registry is built.
> 

Executing "gst-launch.exe gnlfilesource" for the first time after system
restart takes less than 3 seconds.  This is understandable, GStreamer
initialization and searching for plugins takes a while.  All subsequent
calls to gst-launch (also creating any other elements) are instantaneous.



Edward Hervey wrote
> 
>  I'm not sure how those bindings work, but I'm going to say they are
> dynamically generated (i.e. at runtime), and you've it the place where
> it generates the bindings.
> 

What brings my attention is that System.Reflection.Assembly.GetTypes is
called 2471 times.  The total number of GStreamer files I am using is 67 (35
files in bin folder, 30 plugins, gstreamer-sharp.dll and
gstreamersharpglue-0.10.dll).  Are all assemblies in the system analyzed??? 
System.RuntimeType.IsDefined(Type, Boolean) is called 1.2 million times,
that A LOT!


--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Creating-elements-for-the-first-time-takes-ages-tp4655367p4655384.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list