After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 118142 - [API] encoder interface
[API] encoder interface
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Low enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 593466 630751 668095
 
 
Reported: 2003-07-23 19:13 UTC by Christian Fredrik Kalager Schaller
Modified: 2018-11-03 11:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GStreamer Encoding Profiles patch (for gst-plugins) (57.09 KB, patch)
2004-03-29 00:51 UTC, Ronald Bultje
rejected Details | Review
Profile Editor (326.03 KB, application/octet-stream)
2004-03-29 00:53 UTC, Ronald Bultje
  Details
New proposal (10.30 KB, text/plain)
2005-03-17 09:47 UTC, Ronald Bultje
  Details

Description Christian Fredrik Kalager Schaller 2003-07-23 19:13:59 UTC
This bug is a followup to issues raised in bug 112014.
We need an interface and/or standard parameters for encoder quality
Comment 1 Ronald Bultje 2004-03-29 00:51:15 UTC
Created attachment 26040 [details] [review]
GStreamer Encoding Profiles patch (for gst-plugins)

This patch adds a GStreamer Encoding Profile interface + library backend to
GStreamer. This is an element interface with one single function, i.e. to
retrieve a list of default (provided) profiles from the element. Next to that,
it allows setting user-specified profiles. A profile, like in Thomas' initial
proposal, consist of a combination of (GObject) properties. The lib provides
some wrapper functions to edit/add/remove profiles, set profiles (which is a
set_property() wrapper), and some more.
Comment 2 Ronald Bultje 2004-03-29 00:53:31 UTC
Created attachment 26041 [details]
Profile Editor

This is a Profile Editor based on the backend in the first patch. It is a
GNOME-2.4 UI (didn't update it to gtk-2.4 yet; it uses the deprecated
GtkOptionMenu widget) based on a Glade XML file.
Comment 3 Ronald Bultje 2004-03-29 16:10:01 UTC
[ adding PATCH keyword ]

Some notes on the above patch:
* I'm not happy with the XML code. Someone with knowledge should give me some
advise on how to save profiles to disk, where & such (specifically, how do I
avoid duplicate entries in system/user registries [should I?], do I want to poll
profiles or just open the file once and be done with it, ...).
* I currently only support elements which implement the interface, though there
is no real reason for this limitation. I can remove it, so do we want that? The
interface then only exists for elements providing default profiles.
Comment 4 Stephane Loeuillet 2004-12-12 22:04:43 UTC
aren't media profiles in gnome since gnome 2.6/gstreamer 0.8 ?
Comment 5 Ronald Bultje 2004-12-13 00:13:06 UTC
They're not enough for video yet.
Comment 6 Ronald Bultje 2005-03-16 10:55:39 UTC
Marking previous patch as rejected, it doesn't solve the issues the way we want
to. I've been discussing this issue with Edward multiple times recently, I'll
put a log here when we've got a proposal that we think solves the problem
adequately.
Comment 7 Ronald Bultje 2005-03-17 09:47:12 UTC
Created attachment 38831 [details]
New proposal

Attached is a new proposal from me and edward, which we think suits our needs,
is a good, viable and long-term replacement for GNOME audio profiles and is
both fluent enough to allow for more complex cases as well as still simple to
actually be a useful helper for our goal.
Comment 8 Ronald Bultje 2005-03-17 10:19:19 UTC
I got some questions on how to handle the difference between video/audio
profiles. This is implicit. Every profile will consist of a muxer (or not) with
request/always pad templates. Based on this and the caps, we already know the
amount of required and supported audio/video links. The subprofile linked at
front (which is 1-to-1) is then unimportant. I'll write a utility function for that.

Here's how elements should work:
avimux:
* one always video pad
* a request pad template for audio (0, n)
oggmux:
* one request serial pad template (0, n)
wavparse:
* one always audio pad
mplex:
* a request video pad template, with one always available (created on _init, not
released during _release_request_pad()) - (1, n)
* request audio/subtitle pads (0, n)
matroskamux:
* request (0, n) video/audio pads

Then, the utility function simply goes through all pad templates on the bin,
iterates pad templates and sees whether the 'application requires/provides
input' matches a template. If, after iterating, one or more always pad templates
(or existing pads) are unlinked, or one did not match, then the application does
not want to use this profile. Else it does.

Example 1, gnome-sound-recorder (provides one audio):
avimux: audiopad matches, but always videopad unlinked - no display
matroskamux: audiopad matches, no always pads unlinked - display
mplex: audiopad matches, but one existing requestpad unlinked - no display
wavparse: audiopad matches, no pads left - display
[etc.]

Example 2, Cupid (provides one video, one audio):
avimux: videopad matches, audiopad matches, none left - display
matroskamux: same
mplex: same
wavparse: audiopad matches, video doesn't match any pad - no display

The logic is not that much code, and if we provide a utility function,
applications won't even notice.
Comment 9 Ronald Bultje 2005-03-17 13:20:58 UTC
Here's some first tries at user interfaces for profile editing (using my
knowledge of my previous failed attempt). This has nothing to do with
applications, they will just have a selectionbox.

#1 - main window
http://ronald.bitfreak.net/priv/profile-main.jpg
Main window, list of profiles, create new, delete, edit, simple as that.

