Skip to content
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

Allow Flexible transcode #241

Closed
J4gQBqqR opened this issue Sep 21, 2022 · 12 comments
Closed

Allow Flexible transcode #241

J4gQBqqR opened this issue Sep 21, 2022 · 12 comments

Comments

@J4gQBqqR
Copy link

This is related to #121 and #91
On clients such as DSub, the transcode setting allow user to specify different maximum bitrate under WiFi and cell data.

I set DSub using opus transcode profile under gonic.
I set maximum bitrate under WiFi as "Unlimited"
I set maximum bitrate under Cell Data as "196Kbps"

I played a flac format track with bitrate around 600Kbps

Expected behavior:
Under WiFi, the track should be played as original flac file without transcoding since "Unlimited" > 600Kbps.
Because "Unlimited" > 600Kbps, it will not trigger transcoding. File will be served as it is.
Under Cell data, transcode will be triggered and will be streamed as a 196Kbps opus format.

Actual behavior:
Under both WiFi and Cell, regardless of maximum bitrate setting, file will be streamed as 96 Kbps opus.

@sentriz
Copy link
Owner

sentriz commented Sep 21, 2022

hi, this was changed recently . what version of gonic are you on? and from source or docker?

@sentriz
Copy link
Owner

sentriz commented Sep 21, 2022

PS can you show me the stream.view line in the gonic logs when dsub requests unlimited bitrate?

@J4gQBqqR
Copy link
Author

log:

gonic  | 2022/09/21 18:40:29 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1230&maxBitRate=861`
gonic  | 2022/09/21 18:40:32 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1231&maxBitRate=772`
gonic  | 2022/09/21 18:40:34 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1232&maxBitRate=892`
gonic  | 2022/09/21 18:40:36 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1233&maxBitRate=1027`

version: sentriz/gonic:nightly
I just pulled the image this afternoon (09/21/2022), so this should be the latest one.

I am on WiFi when I triggered the above log. So the setting should be unlimited.

screenshots:
signal-2022-09-21-184332_002
signal-2022-09-21-184332_003
image

@J4gQBqqR
Copy link
Author

The original flac file should be > 20MB and in flac format

@J4gQBqqR
Copy link
Author

More detailed log:

