Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Que fait exactement ce script ?

    18 janvier 2011, par

    Ce script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
    Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
    Installation de dépendances de MediaSPIP
    Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
    Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)

Sur d’autres sites (10932)

  • Mimic Audacity amplification with Pydub

    16 août 2022, par Unisionzz

    For my music library I have used Audacity for recent years to amplify the music to similar levels of loudness ; technically speaking this is not completely true, but for me it is sufficient. However, as it is tedious to do this all by hand, I decided to write a Python code to automate this process for me. The code after the imported package(s) and defined functions will run in a loop in which the filename changes depending on which song is processed.

    


    The difficult part is that I have not yet been able to find a consistent way to amplify different songs so that when the output files are put through Audacity, it will not want to change the amplitude by more than 0.1 dB(FS).

    


    Below are two attempts which seem to have come closest to the desirable output ; other methods that I have tried were either less succesfull or resulted in clipping.

    


    The first attempt finds the maximum dBFS of the song and then applies a gain in order for the maximum dBFS to equal 0 (I have also tried this method with sound.dBFS and sound.apply_gain, but results seem more mixed than the attempt below) :

    


    from pydub import AudioSegment

def change_amplitude(sound, target_dBFS):
    change_in_dBFS = target_dBFS - sound.max_dBFS
    return sound.apply_gain_stereo(change_in_dBFS)

# Audio is gathered from a hard coded path
s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")
amp_s = change_amplitude(s, 0)
amp_s.export(Dir+filename+".mp3", format = "mp3")


    


    The second attempt finds the amplitude and the maximum allowable amplitude (before clipping), recalculates both to dB and then adds the dB_diff to the sound :

    


    import numpy as np
from pydub import AudioSegment

s = AudioSegment.from_file(Dir+filename+".mp3", "mp3")

# Get dB amplitude of song and maximum allowable value
dB_sound = 20*np.log10(s.max)
dB_max = 20*np.log10(s.max_possible_amplitude)
dB_diff = dB_max - dB_sound

amp_sound = s + dB_diff


    


    Summarizing, I would like to import a music file, amplify it similar to Audacity amplification and then export the file again.

    


  • Trouble with converting webm into mp3 with pydub in python

    15 août 2020, par rc_marty

    so basically I want to convert song what I downloaded from youtube in webm and convert to into mp3

    


    when I wanted export song just with song.export("neco.mp3") it didn't work too

    


    I have in workfolder ffmpeg.exe and ffprobe.exe

    


    here is the code

    


    from pydub import AudioSegment

