Jump to content

Audio boost when dowmixing


adam1010

Recommended Posts

adam1010

I'm trying to get louder volume on my Android mobile devices. I have set the server's Transcoding setting of "Audio boost when downmixing" to its maximum setting of 3, however, the volume doesn't appear to increase much. I have verified that the video is being transcoded (downmixed) and not using Direct Play. I'd almost say there isn't any distinguishable difference when I switch on and off the transcoding on my Android device (I'm using Ubuntu for the server).

 

I'm assuming you're taking my value of "3" and normalizing it to something and plugging it into ffmpeg like so:

ffmpeg -i in.mp4 -af "volume=1.5" out.mp4

This example represents a 50% audio boost.

 

1) What does level 3 correspond to percentage-wise, and is there a reason it's been capped at 3?

2) Is there any kind of debug information I can look at to verify that the audio amplification flag is being set in ffmpeg?

 

Link to comment
Share on other sites

We don't normalize the value, I just checked on that. Can you make sure you don't have it configured to 1.5? We can increase the cap to 4 I suppose but this is highly unusual. I could be wrong but I think a really high value will degrade quality.

Link to comment
Share on other sites

adam1010

Yes, a high value should degrade quality -- but I don't hear any distortion at all which is why I wasn't sure if maybe your Downmix Audio Boost max of "3" corresponded to like a 5% audio boost.

 

I do have that setting maxed out at "3". If you're saying "3" corresponds to -af "volume=3", that would be a 300% boost, which would be a perfectly fine maximum. However, that would mean there is a bug then because I cannot hear any distinguishable difference between setting it at "1" and "3".

 

To reproduce, set your Downmix Audio Boost to "3" and play a movie/show on your phone (although any player should work). Start it off using Direct Play (Quality=4Mpbs) for a few seconds, then switch Quality=240p to enable transcoding. After the video begins playing again, there should be no perceptible change in the audio level.

 

If I then open up the Server Logs and click on the "ffmpeg-transcode-..." entry and search for "volume", there is no mention of it. Here is the command it's running:

ffmpeg -ss 00:03:17.240 -f matroska -codec:0 h264 -codec:1 aac -i file:"/in.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,720)/2)*2:trunc(ow/dar/2)*2" -pix_fmt yuv420p -preset medium -crf 23 -maxrate 528000 -bufsize 1056000 -profile:v high -level 4.1 -x264opts:0 subme=0:rc_lookahead=10:me_range=4:me=dia:no_chroma_me:8x8dct=0:partitions=none -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 192000  -y "/tmp/out.mkv"

So it looks like since the "-af" flag isn't being used maybe there has been a regression since this feature was released, and the flag/switch is no longer being included.

Link to comment
Share on other sites

adam1010

There is a "2.0" badge on the episode page (next to "H264" "480P" and "AAC") -- so 2 channels?  It's not particularly high quality.

 

I would think you could still pass the -af "volume=[x]"  flag regardless of the audio source and ffmpeg would decide what to do.

 

EDIT:  I tried a movie with 5.1 and no audio boost occurred for transcoding on that file either.

Edited by adam1010
Link to comment
Share on other sites

The setting is only intended to be used when downmixing which isn't what we're doing in this situation. I wonder why we aren't just passing the original audio though. Can you attach the ffmpeg log? Thanks !

Link to comment
Share on other sites

adam1010

I've sent you the log file.

 

So if Emby tries to preserve the audio track when transcoding video, is there a way to tell Emby I want to transcode/downmix the audio as well? I think I would prefer to always have the audio downmixed when I'm transcoding (because I either want small filesize if I'm on a cellular or slow connection, or I enable the transcoding merely for the purpose of boosting the audio)

Link to comment
Share on other sites

Ok, based on your logs I believe we are transcoding the audio because the bitrate of the source audio is unknown, although I thought I had made changes recently to just allow it in that situation. Are you running the latest version of Emby Server?

 

So what this basically means is that we don't want the audio to convert at all in this situation. I'd like to add this type of setting into the video player to be able to force convert it, but we don't have that yet.

Link to comment
Share on other sites

adam1010

My server version is 3.2.13.0

 

So even on the lowest quality transcoding setting it's just passing through the audio? I've tried dropping it all the way to 144p and still am not noticing any audio boost.

 

You plan to solve this in all of the individual video players and not at the server configuration level?

Link to comment
Share on other sites

Well if you update the server then the audio should be passing through. Ultimately your root desire is audio boost so that's what we should focus on. if you're using the android app it may have the ability to do it in-app without having to force a server transcode for that.

 

And yes, being able to selectively force a transcode at the time of playback is something that would go into the video player. To address what you're asking at the server level, I'm not exactly sure what that would require. I guess you'd want a setting that says never pass through audio of a certain criteria, but that will cause a lot of transcoding which many will find undesirable.

