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

Go Live / Screenshare / Video Stream / Record #293

Closed
Fanisus opened this issue Sep 6, 2022 · 76 comments
Closed

Go Live / Screenshare / Video Stream / Record #293

Fanisus opened this issue Sep 6, 2022 · 76 comments
Labels
Feature Request a new feature

Comments

@Fanisus
Copy link

Fanisus commented Sep 6, 2022

Which package is the feature request for?

The core library

Feature

I am quite frustrated when I come to know that bots can't stream. If you know how to stream using this selfbot please do it. I am pretty sure like thousands of people are looking for it

I like some features like fps, quality, volume, etc

Ideal solution or implementation

Import module, make client join voice channel, make client turn on its video or stram and pipe the data through it

Alternative solutions or implementations

No response

Other context

No response

Update (by @aiko-chan-ai )

NPM Packages:

  • dank074/Discord-video-stream

npm install @dank074/discord-video-stream@latest
@Fanisus Fanisus added the Feature Request a new feature label Sep 6, 2022
@TheDevYellowy
Copy link
Contributor

Discord used WebRTC to stream both audio and video if you can find a way to connect to the server please tell me. I have been looking for months for a way @Fanisus

@Fanisus
Copy link
Author

Fanisus commented Sep 7, 2022

Isn't the server it connects to same as the voice server?

@TheDevYellowy
Copy link
Contributor

that's not what I meant to say, send the data is what I meant to say

@TheDevYellowy
Copy link
Contributor

TheDevYellowy commented Sep 7, 2022

It may help, I could also take a look at the discord application code again

@Fanisus
Copy link
Author

Fanisus commented Sep 7, 2022

I tried to code but I didn't know how to connect to discord rtc server
Does he have a discord server

@aiko-chan-ai
Copy link
Owner

https://github.com/tenable/DiscordClient
maybe it will help you

@JustAHippo
Copy link

Someone has done an implementation, however it is broken now:
https://github.com/MainSilent/Discord-Screenshare
For some odd reason the screenshares now just load forever

@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Nov 13, 2022

image

maybe ...

@TheDevYellowy
Copy link
Contributor

I have looked at this repo while trying to figure it out and there was no easy way to implement it, I was just about to make it a separate module that people could require so that both users and potentially bots can use it

@Fanisus
Copy link
Author

Fanisus commented Nov 13, 2022

Interesting

@aiko-chan-ai
Copy link
Owner

create a clone of djs/voice @TheDevYellowy

@TheDevYellowy
Copy link
Contributor

oh?

@TheDevYellowy
Copy link
Contributor

Lemme see what I can do with it

@Fanisus
Copy link
Author

Fanisus commented Nov 13, 2022

@aiko-chan-ai
Do you have a discord server if so can you send me the link?

@aiko-chan-ai
Copy link
Owner

@aiko-chan-ai Do you have a discord server if so can you send me the link?

discord can ban all members :c

@Fanisus
Copy link
Author

Fanisus commented Nov 13, 2022

O

@GillHoang
Copy link
Contributor

@aiko-chan-ai Do you have a discord server if so can you send me the link?

discord can ban all members :c

ban me too

@NekoCyan
Copy link
Contributor

@aiko-chan-ai Do you have a discord server if so can you send me the link?

discord can ban all members :c

ban me too

us* XD

@aiko-chan-ai
Copy link
Owner

https://github.com/aiko-chan-ai/Discord-video-experiment

@TheDevYellowy
Copy link
Contributor

@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Nov 17, 2022

does this work?

yep

@TheDevYellowy
Copy link
Contributor

TheDevYellowy commented Nov 17, 2022

huh, welp. time to figure out how to integrate it

@TheDevYellowy
Copy link
Contributor

unless you are already doing it, otherwise there is no point in me doing it

@dank074
Copy link

dank074 commented Nov 30, 2022

https://github.com/aiko-chan-ai/Discord-video-experiment

This is pretty good, thanks for sharing! I've managed to get the Go Live feature working with your repository and everything works great. However, I've been having trouble figuring out packetization of h264. Encoding to the current video format (VP8) uses a lot of cpu and I've found that ffmpeg is a lot better at encoding to h264. Any help is appreciated

@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Nov 30, 2022

This is pretty good, thanks for sharing! I've managed to get the Go Live feature working with your repository and everything works great. However, I've been having trouble figuring out packetization of h264. Encoding to the current video format (VP8) uses a lot of cpu and I've found that ffmpeg is a lot better at encoding to h264. Any help is appreciated

vp8 codec was used in the original repo, I just edited it to work with user accounts :c