#2 - edit or create profile
http://ronald.bitfreak.net/priv/profile-edit.jpg
It has a name, and the thing below is a gnomecanvas... I want to draw something
similar to gst-editor, but a lot simpler... basically stacked subprofiles
(vertically) linked in order (horizontally). Each subprofile is clickable to
edit/delete, and add makes a new one.

#3 - edit or create a sub-profile
http://ronald.bitfreak.net/priv/profile-sub-edit.jpg
Also see the text. Name, list of other subprofiles for linking at input (all
checkbuttons), same for output; in between a list of components (elements or
filters) which, in that order, make up the subprofile.
Element edit/add is done using the gst-editor element selection widget.
Edit/create filter is done by clicking an element, then it'll ask for
source/sink-side (for add), and then picks the template caps (or the
intersection, if the element is linked) and provide that as options, and you'll
be able to select properties like in the ascii mockup in the text.
Comment 10 Andy Wingo 2006-01-27 15:51:43 UTC
Assigning to Mr. Hervey.
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2007-03-01 08:07:52 UTC
If combined with the preset iface I propose in bug #396779 then the profile only needs to deal with which elements get linked in which order and which (named) preset shall be used on each element.
Comment 12 Sebastian Dröge (slomo) 2007-07-11 07:17:38 UTC
Any progress on this?
Comment 13 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-17 14:34:55 UTC
The preset iface solves the problem, where a couple of fixed settings make sense. For media encoding it means we limit the user to select between e.g. quality={poor, average, high}.

Is that good enough? The we should implement presets for encoders and close the bug.
 
Or do we want an interface that allows to configure the quality from 0% to 100% on elements:
* jpegenc would translate that directly to jpeg quality
* audio/video encoders would map that to a good bitrate-range (depending on resolution?)

The iface could have the following methods:
_set_quality(gfloat quality);
_get_quality();
_get_description();
The latter would return a textual description suitable for showing in a ui (e.g. resulting bitrate).
Comment 14 Ronald Bultje 2008-06-17 15:45:41 UTC
As a complete outsider, I disagree with that. Limiting yourself to such an uninteresting subset of codec features will ensure that nobody will use it or take it seriously.

Take a look at win32/MacOSX graphical encoders. They go from the ground up to provide control of all details. what kind of block do you use for quantization? 4x4? 4x8? Some codecs only support one, some multiple, etc. Quality of output is very different in each case. Global Motion Compensation or only per-block? Look at all options that high-quality MPEG-4 encoders provide. Look at h.264. A float that describes "quality" is just insufficient.

What you want is layers, and your design needs to address this. At the basis, you want control of all individual codec options, with selection boxes. I'm sure GObject properties could be used for this, but you need flags that tell you which ones affect codec quality.

On top of that, you could use a series of "presets" (in a different manner of the word) that combine multiple codecs/filters plus pre-set properties to describe a subset of a pipeline encoding a media.  Users could take a global approach and select "high quality ogg/vorbis" or "low quality 8-bit PCM audio", as in the current profiles in gnome-media. Or they could specify their own and add GMC, 16x16 block encoding etc. in h/264 with AC3 audio at a 192bps bitrate, 5-channels etc.
Comment 15 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-17 17:44:05 UTC
Ronald, you got my a bit wrong. I am aware of all those options. My pov is that they are overwhelming for most users. For expert users we can just generate a UI that simply offers all parameters in a UI. And we can provide snapshots of parameter-set as presets to be used as a starting point.

I am aware that sometimes the reality is so complex that trying to simplyfy things is doomed to fail. Still I think its worth trying to come up with something simple that provides limited control as a interface for normal people. Its not perfect, it does not offer full control, but they can achive what they want.
Comment 16 David Schleef 2008-06-17 17:53:09 UTC
/me takes a look at the export settings in Final Cut

- frame rate

- key frames: automatic/every N/all

- frame reordering: yes/no

- data rate: automatic/restrict to N kbits/sec

- optimized for: download...

- quality (slider): least/low/medium/high/best

- encoding: best-quality(multipass)/faster encode(single-pass)

Do you take Final Cut seriously?

(Also, as a codec writer, no user needs to touch block size settings.  The encoder already knows the best setting.)
Comment 17 Ronald Bultje 2008-06-17 18:56:51 UTC
final Cut is one of the many, David. Other software, particularly Win32 freeware (hey, I'm a student) does offer those options. I was just trying to give an extreme example to counter the point of the "float quality".

In the end, use my comment as you wish, I'm not saying you need to allow the user to set block size, I'm saying that a "float quality" is not sufficient, not for anyone, and your design should keep that in mind.

sorry for the noise. :).
Comment 18 Stefan Sauer (gstreamer, gtkdoc dev) 2011-08-20 07:37:31 UTC
Some design work on http://gstreamer.freedesktop.org/wiki/ZeroPointEleven/EncoderConsensus
Comment 19 Jean-François Fortin Tam 2011-09-23 19:33:22 UTC
See also pitivi bug 593466 for some detailed description of the problems this causes with Theora and possibly other codecs.
Comment 20 Tim-Philipp Müller 2012-08-13 14:07:20 UTC
Changing bug description to make more generic.

From IRC conversation:
> ds: my preference is to have common properties for all encoders:
> ds: bit rate, key frame interval, profile, level, rate control, quality
Comment 21 GStreamer system administrator 2018-11-03 11:12:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/1.