[FFmpeg-devel] [PATCHv4] ffplay: add support for interactive volume control

Marton Balint cus at passwd.hu
Thu Oct 1 03:03:27 CEST 2015


On Tue, 29 Sep 2015, Ganesh Ajjanagadde wrote:

> On Sun, Sep 27, 2015 at 5:09 PM, Marton Balint <cus at passwd.hu> wrote:
>>
>> On Sun, 27 Sep 2015, Ganesh Ajjanagadde wrote:
>>
>>> This is a feature heavily inspired by the mpv player. At the moment,
>>> methods
>>> for adjusting volume in ffplay are rather clumsy: either one needs to set
>>> it
>>> system-wide, or one needs to set it via the volume filter.
>>>
>>> This patch adds key bindings identical to the mpv defaults for
>>> muting/unmuting
>>> and increasing/decreasing the volume interactively without any
>>> introduction of
>>> external dependencies.
>>>
>>> TODO: doc update, possible mouse button bindings (mpv has this).
>>>
>>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>>> ---
>>> ffplay.c | 36 +++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 35 insertions(+), 1 deletion(-)
>>>
>>
>> Applied, thanks.
>
> BTW, just a heads up: I won't be writing code for mouse wheel
> bindings. The reason is that it is more annoying to support:
> https://wiki.libsdl.org/MigrationGuide - basically old SDL 1.2 (which
> is what many users use) treated it as a button, a mistake corrected in
> 2.0. I think the code will need to differ accordingly. Thus, configure
> will need to export the SDL version, some ifdefry will need to be
> done, and all that is gained is a feature which many users in fact
> find annoying and explicitly disable:
> https://forum.videolan.org/viewtopic.php?f=12&t=108470 (the very first
> link in a search for "vlc mouse volume control" :D ).
>
> However, I won't object to a patch as long as it handles both SDL
> versions correctly and by default disables mouse volume control.

Actually I don't really like the idea of using the mouse wheel for volume 
control, so no hard feelings :).

By the way, I guess SDL2 compatiblity is more like a far goal, because it 
needs severe rework of the video part as well. (SDL_YUV_Overlay is gone) I 
have some patches I made earlier, I will publish it in a branch sometime.

>
> Another side note on this business: VLC allows "boosting" volume to
> 125% (I recall even 400% in the past, not sure right now). I regard
> this as a misfeature; even their devs later regretted it - maybe
> that's why the 400 was toned down to 125. Note that ffplay still
> supports such "boosting", but that needs to be done by a -af
> volume=+xdB or something like that. I consider it a good thing: if
> someone wants something extreme (which can clip the audio), they need
> to explicitly enable it via a filter. Thus, I definitely did not
> implement this and will object to a modification to ffplay trying to
> do such a thing.

Agreed.

>
> I will add a Changelog entry after a week, once bugs/issues with this
> (if any) are handled.

Okay, i was wondering if it is big enough of a change for a changelog, but 
apparently it is, because you already got a phoronix article about it, so 
go ahead :)

Regards
Marton


More information about the ffmpeg-devel mailing list