summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

omxplayer audio control

Tue Nov 12, 2013 2:17 pm

I'm running omxplayer (with audio through HDMI), and I'm having trouble setting the volume control using the --vol flag

The help page says that the setting is in millibels, but I don't know what to gauge this on. Any ideas?

Ideally I'd like to set this from a text file, so perhaps:

omxplayer --vol < ~/vol.txt video.mp4

Should this be possible?

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: omxplayer audio control

Tue Nov 12, 2013 3:06 pm

The range is -600 to 0 milliBels
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: omxplayer audio control

Tue Nov 19, 2013 7:42 pm

Thanks for this - still struggling with it though. It's ignoring the volume, and I wonder if it's anything to do with the negative value?

I have tried
omxplayer --adev hdmi --vol $(cat /home/pi/volume) $file

with the contents of 'volume' as -600 and "-600". I've also tried specifying '--' on its own before the volume file variable above, but that doesn't work either :( If I change omxplayer for echo, I correctly see, e.g.:

omxplayer --adev hdmi --vol -600 video.mp4
or
omxplayer --adev hdmi --vol "-600" video.mp4

but still the sound comes out at normal volume...

What's wrong?

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: omxplayer audio control

Tue Nov 19, 2013 9:16 pm

Hi

Whoops, I got my maths wrong its -6000 to 0 millibels not -600. This goves -60 to 0 dB which is a sensible range.

-600 is only -6dB which may not have been noticeable.

If -6000 does not work then I had better check it works in Pi Presents. I thought had tested it but maybe not.
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: omxplayer audio control

Mon Dec 02, 2013 4:53 pm

Just to update: -6000 did work fine for me, thanks for your help.

epleterte
Posts: 1
Joined: Sun Mar 24, 2013 4:36 pm

Re: omxplayer audio control

Mon Dec 16, 2013 11:17 pm

Thanks, this helped. I find it confusing/less intuitive that the player prints the current volume in a different format (i.e. "-27.30") than what is expected as an argument.

Return to “Graphics, sound and multimedia”