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 504056 - [ffvideoscale] Switch to using libswscale
[ffvideoscale] Switch to using libswscale
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal enhancement
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-17 15:06 UTC by Edward Hervey
Modified: 2008-10-08 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement as a separate plugin using libswscale (28.98 KB, patch)
2008-07-21 08:45 UTC, Mark Nauwelaerts
none Details | Review
Implement as a separate plugin using libswscale (30.64 KB, patch)
2008-07-21 21:15 UTC, Mark Nauwelaerts
committed Details | Review

Description Edward Hervey 2007-12-17 15:06:28 UTC
img_convert is now deprecated in upstream ffmpeg, we need to be using the swscale library now (shipped with ffmpeg).

I would much prefer having a separate plugin (as for libpostproc) for this since it would allow us just to link against libswscale (and maybe libavutil).

This needs to be fixed before the next release since it's been disabled in current build.
Comment 1 Edward Hervey 2007-12-18 11:43:55 UTC
I meant img_resample and not img_convert.
Comment 2 Mark Nauwelaerts 2008-07-21 08:45:28 UTC
Created attachment 114908 [details] [review]
Implement as a separate plugin using libswscale

This is a bit of a rewrite of ffvideoscale that is now a separate plugin using libswscale (and also takes care of bug 350738).  
Plugin should be OK (IMO), but note that:
* building libswscale has side-effect; see comments in patch for gstffmpegcodecmap.c
* as a patch, it only adds new bits, and does not touch current gstffmpegscale.c, which may be removed, or left as it is
Comment 3 Sebastian Dröge (slomo) 2008-07-21 10:13:31 UTC
AFAIK the plan was to write a ffswscale plugin that handles scaling and colorspace conversion and everything and put that into -base or something (with copying the swscale code).

I didn't look at your patch yet but does it handle colorspace conversions too?
Comment 4 Mark Nauwelaerts 2008-07-21 21:15:40 UTC
Created attachment 114956 [details] [review]
Implement as a separate plugin using libswscale

The previous patch did not handle colour space conversion, but this one does.

At present, it relies in part on the video format library and it is as such restricted to those formats.  However, this should be fairly straightforward to remedy at the expense of e.g. some gstffmpegcodecmap.c (partial) copy (likely modified to remove the dependency on avcodec.h and related structures), if that is according to plan/scope.
Comment 5 Tim-Philipp Müller 2008-07-23 09:23:36 UTC
> AFAIK the plan was to write a ffswscale plugin that handles scaling and
> colorspace conversion and everything and put that into -base or something (with
> copying the swscale code).

Oh really? That's news to me at least. I think it's a bad idea from a maintenance point of view too: if it didn't work very well with ffmpegcolorspace, which is at best lingering in a state of stasis, why would it work better with this new element?
Comment 6 Sebastian Dröge (slomo) 2008-07-23 11:17:49 UTC
Good question, I don't know :)

But we should really get some element into -base that deprecates ffmpegcolorspace as the used ffmpeg code is deprecated and no longer maintained. If it build depends on swscale, fine by me.
Comment 7 Thijs Vermeir 2008-07-23 13:37:42 UTC
For the ffmpegcolorspace problem propose this kind of solution[1]. I also have a implementation of it [2] but it currently only works with simple negotiation.

[1] http://gstreamer.freedesktop.org/wiki/ColorSpaceBin
[2] http://cgit.freedesktop.org/~tvermeir/gstcolorspace/

Comment 8 David Schleef 2008-07-23 16:58:20 UTC
No really, I'm *finally* going to write a decent, maintained colorspace element.  The code is all in Schroedinger at the moment, just needs to be pulled out and refactored into something for -base.
Comment 9 David Schleef 2008-07-23 17:36:30 UTC
Oh yeah, I also think colorspacebin is a good idea, although I'd prefer that it scaled video and added letterboxing, too.
Comment 10 Mark Nauwelaerts 2008-10-08 13:12:46 UTC
2008-10-08  Mark Nauwelaerts  <mark.nauwelaerts@collabora.co.uk>

	* configure.ac:
	* ext/Makefile.am:
	* ext/libswscale/Makefile.am:
	* ext/libswscale/gstffmpegscale.c:
	(gst_ffmpegscale_method_get_type), (gst_ffmpegscale_base_init),
	(gst_ffmpegscale_class_init), (gst_ffmpegscale_init),
	(gst_ffmpegscale_reset), (gst_ffmpegscale_finalize),
	(gst_ffmpegscale_caps_remove_format_info),
	(gst_ffmpegscale_transform_caps), (gst_ffmpegscale_fixate_caps),
	(gst_ffmpegscale_get_unit_size), (gst_ffmpeg_caps_to_pixfmt),
	(gst_ffmpegscale_fill_info), (gst_ffmpegscale_set_caps),
	(gst_ffmpegscale_transform), (gst_ffmpegscale_handle_src_event),
	(gst_ffmpegscale_stop), (gst_ffmpegscale_set_property),
	(gst_ffmpegscale_get_property), (gst_ffmpeg_log_callback),
	(plugin_init):
	Rewrite ffvideoscale using libswscale and put into a separate plugin.
	Fixes #504056.