#๐ฅ-vesktop-development
1 messages ยท Page 3 of 1
I found that for some reason, framerate takes directly from mediaDevices.getDisplayMedia (which returns MediaStream) object.
For fixing FPS value, we can just reapply constraints for the stream in src/renderer/patches/screenShareAudio.ts, where we already have getDisplayMedia function overriding:
navigator.mediaDevices.getDisplayMedia = async function (opts) {
const stream = await original.call(this, opts);
...
is this is? @azure verge
that is
that is amazing
i will get to testing that
well
it works for framerate
resolution is still
not applying
OH
NVM
IT APPLIES ON WINDOW CHANGE
oh but you lose the higher framerate....
odd
hmm
i dont like that though
ill have to keep testing
well
progress has been made
resolution is mostly selectable
if you choose 1080p for some reason it picks your monitor resolution
and i cant get it to use higher than 30fps yet
but this is progress
I wonder if discord has some kind of limit for framerates in the browser. It seems like its capped at 30 fps, no matter what you change.
I wonder if discord has some kind of limit for framerates in the browser. It seems like its capped at 30 fps, no matter what you change.
I've been able to raise the framerate above 30, but that's going to take a lot more work before its at a point where resolution and framerate selections are functioning properly.
I wonder if discord has some kind of limit for framerates in the browser. It seems like its capped at 30 fps, no matter what you change.
I've been able to raise the framerate above 30, but that's going to take a lot more work before its at a point where resolution and framerate selections are functioning properly.
Ah I see, I have tried multiple things and never got it to anything above 30 but at the same time I am quite a big noob with discords api
I tested this, my friends just say its looking like a normal discord screenshare, not a slideshow anymore
Working great on my side too :)
Unrelated question: Is there any way to get AV1 encoding atm ?
totally agree, it's really easy to replace the gif in the static folder and recompile though
for people running from source sure, most users are probably using flatpak tho. And adding an option in the app would make things easier for the end user anyway.
Working great on my side too :)
Unrelated question: Is there any way to get AV1 encoding atm ?
Not as of right now, and it's not a priority because it would take a good bit of work, and getting streams to a functional state is my priority. If you'd like to try and implement it yourself though, go ahead :)
I'm working on getting some stuff ready to merge all at once, hopefully this can be a single merge that fixes this and resolution selections. There's a bit more work to be done to fix that, and then there's also a weird issue where as soon as someone starts watching a stream, the bitrate is limited to 4696kbps.
please do not open issues with the following issues
- purely graphical glitches
issue with electron / chromium / your desktop environment / your gpu / whatever on your end. vesktop has no control over these things
For me, I do not have bitrate capping to 4696kpbs even when someone is watching a stream
how did ur pr get so many upvotes and hearts
like i know it's a long awaited change but how did so many people find it
For me it caps at around 8000kbps when someone starts watching. Is it maybe resolution based?
For me, I do not have bitrate capping to 4696kpbs even when someone is watching a stream
When streaming something with amount of motion (ufo test on all screen), then bitrate increases up to 8mbps~, but framerate drops to 15~
Streamed in 1920x1080
That is quite intriguing, I'll have to ...
someone posted about it on one of the linux subreddits
oh
oh wow
the description is a bit misleading because it implies that the discord app also suffers from these fps issues
while it does suffer from many issues but not this one
I'm not sure but they could figure that out themselves
lkao
lmao*
plus idk
discord has support for it so
if they wanted they could write a shit ton of stuff to support it
it's not that easy ๐ญ
yeah
u likely need to fork electron for that
oh ofc
:)
Is your feature request related to a problem? Please describe.
Depends on what someone sees as a problem. For me it resides on this problem, that I use discord on my second screen half of the window and my input bar looks like this:
I personally only need the Timestamp and Translation. I never click on the Smiley/Gif/Sticker buttons and use their shortcuts.
**Describe the solution you'd ...
- hide them with css
- this is the vesktop repo, you're in the veeery wrong place
Oh shit sorry. I just googled for the issues github for vencord. Didn't check the repo I landed in. Sorry sorry. Will move the topic.
maybe not av1 but I'm definitely going to look into enabling vp9 for non-nvidia systems
webrtc supports it
and it's far better size-wise than h264
so less bitrate throttling
For me, I do not have bitrate capping to 4696kpbs even when someone is watching a stream 
Also, i have another idea how to probably increase stability of stream. If we somehow will get RTCRtpSender object of stream then we can set degradationPreference property to "maintain-framerate", and it maybe will fix problem with fps drops on low bandwidth instead of decreasing video quality (just like default discord streams?)
I think this is a good idea. I tried applying this myself, bu...
Also, i have another idea how to probably increase stability of stream. If we somehow will get RTCRtpSender object of stream then we can set degradationPreference property to "maintain-framerate", and it maybe will fix problem with fps drops on low bandwidth instead of decreasing video quality (just like default discord streams?)
I think this is a good idea. I tried applying this myself, bu...
Also, i have another idea how to probably increase stability of stream. If we somehow will get RTCRtpSender object of stream then we can set degradationPreference property to "maintain-framerate", and it maybe will fix problem with fps drops on low bandwidth instead of decreasing video quality (just like default discord streams?)
this is deprecated, I am not 100% sure but I believe you're...
TODO before merge:
- [ ] Fix resolution and framerate selection
- [ ] Enable
contentHintand allow the user to choose between "motion" and "text" - [ ] (maybe) enable VP9 codec for supported GPUs
@vernal lintel so we've found out that now you can stream lowish res with 60fps(it automatically lowers the resolution to handle smooth 60fps) without nitro because all that nitro does is limit bandwidth and disable the button
should i add some sort of nitro check to keep us from
essentially modding in new functionality
you're saying non nitro users have lower max bitrate which makes it hard to do 60fps at 1080p?
yeah as far as we can see the bitrate is lower so its harder but you can still reach 60fps at resolutions like 480p or 720p
interesting
usually non nitro is stuck at 720p 30fps right
yeah
id say no don't limit it but set defaults to 720p30 if you don't have nitro and add a warning card that it might not be good quality if non nitro selects higher
i wonder if this also affects FakeNitro discord desktop
i dont know
is it only in the 10$ nitro
although im not 100% sure if the bitrate limitation is set on the server or in the client
im only limited to 4696 in dm calls and non-boosted servers
in boosted servers it unlocks to 8000kbps
oh interesting
i havent been able to debug that fully
discord probably has a function to get max bitrate
could check that and if it's only 4k show a warning if you select 1080p60
should i add that into the todo as something to do/attempt to do before merging
nitro itself has absolutely no checks within voice
premium tier (boosts) might
i can try to look into that
ok so boosts affect the highest bitrate you can set on a channel but that's supposed to be for voice only
higher boost levels do unlock higher quality but so does nitro, so there can't be a check there
hmmm
i wonder if video_quality_mode has any effect on this
on desktop i can hit 10kbps without nitro so no
i'm really doubting this has anything to do with nitro
interestingly the desktop client likes to target ~4800 too
if you find anything
lmk
it locks to like
exactly 4695ish
on web its limited to 4000kbps afaik
ah right
do you have any idea of how to do this
because its really all that's major before merging this
the rest is small stuff that i dont know how easy it will be to fix and i dont want to make streaming take months to implement because of small bugs
@vernal lintel i have a theory that some of the arbitrary bitrate limits on nitro users may come from the app being registered as a web client
is there a known way to spoof that
yes but it makes discord think you're capable of their native vc stuff and thus breaks vc entirely
discord web uses WebRTC for vc
discord desktop uses a custom udp stack implemented via discord_voice
i don't know any details about it, it's proprietary and i don't really care about it
but web can't use that
if you spoof yourself as desktop, it expects you to be able to use their custom stuff and it entirely breaks vc
you can try it yourself
find where vesktop spoofs its user agent, it's somewhere in mainWindow.ts, and comment that line out
it will make it use the default electron user agent and make it think you're desktop
A bit unrelated but when testing this PR I found an issue when streaming Monster Hunter: World, all other games I've tried run fine except this one, but I can't figure out why.
This may be worth taking a look because it could be affecting other applications as well.
A bit unrelated but when testing this PR I found an issue when streaming Monster Hunter: World, all other games I've tried run fine except this one, but I can't figure out why.
This may be worth taking a look because it could be affecting other applications as well.Are there any logs that I can provide that would be useful for investigating it ?
How exactly issue represents? Stream not starting? Or updates only when you move mouse in window? If last, you can try to stream game wind...
interesting
does it do that for mobile too?
no
couldn't you present as desktop and instead patch the specific NativeFeatures checks that vesktop doesn't support
alr
oooh
i need to make a todo list of things i want to change in vesktop
@PolisanTheEasyNick sorry added context to the original comment, the framerate is abysmally low. I've tried running the game in windowed mode and full screen, and I also tried streaming both the game window and the monitor, all of the possible permutations involving this configuration and the issue happened in all of them
i doubt this changes anything for this webrtc stuff lol
true
something wrong with your system. nothing we can do
FWIW this seems to happen on fresh installs of both Debian 12 (stable at the time of writing) and 13 (testing): screensharing seems to work fine using Vencord's Flatpak release under X11, however trying to do the same under Wayland doesn't work at all, resulting in the same error @AprilTheCatgirl posted.
On the other hand, screensharing under Wayland with Vencord's native .deb package works flawlessly in Debian 13, while 12 has a lib...
@PolisanTheEasyNick sorry, I've added context to the original comment. The framerate is abysmally low.
I've tried running the game in windowed mode and full screen, and I also tried streaming both the game window and the whole screen, the issue persisted in all of the possible permutations involving these configurations
Could you do me a favor and open the debug menu and show what that menu looks like?
to open the debug menu, you need to:
- click on Voice connected in the bot...
I have issue: when I mouse mouse, the stream is lagging as hell. When cursor not moving, the stream is buttery smooth.
I recorded video to better see the issue. I use KDE Wayland, AMD RX 6900 XT, running second discord account in browser on second display to see my own stream. It doesn't matter if I stream whole display or specific window.
https://github.com/Vencord/Vesktop/assets/109820903/4c27e9ce-909c-4816-bf27-46f3949a4a38
@kaitlynkittyy The debug info when replicating the issue with MH:W The "input frame rate" at 1 is very suspect but I don't know what it refers to, my game is running normally  - 0bCdian
sorry but i dont think there is anything we can do for you. this is an issue with either your internet / network stack, or some dependency, or even discord itself
stuff like this is very much out of our control
my best advice is try reinstalling vesktop
most informative github issue comment
discord's web krisp code is broken. there is nothing we can do except wait and pray they fix it soon
@heady merlin discord moment lmao
horror
maybe we can do insane thing and patch their bundle to fix the issue
๐
we love fixing discord bugs for discord
BABHHAHAHAHHA
y e p
also
APPARENTLY HAVING A GAME OPEN LOCKS MY STREAMS TO MAX FRAMERATE???
im barely using any bitrate and streaming perfect 1080p60
you mean the insane thing I did with webpack?
forcing an error and running modified
here's a plugin that fixes the error until discord fixes it themselves. untested cause i'm too lazy to test audio quality, idk if it actually works or not
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "KrispFix",
description: "description",
authors: [Devs.Ven],
required: true,
patches: [{
find: "KrispSDK:init",
replacement: {
match: /=exports;/,
...
sorry but i dont think there is anything we can do for you. this is an issue with either your internet / network stack, or some dependency, or even discord itself
stuff like this is very much out of our control
my best advice is try reinstalling vesktop
I forgot to put it on the initial post, but I have already tried reinstalling Vesktop multiple times from different sources to no avail. I also mentioned that the exact same issue happens with Discord-Screnaudio, but also th...
okay who's good at css
im trying to rotate this menu so everything fits better
how do i make it wider
what menu
i tried width
display:flex and flex-direction
already done
hence the
everything being sideways
its still stuck to the same width though
yeah
i added a class to the div
and tried to edit it
i just wondered if there's something more than just
width
do you mean make the modal wider?
ModalRoot takes a modal size
yeah
you'll want to change it to chonky
o
i cannot for the life of me find it
its also late and im half asleep
i gOT it
WIP new screenshare modal
i can move it to another branch if people dont like the idea
i just feel like it makes sense that if im already adding a few options there i might as well make it a bit cleaner
alrighty
I'll do that tmrw
I pushed the changes just so I can mess with it on my laptop lmao
personally id only show the name of the source
so there's as much room as possible for how much there is to select
but
sources aren't getting a name for some reason
they never were
names aren't reliable
apps can set title themselves
it can be anything, doesn't even need to contain the app name
too squished
here's a plugin that fixes the error until discord fixes it themselves. untested cause i'm too lazy to test audio quality, idk if it actually works or not
import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; export default definePlugin({ name: "KrispFix", description: "description", authors: [Devs.Ven], required: true, patches: [{ find: "KrispSDK:init", replacement: { ...
here's a plugin that fixes the error until discord fixes it themselves. untested cause i'm too lazy to test audio quality, idk if it actually works or not
import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; export default definePlugin({ name: "KrispFix", description: "description", authors: [Devs.Ven], required: true, patches: [{ find: "KrispSDK:init", ...
wdym
You could use VxKex to run it, but this is not officially supported by Vesktop and update to Vesktop could break VxKex compatibility.
Describe the bug
You can install Vesktop on Windows 7. This could cause github issues such as #363
To Reproduce
- Install Vesktop on Windows 7.
- You will get error, so people could accidentally make invalid issues.
Expected behavior
Cannot even install, like many modern apps or just warning.
Screenshots
There is no really good screenshot to choose, so not provided and it's definitively not needed in this case.
**Desktop (please complete the followi...
@vernal lintel I've honestly not been able to be sure if any server side bitrate limitations exist other than the 4696 on dm calls(if it's even server side)
I have no idea what we should do
for non-nitro vs nitro
other than maybe lock the settings for streaming
how would i make it smaller and still fit all of this
id prefer to remove scrolling on that modal
i meant to make the preview smaller
yeah
if i did
itd have to be basically nonexistent to fit the rest of the stuff
(mostly because of mic workaround but im not complaining if it fixes stuff lmao)
without a preview at all it fits well
hmm
i just liked the idea of the preview on the side
i could keep this part the same and just
slap it on the side
idk
its not super important
just dont want this to be too cluttered
maybe make the screen resolution and frame rate a dropdown
nah
that seems like the kind of thing you want to advertise
preview is the least important thing on this menu
so therefore it should be of least priority to show
imo
or shorten the workaround text a bit
Describe the bug
Discord crashes when I try to click on screenshare, specifically when reading drivers.
To Reproduce
Expected behavior
Read all drivers.
Screenshots
https://github.com/Vencord/Vesktop/assets/58144443/9188cd4c-4cac-4462-9c22-ebbaf3320ac4
Desktop (please complete the following information):
- OS/Distro: Linux Mint
- Desktop Environment (linux only): Cinnamon
- Version: 22.04
Command line output
[arRPC > ipc] l...
Question, on kait's developing branch, does resizing the underlying window still break/ freeze the stream?
Other clients appear to suffer this want to know if the good old issue remains
Hmm, That and other streams starting boot out your own stream
if you mean trying to stream while watching other streams, i talked about it a few days ago, its a vanilla bug that is a pain to try and fix
.
and no its not a simple "reverse an array", its three calls to a function that end up sending in the wrong order if you're watching a stream
but it could be and im just blind
i fixed that
afaik
wild
it was just uhhh
i had to check if the current stream had the current user ID in it
if not
start one
i am not sure
have not tested
will test as soon as i get home
actually ill do it rn
what the hell
that is a WACKY issue
it mostly works
but it cuts off parts of the stream
like a bad crop
ill look into fixing that later but it may be another electron thing
we've found quite a few issues in electron
when the app's resolution updates
i doubt it's fixable lol
its not properly grabbed by the desktopcapturer
yeah
its not fixable by us afaik
electron may be able to do something
it's a flaw in the capturer
yeah
that's the thing that sucks about using electron you have very little control about that stuff
assuming they care enough
yeah
like whenever someone opens any graphical glitch issues it's an instant wontfix + closed as not planned

we've been debating dropping the capturer altogether for the raw webrtc apis for screensharing
but i shut that down as
way too much work
id rather bother electron

electron also returns the wrong ID for windows and monitors
and on top of that
it doesnt return app names at all
hence the app name not working
their capturer is
a mess
we have some open issues rn
to see if they ever fix that lmao
btw
is there a way to store something and have it remain the same across app launches (like a user preference)
a simple boolean really
settings api
noted
sorry i didnt mean to bother
that's just how i type usually
i use CRLFs as a form of punctuation
yes, hence why one sentence per message
you're doing like 2 words per message
yeah but then i cant use CRLF as punctuation
unless i do it like this and
do that
wdym
i just realised. that's, a catturtle
i mean yeah but waah that doesnt sound like me at all
You can
Like
Put multiple lines
In one message
you can just say you have this channel set to all messages or something and i wont do it but if its just preference i mean idk why i cant type however i want
you can use periods to add more spacing without line breaks. e.g.
I just realized. that's. a catturtle
or more crytyping style with commas
I just realized,, that's ,,, a catturtle??
you can talk how u want, i was just giving u 'feedback' cause it makes it kinda hard to read your messages
splitting multiple sentences across messages is good, but you split like one sentence into 3 messages and it makes it hard to follow :p
like the example i gave that everyone is somehow misinterpreting "i just realised that's a catturtle", it's one sentence without any punctuation so splitting it into 3 messages is weird 
that star guy from deltarune
I just realized that's a catturtle
ohhhhhhhhhhhhhhhhhhhhhhhhhh
that's fair
i can try and be a bit more readable here
fixed it
O.O
It seems that the screenshare function is cropping the output, but it's not adjusting the display to fit a 1080p canvas.
To illustrate, when I share a game running at 3440x1440 (21:9) resolution and set the screenshare to 1080p at 60fps, the image gets overcropped. However, in the official Discord client, the canvas is correctly scaled down to fit the selected resolution.
Screenshot example:
 resolution and set the screenshare to 1080p at 60fps, the image gets overcropped. However, in the official Discord client, the canvas is correctly scaled down to fit the selected resolution.
Screenshot example: :
- OS/Distro: Windows 11
- Version: 23H2
Hello, I have a little UX discussion around https://github.com/Vencord/Vesktop/pull/489 I would like some feedback on.
This is the new picker. I'm not too sure that keeping a Show Preview button here makes sense, if I understand correctly, it has been added to remove the preview to save up space to avoid having to scroll through the picker. I think that a new layout for this dialog would make more sense as the button already wastes some extra space for the default behaviour. A simpler, temporary, solution would be to increase the dialog's size by itself.
What does Vendicated think about this?
What if we create spoiler element with screen preview (like <details> html tag) instead of toggle button?
For default we can hide this spoiler and set text like "click to see preview" or smth
that's why i like the idea of doing it like this
it gives more room to expand on our options
while still showing the user what they chose
i think it looks really awful in a horizontal layout
interesting
looks asymetric and pushes the main content to the side
ahhh
main content should be close to the centre imo
that's a fair point
like the controls are the main centre of attention
mhm
so it should be central imo
which is why it bothers me that the audio controls are pushed off the modal and you have to scroll to them
imo either a collapsed thing or something you hover would be cool
oooh
hm
collapsed thing that has the preview in it?
or options
i think not options personally
yes the preview
alr
well actually lets just check how it looks in stock discord
it uses app name i believe
the uhh
instead of that radio
oooooooooh
i feel like another win would be to minimize the microphone workaround somehow
im thinking for the preview we could do something like this and when you hover it shows the preview as tooltip
that box usually shows the app name if you're not streaming your screen
what if i
add the change button
that would automatically make the box bigger
true
as of rn i just found another bug??????
it now always chooses 30fps
lemme try to force 60
nope
still 30
what the hell
lol, for me too
wha
this is weird
it was working just fine
did discord change something??????
am i
i think its limited to 720p30
But 15 fps limit setting up successfully. Means that our configuration works
mine wont go above 720p
mine too, only fps setting
did discord change something......
fucking hell
i swear if we have to stop faking browser useragent
@vernal lintel do you know anything
i know nothing sorry
you're fine
SZAME
while negotiationgs looks like we receive from servers something like:
[UnifiedConnection(stream)] updateVideoQuality: {
"remoteSinkWantsMaxFramerate": 30,
"encodingVideoFrameRate": 30
}
Maybe we can change it using the same way like we patched bitrate?
also after it we can see in logs this:
...
"maxBitrate": 8000000,
"maxFrameRate": 30,
...
so looks like it does setups this settings
heh or we can just try to call this updateVideoQuality function somehow and setup our values xD
we may set this maxFrameRate in our overrided getDisplayMedia function?
maybe????????
i will try, but i do not really know how to properly set it
looks like a war
1920/1.5 is just 1280
yep
xD maybe we can override functions of UnifiedConnection to do nothing?
but then it may not change resolutions where there are lack of bitrate. (maybe it is even a plus? On full hd we will always receive fullhd)
hmm
any ideas how to get UnifiedConnection object in code?
i may try and patch the encodingVideoFrameRate
we may have to do this
Can someone test streaming start when someone else have already enabled stream? Looks like it is broken for me in local p2p call
yeap, same for me
i dont know what changed, but something changed.
Streams are now limited to 720p30 and a few bugs that were fixed are now back.
We're working on resolving that.
it actually looks like some webrtc broken things.. or portal or smth
tf is videoBudget at all
looks like discord proprietary things
but we can try change all here
if you know how to get it in code
god
i am at such a loss
something is hardcoded to lock this
it definitely needs to be patched
i just dont know what to do
okay, so what we have:
- broken starting stream when someone streaming. When checking if there is another stream we use connection from MediaEngineStore
- broken track settupping of framerate and resolution. Track is getting from same connection
so maybe problem with connection object or smt?
it just hard to believe that two +- different issues are appeared at same time
IT IS
conn is undefined
which returned from MediaConnectionStore
try:
const conn = [...MediaEngineStore.getMediaEngine().connections][1];
console.log("Connection: ", conn);
And it will print:
Connection: undefined
why here [1]..
discord watching the pr and trolling us
wHAT
I FUCKING SWEAR
xd
IF THATS THE CASE IM MARCHING MYSELF OVER THERE AND SLAPPING WHOEVER BROKE IT
@vernal lintel can i get the vencord contributor badge

something on my end this
then*
i'm in local call, maybe it is a reason?
i dunno
i have only like this
odd
and it still
well its still normal
its just locked to low framerate
and low resolution
yeah
yes but i cant just give it to u
it works via the Devs object in src/utils/constants.ts in vencord codebase
need to add u there lol
its hardcoded into vencord isnt it- omg
that's fair lol
ill just add it after i work on volume booster
im focused on this rn lmao
funny that bitrate target is around 8k for nitro
@broken solstice opinions on all of this?
Look
i store input object as global variable, got MediaStream and here is 30 fps it track
and even no resolution variables
maybe somewhere in code we can get again this videotrack and patch it again
maybe
I mean, it's WIP but it could work if properly designed
maybe we can try to create some type of callback function when UnifiedConnection smth logs into console and patch connection's track again?
One sec, catching up the messages ๐
It's a binary option, the dropdown would have worse clarity imho
get ready to be annoyed
transceiver's sender does not have our patches too
did we ever patch the sender?
i think no, but it may be got when we patch while creating stream
The fact that something suddently changed for no apparent reason? No idea tbh
i mean created track may be putted in transceiver's sender object
i assume discord fucking
updated something
and it all died
Yep, my stream is at 720p30 again
Confirmed, it was working fine a few hours ago
i mean its still better than 1440p5
But target bitrate is somehow 6951 in private call?
interesting????
can we try to change it using patches like "find"->"replace"?
i thought i had this because i have nitro
im trying to find where it's initially set
Sorry, Anoushka wasn't watching
It's locked just like before...
Thought they were
oh lmao
but i'm not sure it will help in all problems(
resolution still broken
this new function
yeah but is that where its initially defined or is it being used as a variable there
read the code
i think we may also try to set constraints in track object, looks like discord taking res and fps info from this object
at least was taking
constraints.encodingVideoFrameRate = quality.encode.framerate;
interesting
getQuality(e) {
var t, n, i;
let r = this.isStreamContext ? this.getDesktopQuality() : this.getVideoQuality(this.connection.getLocalWant(e));
return new o({
encode: l.extend(r.encode, this.qualityOverwrite.encode),
capture: l.extend(r.capture, this.qualityOverwrite.capture),
bitrateMin: null !== (t = this.qualityOverwrite.bitrateMin) && void 0 !== t ? t : r.bitrateMin,
bitrateMax: null !== (n = this.qualityOverwrite.bitrateMax) && void 0 !== n ? n : r.bitrateMax,
bitrateTarget: null !== (i = this.qualityOverwrite.bitrateTarget) && void 0 !== i ? i : r.bitrateTarget,
localWant: r.localWant
})
}
setQuality(e) {
this.qualityOverwrite.capture = e.capture,
this.qualityOverwrite.encode = e.encode,
this.qualityOverwrite.bitrateMin = e.bitrateMin,
this.qualityOverwrite.bitrateMax = e.bitrateMax,
this.qualityOverwrite.bitrateTarget = e.bitrateTarget
}
thank god i can read it now
**ScreenSharePicker.tsx: **Lines 55-83
patches: [
{
find: "this.localWant=",
replacement: {
match: /this.localWant=/,
replace: "$self.patchStreamQuality(this);$&"
}
}
],
patchStreamQuality(opts: any) {
if (!currentSettings) return;
const framerate = Number(currentSettings.fps);
const height = Number(currentSettings.resolution);
const width = Math.round(height * (16 / 9));
Object.assign(opts, {
bitrateMin: 500000,
bitrateMax: 8000000,
bitrateTarget: 600000
});
Object.assign(opts.capture, {
framerate,
width,
height,
pixelCount: height * width
});
}
});
i would never have guessed
this
Object.assign(opts.capture, {
framerate,
width,
height,
pixelCount: height * width
});
needs to be adapted to the new api
Btw, jokes aside, we need to be very careful around the resolution/bitrate thing. It's, unfortunately, discord's right to cap that for non-nitro users.
If anything gets down to users, it needs to be "safe" around the TOS as much as reasonably possible...
im still learning how patches work
i agree
Sure, there will be plugins to override that safety for those who so choose but it shouldn't be automatic
Object.assign(opts.encode, {
framerate,
pixelCount: height * width
});
Object.assign(opts.capture, {
framerate,
width,
height
});
try this
wow so mean :(
HAHDJHKLASGJDKHG AHJS
xD
:(

see i would like
not say it in multiple messages
but i had no words
it works now
at least for me
let me push this
and see if it still works for others
Checking rn
also im in dm call and i have max bitrate?
8000kbps
i think it was just a broken api
I'll test as soon as you commit
in some reason im stick with 30 fps, so test it plz too
btw the fact that it hardcodes 16/9 resolution
idk if thats a good idea
just pushed it
shit
you right
hmm
well
the reason it does that is cuz height is the label (480, 720, 1080, 1440)
yeah, i thougth about it
We must create currentSettings.width parameter and rename resolution to height
but
hmm
but how do we let the user choose
choosing low resolutions on windows still works
i think for window we may just let discord to change resolutions itself
even if the window is super square
we need to test it
xd
welll i assume we can get dimensions of the thing shared
or just change resolution in system settings?
we can just use the aspect ratio of that instead
Bitrate still capped
are you sure someone was watching that?
at least fps and res working
UhhhHH
god damnit
what the fuck
As I've told you, I know the ways, I see them patterns ๐
maybe
eh
not a big deal
we dont go near it
once stream stabilises
1080p 51fps is only 964kbps
yet now, but in future we need to see how fix it :c
mhm
Also, is the starting a stream while watching another fixed as of rn?
i can't test rn
let me check
conn is "undefined" issue?.. if you can reproduce this
I'm not sure I can do anything more complex than a little testing after 8 hours of conservatory and 2 of programming
and now studying guitar cause I have lesson tomorrow
The most crucial one we never fixed tho eheh
// If there are 2 connections, the second one is the existing stream.
// In that case, we patch its quality
try {
var conn = [...MediaEngineStore.getMediaEngine().connections].find(
connection => connection.streamUserId === UserStore.getCurrentUser().id
);
} catch {
console.log("No current stream.");
}
console.log([...MediaEngineStore.getMediaEngine().connections]);
try {
if (conn.streamUserId === UserStore.getCurrentUser().id) {
const track = conn.input.stream.getVideoTracks()[0];
const frameRate = Number(settings.fps);
const height = Number(settings.resolution);
const width = Math.round(height * (16 / 9));
var constraints = track.getConstraints();
const newConstraints = {
...constraints,
frameRate,
advanced: [{ width: width, height: height }],
resizeMode: "none"
};
track.applyConstraints(newConstraints).then(() => {
console.log("Applied constraints from ScreenSharePicker successfully.");
console.log("New constraints:", track.getConstraints());
});
}
} catch {
console.log("No current stream.");
}
try {
if (!conn || conn.streamUserId !== UserStore.getCurrentUser().id) {
submit({
id: selected!,
...settings
});
}
} catch {
console.log("Unable to start stream.");
}
that's the stream code
ima test if it works
lmao why manually include the filename and line
if u enable sourcemaps, devtools automatically shows u
omfg
and u can even jump to it
i knew that
i

im still broken from thinking my past few days of nonstop work on streams was gone
okay
so
what the hell
there's a stream with my uid
as the streamuserid
if (conn.streamUserId === UserStore.getCurrentUser().id) {
const track = conn.input.stream.getVideoTracks()[0];
const frameRate = Number(settings.fps);
const height = Number(settings.resolution);
const width = Math.round(height * (16 / 9));
var constraints = track.getConstraints();
const newConstraints = {
...constraints,
frameRate,
advanced: [{ width: width, height: height }],
resizeMode: "none"
};
track.applyConstraints(newConstraints).then(() => {
console.log("Applied constraints from ScreenSharePicker successfully.");
console.log("New constraints:", track.getConstraints());
});
}
something here didnt work
hmm
what if we check whether userId and streamUserId is same? Like for WebRTC-2
Or i do miss smth
i think we need try to log what UserStore.getCurrentUser().id returns
Couple of logs from latest MR version:
(node:319439) UnhandledPromiseRejectionWarning: TypeError: Video was requested, but no video stream was provided
at AsyncFunction.<anonymous> (VCDMain:40:2411)
(Use `vesktop.bin --trace-warnings ...` to show where the warning was created)
(node:319439) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
TypeError is new one
I had this error when my xdg-desktop-portal needs restart and i have this error when i cancel picking screen for streaming
huh
interesting
I will report if I find further stuff
I'm considering how to prep for tomorrow's lesson
Cause I'm hella tired
also i think that this mini roadmap https://github.com/Vencord/Vesktop/pull/489#issuecomment-2043166651 we can move to PR's first message for convenience
the userid of the logged in user
Don't forget the cursor thing making fullscreen streaming unusable
we do
ik
i overplayed him:
and this if statement is still broken? Or problem now isn't with checks?
huh, I wonder about something
I mean, I don't think GNOME's xdg desktop portal can do that actually
I wonder if that would have the same issue as full monitor streaming
its fine and conn is set to the right stream
ohh it is strange issue
ahh
this fails
conn.input.stream is undefined
lemme see why
i think its an edge case
lemme try stuff
you can enter overwatch vc for testing starting when someone streaming if you want
okay
we cannot switch windows as of rn
because we bypass submit if the stream exists
and res
but not streamed window
hm
i need to see if something else is the same
yes, windows not changing
if window/stream id was a property of conn
i could check if that's equal to a new stream or something
and if not
replacetrack
if it is equal
dont replacetrack
found out that if we start stream window then fps for it will vary only when window updates. It confirms my theory about displaySurface type. Looks like Gnome or Gnome's portal did some optimizations of redrawing display or smth
interesting
looks good
i cant find window id on conn
btw
if it was supported by VA-API
id love to use one of these
also when we start streaming window than i have more than one portal's window/screen picker
it is a bug actually that we might fix in .tsx?
how
it was WAY easier than i thought
i just update the track after replacetrack is called 
xd
omfg
what do you think? xD
the VA-API linux driver literally does not support VP9
๐ฆ
it would fall back to H264 no matter what
H265 is like our only chance and its
not exactly supported
okay, looks like we returned to previous state
yeah
okay
biggest issue
cannot start stream when watching another stream
this is all that's left that isnt
bitrate related
maybe here we need to do more checks?
no
hm
or i think no
also
apparently changing windows cannot bring the resolution up from 30 to 60
just down from 60 to 30
i have theory
look
we getting connections array and getting [1] from it
But when we start watching stream, then it is already connection
ill investigate more
Interesting...
I mean, we're INCORRECTLY setting Window to Display which might be the root cause. What's being tracked? the cursor, for sure, it's the only thing that would cause a re-update no matter what in theory.
Also yeah, when streaming the console the framerate is lowered to only screen updates unless I move the cursor, even on a different surface (or monitor)
It looks like, by streaming the screen as a window, we're failing to track screen changes and only tracking cursor updates
yeah, the question now, is it GNOME or the custom software stack I'm running?
I'm going to test it hopefully soon
want me to install gnome and find out
If you want but you also have an AMD GPU so it might also play a role
we shall see
I actually realised that I have had broken screen capture in GNOME itself since I built my custom pipewire and rolled back from Rawhide...
Basically, they changed the API for GStreamer 1.24 and a future Pipewire version
I have backported the Pipewire stuff
But I'm no longer on Rawhide so there's probably an API break with GStreamer 1.23
GNOME also added support to the new explicit API some time ago
I'll just rebase to Rawhide and test
then rollback and also test with stock pipewire
At worst I could reset to a stock image temporarily
The things I do instead of sleeping or studying Guitar eh
But hey, I fixed the state transitions in FlatSync, for now
okay for now i have infinite loading when created stream but instant loaded stream if i change window for resolution
yeah but is the new stream able to be 60fps
xd no
yeah that's what im trying to figure out
but any ideas how to fix start of streaming?
not sure rn
okay so look what i got
when we change window then in some reason constraints are not applied.
But i tried to apply them right into console like this:
temp1.stream.getVideoTracks()[0].applyConstraints({ ...temp1.stream.getVideoTracks()[0].getConstraints(), frameRate: 60 })
And i got 60 fps. Interesting thing that resolution upped to 1920, but i didn't specified it
interesting
so it just needs reapplied
okay main issue is the dead stream on stream start while watching a stream
yes, but i really do not how if we really do it alrady
ill try and debug that after we fix this
huh
IT IS BROKEN IN DISCORD WEB
omg
it is even not our problem
when you create stream then connection creates but there are no stream object in conn.input
if we use stock webrtc functions instead of electron then we can create stream ourselves and just pass it into conn.input...
But i think we really should just wait for discord to fix it
i think we may work on reapplying constraints on change window button
omg why discord is so shitty ahaha
community must find and fix bugs in discord web
Okay
the cursor bug still happens in rawhide
I'll test stable without patches tomorrow
Good luck with the rest ๐
ill test in a moment
i think we may just ask some another users on gnome with gnome portal to test it
in 20m
gnome download time xD
i installed gnome in a container
Yeah, if anyone could test this, especially on Nvidia, it would be great
Keep in mind there's a good chance it's an issue with my custom stuff if no one else can reproduce it
why lol
nvm that
don't use client mods if you care that much lol
or don't use the plugin
yeah but we dont want discord to actively go after us or anything
they're not changing their stance cuz of this lol
in that case
lets figure out how to remove the weird 4696 bitrate limit its getting annoying
I'd test it but chromium has a bug which explodes multi gpu system support despair (i cant switch to just dgpu cause my laptop doesnt support it)
oh and apparently chromium vaapi with amd gpus is also broken so i cant even use hardware enc/decode on it
Yep, that's what I said. It should be safe by default
Although, to be honest they should be limiting this stuff server side anyways
Thanks nonetheless
Yeah, this wouldn't be necessary if they took proper care of their clients on Linux
I wonder if this limitation is present on Firefox btw
they do not give a single fuck
source: annie/dark
annie/dark had spotify autopause and nitro screenshare settings patched out
if they actually cared they would have strong enforcement on resolutions and bitrate, but thats unrealistic
cause its how source quality functions as is
lmfao
brilliant job discord
free forever? seems like it's just like a trial thing
lmao why
i mean i doubt anyone at discord gives a fuck about the spotify autopause, it's probably just cause spotify demanded it as part of the partnership
idk ask annie (prob laid off remote worker so
)
annie fired for her crimes
are u sure annie is the name of the staff and not just a codename
this is real
I noticed
"Fix bug where changing windows allows you to lower the fps but not raise it" - i can't reproduce it. Can someone retest?
Also found floating bug that running stream can just die. Propably discord negotiations breaking something? Or just problem with my system
huh
I have an RX 6800xt