-
-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom FFmpeg Audio options #1323
base: main
Are you sure you want to change the base?
Conversation
4694d8b
to
1e98d4f
Compare
GJ!!! |
@ler0y In your case adding these lines to your renderer configuration file will reduce transcoding to WAV having a sample rate < 48000: TranscodeAudio = WAV
CustomAudioFFmpegOptions = -af aformat=sample_fmts=u8|s16:sample_rates=44100|48000 Fine tune it to your renderer support. Ex. 96000 if it's DTS is supported in WAV. P.S. You can also use the |
9647fbd
to
90adb4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start but needs a bit more work
# Overrides the FFmpeg Audio options in UMS for this renderer. | ||
# An empty value means that the default UMS settings will be used. | ||
# Default: "" | ||
CustomAudioFFmpegOptions = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to rename this to CustomFFmpegAudioOptions
to match our other conventions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I should admit that i saw it afterward and was too lazzy to change it.
@@ -2262,6 +2263,10 @@ public int getAutoPlayTmo() { | |||
return getInt(AUTO_PLAY_TMO, 5000); | |||
} | |||
|
|||
public String getCustomAudioFFmpegOptions() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -142,7 +144,7 @@ public synchronized ProcessWrapper launchTranscode( | |||
configuration = (DeviceConfiguration)params.mediaRenderer; | |||
final String filename = dlna.getFileName(); | |||
params.maxBufferSize = configuration.getMaxAudioBuffer(); | |||
params.waitbeforestart = 2000; | |||
params.waitbeforestart = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No waiting delay while playing music.
Tested by us without any issues since some months, also with my very old CPU.
If i remember correctly, we are talking about 100MB to be buffereized in 2s, it seem out of age, also for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
@@ -200,30 +202,53 @@ public synchronized ProcessWrapper launchTranscode( | |||
cmdList.add("" + params.timeend); | |||
} | |||
|
|||
String customAudioFFmpegOptions = params.mediaRenderer.getCustomAudioFFmpegOptions(); | |||
|
|||
// Add audio options (-af, -filter_complex, -ab, -ar, -ac, -c:a, -f, -apre, -fpre, -pre, etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment could probably be put into DefaultRenderer.conf
too
@@ -247,6 +272,44 @@ public synchronized ProcessWrapper launchTranscode( | |||
return pw; | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are already in FFmpegVideo
which this extends, we shouldn't need to add them again unless they are different from those ones, in which case the @override
flag should be present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damned Github, i cannot see anything except /**
Please, feel free to push a commit using an @override
flag, if the changes done are not correct, as i could learn from it for an eventual next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sami32 I just checked and those parseOptions
methods are identical to the ones in FFmpegVideo
except for comment changes in the second one, so it would be better to remove those from this file and if you want, make the comment changes in FFmpegVideo
. Otherwise it's just writing the same code twice which also means bugfixes need to get written twice, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that doesn't use the same code twice will be good.
But, just to be clear, when i do the changes asked and that errors arise, i just stop brutally to be interested...
So, or you push a commit, or this PR will wait until my mood become better...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sami32 "when i do the changes asked" you didn't do the changes asked. I said to add @override
if the methods are different otherwise we shouldn't need to add them, and they are not different.
Up to you whether you implement the changes or not :)
747e978
to
bd72934
Compare
@@ -247,6 +272,44 @@ public synchronized ProcessWrapper launchTranscode( | |||
return pw; | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sami32 I just checked and those parseOptions
methods are identical to the ones in FFmpegVideo
except for comment changes in the second one, so it would be better to remove those from this file and if you want, make the comment changes in FFmpegVideo
. Otherwise it's just writing the same code twice which also means bugfixes need to get written twice, etc.
22bee6e
to
c8d5fb9
Compare
As requested here: #1181 #1179