
Recherche avancée
Autres articles (91)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe 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 (...)
Sur d’autres sites (3648)
-
ffmpeg datascope filter : How does it works ?
25 octobre 2022, par tonyI'm trying to see how the datascope filter is displaying the color values for a black and white image. I was expecting to see a part of the image with 0xfff and one with 0x000 value,
instead I obtained only the 0xfff for white


ffmpeg \
-f lavfi -i color=white:100x100 \
-f lavfi -i color=black:100x100 \
-lavfi '[0:v][1:v]hstack[out]' \
-map [out] \
-frames 1 \
blackAndWhite.png ; \


ffmpeg \
-i blackAndWhite.png \
-vf 'datascope' \
data.png





-
Pyinstaller exe works halfway on another computer
5 novembre 2022, par At BayI wrote a code which uses FFMPEG and os, subprocess, datetime, speechrecognition, and xlsxwriter libraries. Below a brief sketch of the code - it goes through a directory of wav files and creates a transcription for X seconds in length and saves it into an excel sheet.
import os
import subprocess
import datetime
import speech_recognition as sr
import xlsxwriter


def ffmpeg():
 #create clip
 subprocess.run(["ffmpeg", "-ss", starti, "-t", lengthi, "-i", filepathO, filepathNEW1])

 #convert to mono
 subprocess.run(["ffmpeg", "-i", filepathNEW1, "-ac", "1", filepathNEW2])
 
 #compres to 44.1 kHZ
 subprocess.run(["ffmpeg", "-i", filepathNEW2, "-ar", "44100", filepathNEW3])

def transcription():
 with sr.AudioFile(os.path.abspath(clippath)) as source:
 audio = r.record(source) # read the entire audio file
 transcriptstring = str(r.recognize_google(audio, language = 'en', show_all=True))
 worksheet.write(tcol, transcriptstring)


#call functions in this order
for filename in os.listdir(ufolder):
 if (filename.endswith(".wav")):
 ffmpeg() #cuts clips, compresses to mono and 44.1 khz
 transcription() 

workbook.close()




When I try to run the exe created by pyinstaller, I get the following error :


Enter directory of wav files: C:\Users\myname\Downloads\
Enter clip start (seconds): 0
Enter desired clip length (seconds): 5
Traceback (most recent call last):
 File "cliptranscript.py", line 134, in <module>
 File "cliptranscript.py", line 47, in ffmpeg
 File "subprocess.py", line 503, in run
 File "subprocess.py", line 971, in __init__
 File "subprocess.py", line 1440, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
[13304] Failed to execute script 'cliptranscript' due to unhandled exception!
</module>


Below is a partial view of the folder created by pyinstaller :



-
My discord music bot works locally, but not on a server [closed]
8 décembre 2022, par AsmondyaI have an issue with my discord music bot that I made with discord.js v14.


When I run it locally, it works fine and plays music as it should. But when I put in on a server (here I use Vultr), it doesn't work.


I am not sure but it might come from FFmpeg. I am kinda desperate and cant really figure where the issue is from. I think it is FFmpeg because it is what converts the music.


What happens :


Me: !play a music
Bot: Now playing a music
*and right after, without playing the music*
Bot: Music finished



What should normally happen is that same thing but the "music finished" should be sent when the queue is finished.


The thing is that the bot works perfectly locally, but does this when it is hosted on a server. Also I don't have any error messages or else. It just doesn't play the music like if the music was 0 seconds length.


I tried making sure everything is installed on the server, same as making sure ffmpeg was installed globally and I have the good version of it. Here is the answer I have to the "ffmpeg -version" command :enter image description here.


Does anyone know what could be the issue or what could cause it ? I can show some code if needed, even tho it works perfectly fine locally.


Here's my code :


const { DisTube } = require('distube')
const Discord = require('discord.js')
const { EmbedBuilder } = require('discord.js')
const client = new Discord.Client({
 intents: [
 Discord.GatewayIntentBits.Guilds,
 Discord.GatewayIntentBits.GuildMessages,
 Discord.GatewayIntentBits.GuildVoiceStates,
 Discord.GatewayIntentBits.MessageContent,
 ]
})
const { ActivityType } = require('discord.js')
const fs = require('fs')
const dotenv = require("dotenv")
dotenv.config()
const { SpotifyPlugin } = require('@distube/spotify')
const { SoundCloudPlugin } = require('@distube/soundcloud')
const { YtDlpPlugin } = require('@distube/yt-dlp')