song = AudioSegment.from_file(downloaded.webm,"webm")
print("Loaded")
song.export("neco.mp3", format="mp3", bitrate="320k")
print("Converted and saved")


    


    here is the output of the console

    


    Loaded&#xA;Traceback (most recent call last):&#xA;  File "e:/martan/projekty/Python/programek na pisnicky/songDownloader.py", line 188, in <module>&#xA;    song.export("neco.mp3", format="mp3", bitrate="320k")&#xA;  File "C:\Users\BIBRAIN\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\audio_segment.py", line 911, in export&#xA;    raise CouldntEncodeError(&#xA;pydub.exceptions.CouldntEncodeError: Encoding failed. ffmpeg/avlib returned error code: 1&#xA;&#xA;Command:[&#x27;ffmpeg&#x27;, &#x27;-y&#x27;, &#x27;-f&#x27;, &#x27;wav&#x27;, &#x27;-i&#x27;, &#x27;C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpo20ooz_z&#x27;, &#x27;-b:a&#x27;, &#x27;320k&#x27;, &#x27;-f&#x27;, &#x27;mp3&#x27;, &#x27;C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpiqpl57g7&#x27;]&#xA;&#xA;Output from ffmpeg/avlib:&#xA;&#xA;ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200726&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Guessed Channel Layout for Input Stream #0.0 : stereo&#xA;Input #0, wav, from &#x27;C:\Users\BIBRAIN\AppData\Local\Temp\tmpo20ooz_z&#x27;:&#xA;  Duration: 00:03:54.71, bitrate: 3072 kb/s&#xA;    Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 3072 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (pcm_s32le (native) -> mp3 (mp3_mf))&#xA;Press [q] to stop, [?] for help&#xA;[mp3_mf @ 00000000004686c0] could not find any MFT for the given media type&#xA;[mp3_mf @ 00000000004686c0] could not create MFT&#xA;Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height&#xA;Conversion failed!&#xA;</module>

    &#xA;

    I think it is something with codec but I have no idea what to do

    &#xA;

  • My discord music bot works locally, but not on a server [closed]

    8 décembre 2022, par Asmondya

    I have an issue with my discord music bot that I made with discord.js v14.

    &#xA;

    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.

    &#xA;

    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.

    &#xA;

    What happens :

    &#xA;

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

    &#xA;

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

    &#xA;

    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.

    &#xA;

    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.

    &#xA;

    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.

    &#xA;

    Here's my code :

    &#xA;

    const { DisTube } = require(&#x27;distube&#x27;)&#xA;const Discord = require(&#x27;discord.js&#x27;)&#xA;const { EmbedBuilder } = require(&#x27;discord.js&#x27;)&#xA;const client = new Discord.Client({&#xA;  intents: [&#xA;    Discord.GatewayIntentBits.Guilds,&#xA;    Discord.GatewayIntentBits.GuildMessages,&#xA;    Discord.GatewayIntentBits.GuildVoiceStates,&#xA;    Discord.GatewayIntentBits.MessageContent,&#xA;  ]&#xA;})&#xA;const { ActivityType } = require(&#x27;discord.js&#x27;)&#xA;const fs = require(&#x27;fs&#x27;)&#xA;const dotenv = require("dotenv")&#xA;dotenv.config()&#xA;const { SpotifyPlugin } = require(&#x27;@distube/spotify&#x27;)&#xA;const { SoundCloudPlugin } = require(&#x27;@distube/soundcloud&#x27;)&#xA;const { YtDlpPlugin } = require(&#x27;@distube/yt-dlp&#x27;)&#xA;&#xA;client.distube = new DisTube(client, {&#xA;  leaveOnStop: false,&#xA;  emitNewSongOnly: true,&#xA;  emitAddSongWhenCreatingQueue: false,&#xA;  emitAddListWhenCreatingQueue: false,&#xA;  plugins: [&#xA;    new SpotifyPlugin({&#xA;      emitEventsAfterFetching: true&#xA;    }),&#xA;    new SoundCloudPlugin(),&#xA;    new YtDlpPlugin()&#xA;  ]&#xA;})&#xA;client.commands = new Discord.Collection()&#xA;client.aliases = new Discord.Collection()&#xA;&#xA;fs.readdir(&#x27;./commands/&#x27;, (err, files) => {&#xA;  if (err) return console.log(&#x27;Could not find any commands!&#x27;)&#xA;  const jsFiles = files.filter(f => f.split(&#x27;.&#x27;).pop() === &#x27;js&#x27;)&#xA;  if (jsFiles.length &lt;= 0) return console.log(&#x27;Could not find any commands!&#x27;)&#xA;  jsFiles.forEach(file => {&#xA;    const cmd = require(`./commands/${file}`)&#xA;    console.log(`Loaded ${file}`)&#xA;    client.commands.set(cmd.name, cmd)&#xA;    if (cmd.aliases) cmd.aliases.forEach(alias => client.aliases.set(alias, cmd.name))&#xA;  })&#xA;})&#xA;&#xA;client.on(&#x27;ready&#x27;, () => {&#xA;  console.log(`${client.user.tag} is ready to play music.`)&#xA;})&#xA;&#xA;client.on(&#x27;messageCreate&#x27;, async message => {&#xA;  if (message.author.bot || !message.guild) return&#xA;  const prefix = "!"&#xA;  if (!message.content.startsWith(prefix)) return&#xA;  const args = message.content.slice(prefix.length).trim().split(/ &#x2B;/g)&#xA;  const command = args.shift().toLowerCase()&#xA;  const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))&#xA;  if (!cmd) return&#xA;  if (cmd.inVoiceChannel &amp;&amp; !message.member.voice.channel) {&#xA;    return message.channel.send(`You must be in a voice channel!`)&#xA;  }&#xA;  try {&#xA;    cmd.run(client, message, args)&#xA;  } catch (e) {&#xA;    console.error(e)&#xA;    message.channel.send(`Error: \`${e}\``)&#xA;  }&#xA;})&#xA;&#xA;// Add filters to the queue status :&#xA;// | Filter: \`${queue.filters.names.join(&#x27;, &#x27;) || &#x27;Off&#x27;}\` &#xA;&#xA;const status = queue =>&#xA;  `Volume: \`${queue.volume}%\` | Loop: \`${&#xA;    queue.repeatMode ? (queue.repeatMode === 2 ? &#x27;All Queue&#x27; : &#x27;This Song&#x27;) : &#x27;Off&#x27;&#xA;  }\` | Autoplay: \`${queue.autoplay ? &#x27;On&#x27; : &#x27;Off&#x27;}\``&#xA;client.distube&#xA;  .on(&#x27;playSong&#x27;, (queue, song) =>&#xA;    queue.textChannel.send({&#xA;      embeds: [&#xA;        new Discord.EmbedBuilder()&#xA;          .setTitle(&#x27;Now playing&#x27;)&#xA;          .setDescription(`\`${song.name}\` - \`${song.formattedDuration}\`\n${status(queue)}\n\nRequested by: \`${song.user.tag}\``)&#xA;          .setThumbnail(`${song.thumbnail}`)&#xA;      ]&#xA;    })&#xA;  )&#xA;  .on(&#x27;addSong&#x27;, (queue, song) =>&#xA;    queue.textChannel.send({&#xA;      embeds: [&#xA;        new Discord.EmbedBuilder()&#xA;          .setTitle(&#x27;Song added to the queue&#x27;)&#xA;          .setDescription(`${song.name} - \`${song.formattedDuration}\`\n\nRequested by: \`${song.user.tag}\``)&#xA;          .setThumbnail(`${song.thumbnail}`)&#xA;      ]&#xA;    })&#xA;  )&#xA;  .on(&#x27;addList&#x27;, (queue, playlist) =>&#xA;    queue.textChannel.send({&#xA;      embeds: [&#xA;        new Discord.EmbedBuilder()&#xA;          .setTitle(`Playlist added to the queue`)&#xA;          .setDescription(`\`${playlist.name}\` (${&#xA;            playlist.songs.length&#xA;          } songs)\n${status(queue)}\n\nRequested by: \`${song.user.tag}\``)&#xA;          .setThumbnail(`${song.thumbnail}`)&#xA;      ]&#xA;    })&#xA;  )&#xA;  .on(&#x27;error&#x27;, (channel, e) => {&#xA;    if (channel) channel.send(`An error encountered: ${e.toString().slice(0, 1974)}`)&#xA;    else console.error(e)&#xA;  })&#xA;  .on(&#x27;empty&#x27;, channel => channel.send(&#x27;There is no one here. Im alone, again...&#x27;))&#xA;  .on(&#x27;searchNoResult&#x27;, (message, query) =>&#xA;    message.channel.send(`No result found for \`${query}\`!`)&#xA;  )&#xA;  .on(&#x27;finish&#x27;, queue => queue.textChannel.send("https://tenor.com/view/end-thats-all-folks-gif-10601784"))&#xA;&#xA;client.on("ready", () => {&#xA;  client.user.setPresence({&#xA;      activities: [{&#xA;        name: &#x27;AURORA&#x27;,&#xA;        type: ActivityType.Listening&#xA;      }],&#xA;      status: "idle"&#xA;  })&#xA;})&#xA;&#xA;client.login(process.env.TOKEN)&#xA;

    &#xA;

    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

    &#xA;

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

    &#xA;