
Recherche avancée
Autres articles (57)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (4917)
-
avformat/mov : fix use invalid box size/type due to eof
26 avril 2022, par Zhao Zhili -
tests/fate-run.sh : Show packet flags for fate gapless tests.
26 septembre 2016, par Sasi Inguvatests/fate-run.sh : Show packet flags for fate gapless tests.
Signed-off-by : Sasi Inguva <isasi@google.com>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
Skipping extractors execution since zero extractors were registered (Use `node —trace-warnings ...` to show where the warning was created)
28 septembre 2023, par Parkster00I'm following a Discord Music Bot tutorial that uses ffmpeg, here is index.js


require("dotenv").config();

const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v9");
const { Client, Collection, Intents } = require('discord.js');
const { Player } = require("discord-player");

const fs = require("node:fs");
const path = require("node:path");

const client = new Client({
 intents: ["Guilds", "GuildMessages", "GuildVoiceStates"]
});

// Set up our commands into an array
const commands = [];
client.commands = new Collection();

const commandsPath = path.join(__dirname, "commands");
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(".js"));

for (const file of commandFiles) {
 console.log(`${file}`)
 console.log(`${commandsPath}`)
 const filePath = path.join(commandsPath, file);
 console.log(`${filePath}`)
 const command = require(filePath);

 client.commands.set(command.data.name, command);
 commands.push(command.data.toJSON());
}

// Create the player, highest quality audio
client.player = new Player(client, {
 ytdlOptions: {
 quality: "highestaudio",
 highWaterMark: 1 << 25
 }
});

// Commands are registered
client.on("ready", () => {
 const guild_ids = client.guilds.cache.map(guild => guild.id);

 const rest = new REST({ version: "9" }).setToken(process.env.TOKEN);
 for (const guildId of guild_ids) {
 rest.put(Routes.applicationGuildCommands(process.env.CLIENT_ID, guildId), {
 body: commands
 })
 .then(() => console.log(`Added commands to ${guildId}`))
 .catch(console.error);
 }

});

client.on("interactionCreate", async interaction => {
 if (!interaction.isCommand()) return;

 const command = client.commands.get(interaction.commandName);
 if (!command) return;

 try {
 await command.execute({ client, interaction });
 }
 catch (err) {
 console.error(err);
 await interaction.reply("An error occured while executing that command.");
 }
});

console.log(process.env.TOKEN);
client.login(process.env.TOKEN);



And here is play.js where I think the error originates :


const { SlashCommandBuilder } = require("@discordjs/builders");
const { EmbedBuilder } = require("discord.js");
const { QueryType } = require('discord-player');


module.exports = {
 data: new SlashCommandBuilder()
 .setName("play")
 .setDescription("Plays a song.")
 .addSubcommand(subcommand => {
 return subcommand
 .setName("search")
 .setDescription("Searches for a song.")
 .addStringOption(option => {
 return option
 .setName("searchterms")
 .setDescription("search keywords")
 .setRequired(true);
 })
 })
 .addSubcommand(subcommand => {
 return subcommand
 .setName("playlist")
 .setDescription("Plays playlist from YT")
 .addStringOption(option => {
 return option
 .setName("url")
 .setDescription("playlist url")
 .setRequired(true);

 })
 })
 .addSubcommand(subcommand => {
 return subcommand
 .setName("song")
 .setDescription("Plays song from YT")
 .addStringOption(option => {
 return option
 .setName("url")
 .setDescription("url of song")
 .setRequired(true);

 })
 }),
 execute: async ({ client, interaction }) => {

 if (!interaction.member.voice.channel) {
 await interaction.reply("You must be in a voice channel to use this command.");
 return;
 }

 const queue = await client.player.nodes.create(interaction.guild);

 if (!queue.connection) await queue.connect(interaction.member.voice.channel)

 let embed = new EmbedBuilder();
 if (interaction.options.getSubcommand() === "song") {
 let url = interaction.options.getString('url');

 const result = await client.player.search(url, {
 requestedBy: interaction.user,
 searchEngine: QueryType.YOUTUBE_VIDEO
 });

 console.log(result.tracks);

 if (result.tracks.length === 0) {
 await interaction.reply("no results found");
 return
 }

 const song = result.tracks[0];
 await queue.addTrack(song);

 embed
 .setDescription(`Added **[${song.title}](${song.url})** to the queue.`)
 .setThumbnail(song.thumbnail)
 .setFooter({ text: `Duration: ${song.duration}` });
 }

 else if (interaction.options.getSubcommand() === "playlist") {
 let url = interaction.options.getString('url');

 const result = await client.player.search(url, {
 requestedBy: interaction.SlashCommandBuilder,
 searchEngine: QueryType.YOUTUBE_PLAYLIST,
 });

 if (result.tracks.length === 0) {
 await interaction.reply("no playlist found");
 return
 }

 const playlist = result.playlist;
 await queue.addTracks(playlist);

 embed
 .setDescription(`Added **[${playlist.title}](${playlist.url})** to the queue.`)
 .setThumbnail(playlist.thumbnail)
 .setFooter({ text: `Duration: ${playlist.duration}` });
 }

 else if (interaction.options.getSubcommand() === "search") {
 let url = interaction.options.getString('searchterms');

 const result = await client.player.search(url, {
 requestedBy: interaction.SlashCommandBuilder,
 searchEngine: QueryType.AUTO,
 });

 if (result.tracks.length === 0) {
 await interaction.reply("no results found");
 return
 }

 const song = result.tracks[0]
 await queue.addTrack(song);

 embed
 .setDescription(`Added **[${song.title}](${song.url})** to the queue.`)
 .setThumbnail(song.thumbnail)
 .setFooter({ text: `Duration: ${song.duration}` });
 }

 if (!queue.playing) await queue.play();

 await interaction.reply({
 embeds: [embed]
 })
 }
}



Is ffmpeg called differently now ? Am I doing something wrong ?


I've tried different installs of Ffmpeg and none seem to work, so I'd imagine it originates somewhere in my code.