GNOME Bugzilla – Bug 504056
[ffvideoscale] Switch to using libswscale
Last modified: 2008-10-08 13:12:46 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.
I meant img_resample and not img_convert.
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
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?
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.
> 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?
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.
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/
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.
Oh yeah, I also think colorspacebin is a good idea, although I'd prefer that it scaled video and added letterboxing, too.
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.