gonic  | 2022/09/21 18:40:11 response  200  for `/rest/savePlayQueue.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1218&id=tr-1219&id=tr-1220&id=tr-1221&id=tr-1222&id=tr-1223&id=tr-1224&id=tr-1225&id=tr-1226&id=tr-1227&id=tr-1228&id=tr-1229&id=tr-1230&id=tr-1231&id=tr-1232&id=tr-1233&id=tr-1234&id=tr-1235&id=tr-1236&id=tr-1237&id=tr-1238&id=tr-1239&id=tr-1240&id=tr-1241&id=tr-1242&id=tr-1243&id=tr-1244&id=tr-1245&id=tr-1246&id=tr-1247&id=tr-1248&id=tr-1249&id=tr-1250&id=tr-1251&id=tr-1252&id=tr-1253&id=tr-1254&id=tr-1255&id=tr-1256&id=tr-1257&id=tr-1258&id=tr-1259&id=tr-1260&id=tr-1261&id=tr-1262&id=tr-1263&id=tr-1264&id=tr-1265&id=tr-1266&id=tr-1267&id=tr-1268&id=tr-1269&id=tr-1270&id=tr-1271&id=tr-1272&id=tr-1273&id=tr-1274&id=tr-1275&id=tr-1276&id=tr-1277&id=tr-1278&current=tr-1226&position=56707`
gonic  | 2022/09/21 18:40:27 ***** requests 孙燕姿 - 爱从零开始 from My Story, Your Song
gonic  | 2022/09/21 18:40:27 trancoding to "audio/ogg" with max bitrate 96k
gonic  | 2022/09/21 18:40:29 response  200  for `/rest/savePlayQueue.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1218&id=tr-1219&id=tr-1220&id=tr-1221&id=tr-1222&id=tr-1223&id=tr-1224&id=tr-1225&id=tr-1226&id=tr-1227&id=tr-1228&id=tr-1229&id=tr-1230&id=tr-1231&id=tr-1232&id=tr-1233&id=tr-1234&id=tr-1235&id=tr-1236&id=tr-1237&id=tr-1238&id=tr-1239&id=tr-1240&id=tr-1241&id=tr-1242&id=tr-1243&id=tr-1244&id=tr-1245&id=tr-1246&id=tr-1247&id=tr-1248&id=tr-1249&id=tr-1250&id=tr-1251&id=tr-1252&id=tr-1253&id=tr-1254&id=tr-1255&id=tr-1256&id=tr-1257&id=tr-1258&id=tr-1259&id=tr-1260&id=tr-1261&id=tr-1262&id=tr-1263&id=tr-1264&id=tr-1265&id=tr-1266&id=tr-1267&id=tr-1268&id=tr-1269&id=tr-1270&id=tr-1271&id=tr-1272&id=tr-1273&id=tr-1274&id=tr-1275&id=tr-1276&id=tr-1277&id=tr-1278&current=tr-1230&position=0`
gonic  | 2022/09/21 18:40:29 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1230&maxBitRate=861`
gonic  | 2022/09/21 18:40:29 ***** requests 孙燕姿 - 相信 from My Story, Your Song
gonic  | 2022/09/21 18:40:29 trancoding to "audio/ogg" with max bitrate 96k
gonic  | 2022/09/21 18:40:32 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1231&maxBitRate=772`
gonic  | 2022/09/21 18:40:32 ***** requests 孙燕姿 - Hey Jude from My Story, Your Song
gonic  | 2022/09/21 18:40:32 trancoding to "audio/ogg" with max bitrate 96k
gonic  | 2022/09/21 18:40:34 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1232&maxBitRate=892`
gonic  | 2022/09/21 18:40:34 ***** requests 孙燕姿 - 第六感 from My Story, Your Song
gonic  | 2022/09/21 18:40:34 trancoding to "audio/ogg" with max bitrate 96k
gonic  | 2022/09/21 18:40:36 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1233&maxBitRate=1027`
gonic  | 2022/09/21 18:40:43 response  200  for `/rest/savePlayQueue.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1218&id=tr-1219&id=tr-1220&id=tr-1221&id=tr-1222&id=tr-1223&id=tr-1224&id=tr-1225&id=tr-1226&id=tr-1227&id=tr-1228&id=tr-1229&id=tr-1230&id=tr-1231&id=tr-1232&id=tr-1233&id=tr-1234&id=tr-1235&id=tr-1236&id=tr-1237&id=tr-1238&id=tr-1239&id=tr-1240&id=tr-1241&id=tr-1242&id=tr-1243&id=tr-1244&id=tr-1245&id=tr-1246&id=tr-1247&id=tr-1248&id=tr-1249&id=tr-1250&id=tr-1251&id=tr-1252&id=tr-1253&id=tr-1254&id=tr-1255&id=tr-1256&id=tr-1257&id=tr-1258&id=tr-1259&id=tr-1260&id=tr-1261&id=tr-1262&id=tr-1263&id=tr-1264&id=tr-1265&id=tr-1266&id=tr-1267&id=tr-1268&id=tr-1269&id=tr-1270&id=tr-1271&id=tr-1272&id=tr-1273&id=tr-1274&id=tr-1275&id=tr-1276&id=tr-1277&id=tr-1278&current=tr-1230&position=13064`

@sentriz
Copy link
Owner

sentriz commented Sep 21, 2022

thanks, i think it should be fixed now

@sentriz
Copy link
Owner

sentriz commented Sep 21, 2022

nightly is building currently. progress is here