Link to comment
Share on other sites

adam1010

Correct, the audio boost is all I'm concerned with. So if there was a setting in the Android mobile app that let me "Boost audio by X%" with a slider, that would be perfect. And if it achieves that by forcing a transcode using the -af "volume=[x]"  flag  (or using some Android feature), it doesn't matter to me. Whatever is easier for @@ebr to implement.

 

However, I would consider renaming (or entirely removing) the "Audio boost when downmixing" setting on the server, because it probably doesn't do what most people think it does. And if you plan to handle this in the client app, you don't really want a conflicting server-side setting.

 

Any idea if this is a feature that could get implemented in the near future, or is it pretty low priority?

 

Note: One thing I did like about having the audio boost setting on the server, is that when I selected to download a video for offline use, the forced transcode would give me the audio boost I wanted (particularly if I'm flying on a plane where I sometimes need to hold the headphones tight against my ear to hear properly). So moving this to a feature of the player will prevent that use-case  (unless you also add an option on the Android app that lets me select the audio boost percentage in addition to the transcoding bit-rate).

Link to comment
Share on other sites

  • 3 years later...
On 10/06/2017 at 21:55, adam1010 said:

Correct, the audio boost is all I'm concerned with. So if there was a setting in the Android mobile app that let me "Boost audio by X%" with a slider, that would be perfect. And if it achieves that by forcing a transcode using the -af "volume=[x]"  flag  (or using some Android feature), it doesn't matter to me. Whatever is easier for @@ebr to implement.

 

However, I would consider renaming (or entirely removing) the "Audio boost when downmixing" setting on the server, because it probably doesn't do what most people think it does. And if you plan to handle this in the client app, you don't really want a conflicting server-side setting.

 

Any idea if this is a feature that could get implemented in the near future, or is it pretty low priority?

 

Note: One thing I did like about having the audio boost setting on the server, is that when I selected to download a video for offline use, the forced transcode would give me the audio boost I wanted (particularly if I'm flying on a plane where I sometimes need to hold the headphones tight against my ear to hear properly). So moving this to a feature of the player will prevent that use-case  (unless you also add an option on the Android app that lets me select the audio boost percentage in addition to the transcoding bit-rate).

In total agreement. When can we expect this to be coded in? Can we get an estimate of a possible ETA? Its the little missing features that are adding up to be a big annoyance. Hardly anything more annoying than cranking all the volumes up and you still cant hear. 

Link to comment
Share on other sites

rbjtech

I use the command ...

ffmpeg.exe" -y -report -i "original.mkv" -map 0:v -map 0:a:0 -map 0:a  -c:v copy -c:a copy -c:a:0 aac -ac 2 -filter:a:0 "volume=1.4" -disposition:a:0 default -disposition:a:1 0 -metadata:s:a:0 title="Stereo" -metadata:s:a:0 language=eng -metadata:s:a:1 title="Multichannel" -metadata:s:a:1 language=eng -metadata:s:v:0 title="" "new.mkv"

.. when adding an AAC track to the MKV - as previously, especially for AC3, the conversion to AAC without the filter lowered the volume by a good amount.

This definitely increases the volume of the AAC to equal to or even slightly above original AC3 or DTS volume - but as you correctly say, at the expense of dynamic range and possible clipping - I found 1.4 to be about right.  However, as it's sole purpose is for playback on low end streaming devices, then it's really not an issue.

Maybe try this on some of your media to see what the volume differences are.   If you used 'AC3' instead, then you could have an 'AC3 LOUD' track that you have the option of playing 😉

 

 

Edited by rbjtech
Link to comment
Share on other sites

1 hour ago, rbjtech said:

I use the command ...

ffmpeg.exe" -y -report -i "original.mkv" -map 0:v -map 0:a:0 -map 0:a  -c:v copy -c:a copy -c:a:0 aac -ac 2 -filter:a:0 "volume=1.4" -disposition:a:0 default -disposition:a:1 0 -metadata:s:a:0 title="Stereo" -metadata:s:a:0 language=eng -metadata:s:a:1 title="Multichannel" -metadata:s:a:1 language=eng -metadata:s:v:0 title="" "new.mkv"

.. when adding an AAC track to the MKV - as previously, especially for AC3, the conversion to AAC without the filter lowered the volume by a good amount.

This definitely increases the volume of the AAC to equal to or even slightly above original AC3 or DTS volume - but as you correctly say, at the expense of dynamic range and possible clipping - I found 1.4 to be about right.  However, as it's sole purpose is for playback on low end streaming devices, then it's really not an issue.

Maybe try this on some of your media to see what the volume differences are.   If you used 'AC3' instead, then you could have an 'AC3 LOUD' track that you have the option of playing 😉

 

 

Thanks Ill look into doing that. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...