fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.54k stars 803 forks source link

playing videos/audio from raspberry pi 3b fails, whilst working perfectly on windows. #242

Closed olvrb closed 7 years ago

olvrb commented 7 years ago

I have my discord bot with this:

            var stream = ytdl(url);
            var voiceChannel = message.member.voiceChannel;
            voiceChannel.join().then(connection => {
                console.log("joined channel and playing video");
                const dispatcher = connection.playStream(stream);
                dispatcher.on("end", end => {
                    console.log("left channel");
                    voiceChannel.leave();
                });
            }).catch(err => console.log(err));

(url is the user input) And it runs prefectly on Windows 10 Version 1703 (OS Build 15063.674).

When i try to run it on my Raspberry Pi 3b, however, it joins the channel, and instantly leaves. Here's the output from console i get from the pi:

Bot has started, with 106 users, in 44 channels of 3 guilds.
joined channel and playing video
left channel
Now playing "Ultimate Best of 20Syl / 2011-2015 / HQ Audio quality (1080p)"
fent commented 7 years ago

Could the dispatcher be emitting an error?

Maybe an audio engine isn't installed on your pi?

olvrb commented 7 years ago

I have all dependencies installed and listen in package.json, and am using the exact same files on my windows machine as on my pi. This issue describes pretty much the same thing.

fent commented 7 years ago

What about the possible error event from dispatcher, is that logged? What about errors from stream?

olvrb commented 7 years ago

I found out that the version of FFMPEG i had didn't support Raspbian. FFMPEG itself doesn't actually support Raspbian.