https://github.com/sentriz/gonic/actions/runs/3101783823

let me know how it goes 👍

@J4gQBqqR
Copy link
Author

I still has issue:
I specified the max bitrate to be 128kbps, Gonic returns 96kbps to me:

gonic  | 2022/09/21 20:39:07 ***** requests 孙燕姿 - 一样的夏天 from My Story, Your Song
gonic  | 2022/09/21 20:39:07 trancoding to "audio/ogg" with max bitrate 96k
gonic  | 2022/09/21 20:39:09 response  200  for `/rest/stream.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1239&maxBitRate=128`
gonic  | 2022/09/21 20:39:09 response  200  for `/rest/savePlayQueue.view?u=*****&s=65k44prpmthefqih4m67j28k82&t=54a9e78739f95767fc96f87b788de889&v=1.2.0&c=DSub&id=tr-1218&id=tr-1219&id=tr-1220&id=tr-1221&id=tr-1222&id=tr-1223&id=tr-1224&id=tr-1225&id=tr-1226&id=tr-1227&id=tr-1228&id=tr-1229&id=tr-1230&id=tr-1231&id=tr-1232&id=tr-1233&id=tr-1234&id=tr-1235&id=tr-1236&id=tr-1237&id=tr-1238&id=tr-1239&id=tr-1240&id=tr-1241&id=tr-1242&id=tr-1243&id=tr-1244&id=tr-1245&id=tr-1246&id=tr-1247&id=tr-1248&id=tr-1249&id=tr-1250&id=tr-1251&id=tr-1252&id=tr-1253&id=tr-1254&id=tr-1255&id=tr-1256&id=tr-1257&id=tr-1258&id=tr-1259&id=tr-1260&id=tr-1261&id=tr-1262&id=tr-1263&id=tr-1264&id=tr-1265&id=tr-1266&id=tr-1267&id=tr-1268&id=tr-1269&id=tr-1270&id=tr-1271&id=tr-1272&id=tr-1273&id=tr-1274&id=tr-1275&id=tr-1276&id=tr-1277&id=tr-1278&current=tr-1239&position=0`

sentriz added a commit that referenced this issue Sep 22, 2022
"Opus at 128 KB/s (VBR) is pretty much transparent"

https://wiki.xiph.org/Opus_Recommended_Settings

related #241
@sentriz
Copy link
Owner

sentriz commented Sep 22, 2022

that's expected. the gonic profile you selected is a 96kpbs profile. the maxbitrate greater than that so you get 96. if you use a 128 kpbs profile then and a matching maxbitrate it should work.

i just pushed a commit to add that to the settings 👍

https://wiki.xiph.org/Opus_Recommended_Settings

https://github.com/sentriz/gonic/actions/runs/3104335797

mpv-shot0001

@J4gQBqqR
Copy link
Author

Still:
image

But:

gonic  | 2022/09/22 06:57:20 ***** requests 孙燕姿 - 梦不落 from My Story, Your Song
gonic  | 2022/09/22 06:57:20 trancoding to "audio/ogg" with max bitrate 96k
gonic  | 2022/09/22 06:57:21 response  200  for `/rest/stream.view?u=*****&s=1fikucq77dbh48eb4a86vcfj81&t=ee1656807ccfc05ea9d677b9b2ef33fb&v=1.2.0&c=DSub&id=tr-1244&maxBitRate=128`

On DSub, it also shows 96kbps.

Thanks for your help and responses!

sentriz added a commit that referenced this issue Sep 22, 2022
"Opus at 128 KB/s (VBR) is pretty much transparent"

https://wiki.xiph.org/Opus_Recommended_Settings

related #241
@sentriz
Copy link
Owner

sentriz commented Sep 22, 2022

sorry, silly mistake on my part 😁 new build https://github.com/sentriz/gonic/actions/runs/3104973311

@J4gQBqqR
Copy link
Author

Great, it works as expected now!
Thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants