DLNA profile detection & automatic transcoding



Hi everyone,
   I am about to merge some new cool DLNA stuff into gupnp-av that not
only benefits Rygel but also any MediaServer based on gupnp-av, so I
thought I share some information about it before I do:

1. DLNA profile detection:

  Every gupnp-av users know that we really miss good DLNA profile
guessing APIs in gupnp-av. Currently we have some very simple guessing
for some profiles and its far from being complete or accurate. The
issue wasn't a simple one to solve as for a proper implementation you
need a lot more info that whats available in DIDL-Lite properties.
While I was wondering how to best solve this issue, Edward Hervey came
along with his GstDiscoverer idea. GstDiscoverer in simple words is a
gstreamer-based metadata harvesting API that is not just much easier
to use (hiding low-level gstreamer details) but does the task much
much faster than if you do the same using playbin/decodebin. The
result of his work is going into a package called gst-convenience[1],
which upon reaching API stability will be merged into
gst-plugins-base.

  So we decided to make use of those efforts and we (mostly Arun
Raghavan from Collabora Multimedia) have been working on
implementation of a subclass of GstDiscoverer [2] in gupnp-av,
GUPnPDLNADiscoverer that adds DLNA profile information to all the
information extracted by its parent class. The DLNA profile
information is kept on disk in a set of XML files and hence addition
of new DLNA profiles and editing/removing existing ones is easily
possible without any coding or modification to gupnp-av.

2. Fully automatic transcoding:

  Although there is nothing related to transcoding in gupnp-av, Rygel
implements transcoding using gstreamer. Thanks to GStreamer's
decodebin2 element, transcoding is pretty much format agnostic on the
source side (i-e it can transcode from any format that GStreamer can
handle). However, since there was no encodebin so far, we not only
needed custom code for each transcoding target, the encoding/muxing
part (used gst elements) was hardcoded.

  The gst-convenience library mentioned above also provides this very
much needed element and I already have ported Rygel's transcoders to
make use of this in a branch[3]. The result was not just much simpler
code but we no longer have the hardcoded the encoding pipeline.
However the transcoding formats are still pretty much static and it
would be really nice to make them dynamic: (advanced) user be able to
specify the DLNA profiles which needs to be offered to the client in
the config file (or command-line option) and rygel be able to
construct the needed pipeline at runtime when a client device requests
the transcoded stream without any prior knowledge about the DLNA
profile in question.

  An encodebin needs to be given something called encoding profile to
inform it about the target format. A nice coincidence was that Arun
was already using these encoding profiles to represent the DLNA
profiles in memory so we figured that an API that provides the
encoding profile given the name of the DLNA profile will allow us to
achieve our goal.
-------------

  While #1 is pretty much working already and Arun's recent work on
this has mostly been about populating the default DLNA profile
database, the API to fetch encoding profile given the DLNA profile
name is still at its infancy. I want to merge the #1 already in
gupnp-av and get unstable release out already to get things working in
time for GNOME 3.0, which Rygel is now part of and gupnp will soon
become a blessed dependency in. Hopefully the encoding profile APIs
will also be ready for a merge soon.

  Now all this sounds really exciting, however we have one issue:
gst-convenience library this all depends on, according to Edward will
not be getting merged into gst-plugins-base for another two months. We
can wait for that to happen but that will be too late to get it tested
(by many people) before GNOME 3.0 and we wouldn't want that to happen.
So as a temporary workaround, Arun and I have decided to move the
gst-convenience (its not really big) into gupnp-av. Arun has promised
to make sure that this internalized copy is up2date every week. Once
gst-convenience is merged into gst-plugins-base, we'll get rid of this
internalized copy.

  Thats it folks! Thanks a lot to Arun for all this work he has been
doing for the past some months. He not only implemented these APIs but
also has been fixing things in gst-convenience and different gstreamer
plugins whenever needed.

--
Regards,

Zeeshan Ali (Khattak)
FSF member#5124

[1] http://git.collabora.co.uk/?p=user/edward/gst-convenience.git
[2] http://gitorious.org/~arunsr/gupnp/dlna-profile
[3] http://gitorious.org/rygel/rygel/commits/encodebin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]