add opus 19k option
This commit is contained in:
parent
2f8a8025f3
commit
41749a5c10
2 changed files with 17 additions and 1 deletions
|
|
@ -83,6 +83,19 @@ def get_opts(format: str, quality: str, ytdl_opts: dict) -> dict:
|
||||||
opts["postprocessor_args"] = {
|
opts["postprocessor_args"] = {
|
||||||
"ffmpeg": ["-ac", "1", "-ar", "22050", "-q:a", "8"]
|
"ffmpeg": ["-ac", "1", "-ar", "22050", "-q:a", "8"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add voice mono settings for OPUS
|
||||||
|
if format == "opus" and quality == "19_mono":
|
||||||
|
opts["postprocessor_args"] = {
|
||||||
|
"ffmpeg": [
|
||||||
|
"-ac", "1", # Force mono
|
||||||
|
"-c:a", "libopus", # Use OPUS codec
|
||||||
|
"-b:a", "19k", # Set bitrate to 19kbps
|
||||||
|
"-application", "voip", # Optimize for speech
|
||||||
|
"-frame_duration", "20", # Standard frame size
|
||||||
|
"-compression_level", "10" # Highest quality compression
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
# Audio formats without thumbnail
|
# Audio formats without thumbnail
|
||||||
if format not in ("wav") and "writethumbnail" not in opts:
|
if format not in ("wav") and "writethumbnail" not in opts:
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,10 @@ export const Formats: Format[] = [
|
||||||
{
|
{
|
||||||
id: 'opus',
|
id: 'opus',
|
||||||
text: 'OPUS',
|
text: 'OPUS',
|
||||||
qualities: [{ id: 'best', text: 'Best' }],
|
qualities: [
|
||||||
|
{ id: 'best', text: 'Best' },
|
||||||
|
{ id: '19_mono', text: '19 kbps(Mono)' }
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'wav',
|
id: 'wav',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue