[MPlayer-dev-eng] [PATCH] Add -va for video acceleration

Uoti Urpala uoti.urpala at pp1.inet.fi
Tue Feb 16 18:07:32 CET 2010


On Tue, 2010-02-16 at 17:14 +0100, Gwenole Beauchesne wrote:
> On Tue, 16 Feb 2010, Uoti Urpala wrote:
> 
> > On Tue, 2010-02-16 at 16:33 +0100, Gwenole Beauchesne wrote:
> >> On Tue, 16 Feb 2010, Uoti Urpala wrote:
> >>> I think the existing -vfm option would suit this use too (preferring
> >>> codecs using a particular kind of hardware decoding).
> >>
> >> How? They all depend on FFmpeg. Or do you want to split them all as -vfm
> >> ffmpeg,ffmpeg_vaapi,ffmpeg_crystalhd? It's not really user-friendly.
> >
> > Either add support for having one codec in multiple categories for the
> > -vfm option, or just split the 'ffmpeg' one into 'ffmpeg' (FFmpeg
> > software decoders) and 'vdpau', 'vaapi' etc - I can't at least
> > immediately think of any important problems with that.
> 
> I think the problems with this approach are:

You seem to assume a particular clumsy implementation and then identify
problems in that; as far as I can tell the problems you're talking about
are not intrinsic to my approach itself.

> (1) We will tend to duplicate videocodec entries since this would require 
> different "driver" lines, isn't it? So far, my current approach works by 
> just adding e.g. out VAAPI_MPEG2 to an existing videocodec entry. It's 
> preferable to add a single line rather than copying the whole entry x N 
> accelerators (N can be 4 very easily).

I think it's preferable to distinguish various accelerated versions on
the video codec level. If you don't then you need to duplicate all the
codec preferred/forced/fallback functionality to implement selecting the
actual hardware decoder used within the "same" codec. Also things like
"use VAAPI for mpeg4 but software for mpeg2 because my hardware has
problems with that" becomes hard to express on the command line if you
try to separate hardware decoding mode from other codec selection.

The syntax used in codecs.conf can be extended if that is an issue.

> (2) This probably would require more changes to vd_ffmpeg.c since new 
> vd_info and LIBVD_EXTERN(xxx) would be needed + a means to pass the 
> selected video accelerator to the init function.

You could add new -vfm names in simpler ways than adding new
vd_info/VD_EXTERN; OTOH maybe showing a different name for the decoder
used would actually make sense. The codec has access to the codecs.conf
entry used so passing information to init() is not an issue.




More information about the MPlayer-dev-eng mailing list