The collective intent of the above plugins is to provide the GStreamer framework with a set of filters as already available in various other multimedia applications, e.g. MPlayer/mencoder, transcode, avidemux, many of them often duplicated over and over again. Once so available in GStreamer framework, they are accessible by a common API, so that the very same code can be used repeatedly (as opposed to duplicated), in line with GStreamer Motivation & Goals.
There a number of ways to make such filters available, each requiring more or less effort, and providing less or more quality (typically in that order). Foremost, of course, is to perform a code-level port, making the filter (operation) natively available in GStreamer. Alternatively, one could resort to dynamic or runtime “binding”
Clearly, when being done properly, this leads to most robust quality results. As it also requires most effort and maintenance, priority focus is given to the “popular” ones, defined here as roughly proportional to occurrence across various existing applications. The following table compares some filter operations, that implement an identical or very similar algorithm.
|swapuv||videocore rgbswap||Swap U and V||?||rbswap|
|field, phase||fields, doublefps||drop, * fields||?||fields|
|denoise3d||denoise3d||MPlayer denoise3d||?||hqdn3d high-quality=false|
The above table by no means intends to suggest that GStreamer offers the widest collection of filters available (at present?). Indeed, other programs as mentioned above often have many alternative implementations and algorithms with similar goals. The above merely considers the GStreamer perspective/intersection, and if anything, simply illustrates there is a great deal of duplicating, copying and reworking out there.
If so desired, and these programs are present and
accessible, they can be used in a pipeline.
For example, one or more mjpegtools filters can appear as
y4menc ! y4mtrans command=yuvdenoise ! y4mparse
y4menc ! y4mtrans command=y4mdenoise ! y4mtrans command=yuvmedianfilter ! y4mparse
Be aware that the above pipeline fragments have timestamp resequencing as a side-effect. So, take care not to cause an “imbalance” when muxing, e.g. by using stamp if needed in other streams.
The elements used above can also be put to use in dealing with a set of files (as input or output). For example,
jpeg2yuv -f 25 -j image-%05.jpg > image.yuv # then run following pipeline filesrc location=image.yuv ! y4mparse ! videoflip ! \ y4menc ! filesink location=image-out.yuv # if desired # y4mtopnm and pnmtojpeg processing
Of course, the intermediate file could be omitted by means of some piping, and procpipe may come in handy as well.