Closed 002-sans closed 5 months ago
I had an error while installing the module but the problem was fixed by forcing the installation `npm i -f'.
The stream system works well this time! I leave the code for those who want:
const { Streamer, streamLivestreamVideo } = require('@dank074/discord-video-stream')
const Discord = require('discord.js-selfbot-v13');
const { DiscordStreamClient } = require('discord-stream-client');
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfmpegPath(ffmpegPath)
const token = '';
const guildId = ""
const channelId = ""
const videolink = ""
const streamer = new Streamer(new Discord.Client());
streamer.client.login(token);
streamer.client.on('ready', async client => {
console.log('Ready!', client.user.tag);
await streamer.joinVoice(guildId, channelId);
const udp = await streamer.createStream();
udp.mediaConnection.setSpeaking(true);
udp.mediaConnection.setVideoStatus(true);
try {
const res = await streamLivestreamVideo(videolink, udp);
console.log("Finished playing video " + res);
} catch (e) {
console.log(e);
} finally {
udp.mediaConnection.setSpeaking(false);
udp.mediaConnection.setVideoStatus(false);
}
});
Which package has the bugs?
The core library
Issue description
Hi! I tried to make a stream (from a
.mp4
link). I had several mistakes that I managed to fix. But the error I can’t fix (even when editing the module) isDiscordStreamClientError: Invalid stream (No metadata)
Code sample
Package version
latest (djs:
3.1.4
, stream-client:1.4.8
)Node.js version
16.19.0
Operating system
windows
Priority this issue should have
Low (slightly annoying)
Checklist
Additional Information
I got the same error with the video .mp4 u put on github.