client.distube = new DisTube(client, {
 leaveOnStop: false,
 emitNewSongOnly: true,
 emitAddSongWhenCreatingQueue: false,
 emitAddListWhenCreatingQueue: false,
 plugins: [
 new SpotifyPlugin({
 emitEventsAfterFetching: true
 }),
 new SoundCloudPlugin(),
 new YtDlpPlugin()
 ]
})
client.commands = new Discord.Collection()
client.aliases = new Discord.Collection()

fs.readdir('./commands/', (err, files) => {
 if (err) return console.log('Could not find any commands!')
 const jsFiles = files.filter(f => f.split('.').pop() === 'js')
 if (jsFiles.length <= 0) return console.log('Could not find any commands!')
 jsFiles.forEach(file => {
 const cmd = require(`./commands/${file}`)
 console.log(`Loaded ${file}`)
 client.commands.set(cmd.name, cmd)
 if (cmd.aliases) cmd.aliases.forEach(alias => client.aliases.set(alias, cmd.name))
 })
})

client.on('ready', () => {
 console.log(`${client.user.tag} is ready to play music.`)
})

client.on('messageCreate', async message => {
 if (message.author.bot || !message.guild) return
 const prefix = "!"
 if (!message.content.startsWith(prefix)) return
 const args = message.content.slice(prefix.length).trim().split(/ +/g)
 const command = args.shift().toLowerCase()
 const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))
 if (!cmd) return
 if (cmd.inVoiceChannel && !message.member.voice.channel) {
 return message.channel.send(`You must be in a voice channel!`)
 }
 try {
 cmd.run(client, message, args)
 } catch (e) {
 console.error(e)
 message.channel.send(`Error: \`${e}\``)
 }
})

// Add filters to the queue status :
// | Filter: \`${queue.filters.names.join(', ') || 'Off'}\` 

const status = queue =>
 `Volume: \`${queue.volume}%\` | Loop: \`${
 queue.repeatMode ? (queue.repeatMode === 2 ? 'All Queue' : 'This Song') : 'Off'
 }\` | Autoplay: \`${queue.autoplay ? 'On' : 'Off'}\``
client.distube
 .on('playSong', (queue, song) =>
 queue.textChannel.send({
 embeds: [
 new Discord.EmbedBuilder()
 .setTitle('Now playing')
 .setDescription(`\`${song.name}\` - \`${song.formattedDuration}\`\n${status(queue)}\n\nRequested by: \`${song.user.tag}\``)
 .setThumbnail(`${song.thumbnail}`)
 ]
 })
 )
 .on('addSong', (queue, song) =>
 queue.textChannel.send({
 embeds: [
 new Discord.EmbedBuilder()
 .setTitle('Song added to the queue')
 .setDescription(`${song.name} - \`${song.formattedDuration}\`\n\nRequested by: \`${song.user.tag}\``)
 .setThumbnail(`${song.thumbnail}`)
 ]
 })
 )
 .on('addList', (queue, playlist) =>
 queue.textChannel.send({
 embeds: [
 new Discord.EmbedBuilder()
 .setTitle(`Playlist added to the queue`)
 .setDescription(`\`${playlist.name}\` (${
 playlist.songs.length
 } songs)\n${status(queue)}\n\nRequested by: \`${song.user.tag}\``)
 .setThumbnail(`${song.thumbnail}`)
 ]
 })
 )
 .on('error', (channel, e) => {
 if (channel) channel.send(`An error encountered: ${e.toString().slice(0, 1974)}`)
 else console.error(e)
 })
 .on('empty', channel => channel.send('There is no one here. Im alone, again...'))
 .on('searchNoResult', (message, query) =>
 message.channel.send(`No result found for \`${query}\`!`)
 )
 .on('finish', queue => queue.textChannel.send("https://tenor.com/view/end-thats-all-folks-gif-10601784"))

client.on("ready", () => {
 client.user.setPresence({
 activities: [{
 name: 'AURORA',
 type: ActivityType.Listening
 }],
 status: "idle"
 })
})

client.login(process.env.TOKEN)



It does come from my ffpmeg, I need to install one of these packages instead of the npm installation : https://github.com/BtbN/FFmpeg-Builds/releases


How do I install it on a server (Vultr) ?