Update: There are some small changes that increase video processing speed and use less cpu

@dank074
Copy link

dank074 commented Dec 1, 2022

Update: There are some small changes that increase video processing speed and use less cpu

Of course there was a flag for that 🤦‍♂️ Thank you !

@yourantithesis
Copy link

this repository can sharescreen, but using a selenium / chromium i think.
here's the repo : https://github.com/MainSilent/Discord-Screenshare

@dank074
Copy link

dank074 commented Dec 3, 2022

this repository can sharescreen, but using a selenium / chromium i think. here's the repo : https://github.com/MainSilent/Discord-Screenshare

you don't need selenium for screenshare, you can pipe the video directly like what aiko-chan-ai did in his repository. You have to start a new voiceConnection though and when sending the OP code 0 (which is Identify) you send the rtc_server_id instead of the guild id for server_id

@aiko-chan-ai
Copy link
Owner

Oke

@dank074
Copy link

dank074 commented Feb 16, 2023

It's better if I can control the stream 😢

What do you mean control the stream?

@aiko-chan-ai
Copy link
Owner

What do you mean control the stream?

Pause, seek, speed, ...

@dank074
Copy link

dank074 commented Feb 16, 2023

What do you mean control the stream?

Pause, seek, speed, ...

Oh that's tough. I have no idea how to do it

@aiko-chan-ai
Copy link
Owner

Oh that's tough. I have no idea how to do it

😢

@TheDevYellowy
Copy link
Contributor

I'll take a look

@aiko-chan-ai
Copy link
Owner

if this feature is available in @discordjs/voice it will be great

@dank074
Copy link

dank074 commented Feb 24, 2023

if this feature is available in @discordjs/voice it will be great

I don't have much free time right now but I can see if I can add it there when I get a chance

@batrachophagous1
Copy link

@dank074 how would I make it screenshare puppeteer?

@dank074
Copy link

dank074 commented Feb 25, 2023

@dank074 how would I make it screenshare puppeteer?

Added sample code here: dank074/Discord-video-stream@32c258d

Couldn't think of a way to distinguish video/audio chunks in the stream so had to use ffmpeg to separate them. If anyone has any idea then it would greatly reduce the latency (ffmpeg takes a while to re-encode the video/audio)

@batrachophagous1
Copy link

@dank074 do you have a discord?

@dank074
Copy link

dank074 commented Feb 28, 2023

@dank074 do you have a discord?

speaking about this on discord is an easy way to get banned since this violates their ToS

@batrachophagous1
Copy link

@aiko-chan-ai that is not me.

@aiko-chan-ai aiko-chan-ai changed the title Video Stream Video Stream (https://github.com/dank074/Discord-video-stream) Mar 5, 2023
@aiko-chan-ai aiko-chan-ai changed the title Video Stream (https://github.com/dank074/Discord-video-stream) Video Stream (dank074/Discord-video-stream) Jul 13, 2023
@aiko-chan-ai
Copy link
Owner

@aiko-chan-ai aiko-chan-ai changed the title Video Stream (dank074/Discord-video-stream) Go Live / Screenshare / Video Stream Jul 13, 2023
@MemeCornucopia
Copy link

is there any way to get video streams from other people in the vc.

@aiko-chan-ai
Copy link
Owner

@MemeCornucopia
Copy link

Cuz I'm tryna make a self bot using googles Gemini that sees you in VC and talks to you using the context of what's going on, on your discord camera.

@MemeCornucopia
Copy link

Also hah it's on line 69

@MemeCornucopia
Copy link

What format is the packet in?

@dank074
Copy link

dank074 commented Dec 18, 2023

What format is the packet in?

it's just a regular rtp packet. Look at how discord.js currently handles receiving voice; basically you first have to decrypt the packet then just decode the payload data from the rtp packet

@BadBanOfficial
Copy link

any update on this article 2024?

@aiko-chan-ai
Copy link
Owner

you can use it

@BadBanOfficial
Copy link

you can use it

how?

@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Jan 23, 2024

@aiko-chan-ai aiko-chan-ai changed the title Go Live / Screenshare / Video Stream Go Live / Screenshare / Video Stream / Record Oct 29, 2024
@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Oct 29, 2024

is there any way to get video streams from other people in the vc.

Update on October 29, 2024

After a long delay due to researching Discord's UDP protocol & RTP, nearly all the features in the following list are now functioning in version 3.4.2:

  • Live video streaming (code by @dank074 and collaborators)
  • Recording audio/video (code by discord.js, FFmpeg, with implementation by myself)

Summary:

Hope you enjoy it, special thanks to @dank074!

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

No branches or pull requests

16 participants