Recherche avancée

Médias (1)

Mot : - Tags -/punk

Autres articles (95)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP 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 (8032)

  • Audio not playing in discord bot(discord.js)

    25 juin 2021, par Manas Prakash

    I have created a discord bot using discord.js that plays music.
But it is not playing any music...
I tried this but it didn't work, also tried installing multiple ffmpeg libraries.
Here is my Code :

    


    const Discord = require("discord.js");
const dotenv = require("dotenv");
const ytdl = require("ytdl-core");
const ytSearch = require("yt-search");

dotenv.config();

const prefix = "#";
const queue = new Map();

let loop = false;
let count = 1;

const bot = new Discord.Client();

bot.on("ready", () => {
  bot.user.setActivity("Doomer", { type: "LISTENING" });
  console.log("Boomer Online");
});

bot.on("message", async (message) => {
  const args = message.content.slice(prefix.length + 4).split(" ");
  const voice_channel = message.member.voice.channel;
  if (!voice_channel) return;

  const server_queue = queue.get(message.guild.id);

  if (message.content.toLowerCase().startsWith(`${prefix}play`)) {
    if (message.content === `${prefix}play`)
      return message.channel.send("Pls Enter the second srgument");
    let song = {};

    if (ytdl.validateURL(args[1])) {
      const song_info = await ytdl.getInfo(args[1]);
      song = {
        title: song_info.videoDetails.title,
        url: song_info.videoDetails.video_url
      };
    } else {
      const video_finder = async (query) => {
        const video_result = await ytSearch(query);
        return video_result.videos.length > 1 ? video_result.videos[0] : null;
      };

      const video = await video_finder(args.join(" "));
      if (video) {
        song = { title: video.title, url: video.url };
      } else {
        message.channel.send("Error finding video.");
      }
    }

    if (!server_queue) {
      const queue_constructor = {
        voice_channel: voice_channel,
        text_channel: message.channel,
        connection: null,
        songs: []
      };

      queue.set(message.guild.id, queue_constructor);
      queue_constructor.songs.push(song);

      try {
        const connection = await message.member.voice.channel.join();
        queue_constructor.connection = connection;
        video_player(message.guild, queue_constructor.songs[0]);
      } catch (err) {
        queue.delete(message.guild.id);
        message.channel.send("There was an error connecting!");
        throw err;
      }
    } else {
      server_queue.songs.push(song);
      return message.channel.send(`-
  • Skipping extractors execution since zero extractors were registered (Use `node —trace-warnings ...` to show where the warning was created)

    28 septembre 2023, par Parkster00

    I'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.

    


  • -preset veryslow not working with -vcodec copy using ffmpeg

    27 février 2023, par Amit Hapase

    I am new to ffmpeg. I am usingffmpeg command to trim x265 mkv video and compress it as much as possible without losing quality. I am using -preset option with veryslow argument to make file smaller in size. I am also using -vcode copy and -acodec copy options with that.

    


    Input file info :
Name : movie.mkv
Size : 4.42 GB
Length : 02:42:01

    


    
ffmpeg \

-i movie.mkv \

-ss 01:21:46 \

-t 00:05:27 \

-crf 0 \

-vcodec copy \

-acodec copy \

-preset veryslow \

song.mkv



    


    The above command completing it's execution within a second and the size of song.mkv file is 150 MB.

    


    I don't think that it should complete the process within a single second with -preset veryslow argument. The -preset veryslow argument is suppose to take longer and make better compression ?