songbird icon indicating copy to clipboard operation
songbird copied to clipboard

Why the need to re-encode?

Open MagicRB opened this issue 2 years ago • 3 comments

https://docs.rs/songbird/latest/src/songbird/input/ytdl_src.rs.html#44 According to this (you're using old style ffmpeg switches, -acodec -> -c:a) ffmpeg reencodes the input stream, even though afaik YouTube can give us Opus and Discord takes Opus as the input stream. I may be mistaken on this, though. I'm just looking for ways to optimize songbird as it hammers my server quite hard.

MagicRB avatar Apr 19 '22 13:04 MagicRB

This is harder than it looks. Youtube gives you WebM which contains Opus; if you want to pass that through, you need a full MKV parser/demuxer. Most standalone *.opus files are Ogg containers -- again, another demuxer that needs implemented. I'm working towards this via #89, which does this by making use of the symphonia library (and does it very well from early perf testing), but I have no free time right now to deal with all the other user-facing API changes that the rewrite needs.

FelixMcFelix avatar Apr 19 '22 14:04 FelixMcFelix

Does it already work? Id be happy to beta test

MagicRB avatar Apr 19 '22 14:04 MagicRB

If you need the performance ASAP you're welcome to try it, just be aware that things will break (and may be broken atm) as it's still in flux.

FelixMcFelix avatar Apr 19 '22 15:04 FelixMcFelix

Closing as v0.4.x achieve passthrough as required.

FelixMcFelix avatar Nov 20 '23 03:11 FelixMcFelix