Recherche avancée

Médias (91)

Autres articles (61)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (7560)

  • Discord.js voice stop playing audio after 10 consecutive files

    29 avril 2021, par Spiralio

    I am trying to do the simple task of playing a single MP3 file when a command is run. The file is stored locally, and I have FFmpeg installed on my computer. The code below is part of my command's file :

    


    const Discord = require("discord.js");
const fs = require('fs');
const { Client, RichEmbed } = require('discord.js');
const config = require("../config.json");

let playing = undefined;
let connection = undefined;

module.exports.run = async (client, message, args, config) => {


  if (playing) playing.end()
  if (connection == undefined) await message.member.voice.channel.join().then((c) => {
    connection = c;
  })
  playing = connection.play('./sounds/sound.mp3')

}


    


    (note that this code is heavily narrowed down to single out the issue)

    


    When I run the command the first 9 times, it works perfectly - the file is played, and cuts off if it is already playing. I also want to note that the file is 2 minutes long. However, once I play the file for exactly the 10th time, the bot stops playing audio entirely - as long as all 10 times are overlapping (meaning I don't let the audio finish).

    


    What's more confusing is that if an error is passed after the bot stops playing audio, it appears in an entirely different format than the standard Discord.js errors. For example, this code does not test to see if the user is in a voice channel, so if I purposefully crash the bot by initiating the command without being in a voice channel (after running the command 10 times), the error looks like this :

    


    abort(RangeError: offset is out of bounds). Build with -s ASSERTIONS=1 for more info.
(Use `electron --trace-uncaught ...` to show where the exception was thrown)


    


    (Preceded by a bunch of unformatted code) This however, is not consistent. It seems to only appear after letting the files run entirely.

    


    The issue only fixes itself when the entire bot restarts. Any help would be appreciated.

    


  • How to prevent audio generation loss in python ?

    23 janvier 2021, par John G.

    I have a script that needs to run audio through ffmpeg and pydub multiple times each. I realized that by the end of all this the audio sounds a bit muffled compared to the original. What steps can I take to make sure the quality is as high as possible at the end ? I'm going from mp3/m4b to wav btw.

    


  • Setting the DTS of a video and audio packets

    6 février 2021, par Pavel

    so I am struggling with concatenating 5s video segments into one .mp4 in python using the PyAV. The video segments are stored as BytesIO object(so I can store them in RAM). I loop through every packet in every segment, so naturally, their PTS and DTS are not unique and are repeating in every segment. Thus, I decided to set each packet's PTS/DTS to an ever incrementing value, so they are in the correct order.

    


        def mux_to_file(self, output_file_name, vid):
        vid.seek(0) #BytesIO object
        video = av.open(vid, "r"). #av InputContainer
        output = av.open(output_file_name, "w")  #av OutputContainer
        
        v_in = video.streams.video[0]  #information about the stream (bit rate, res...)
        video_p = video.demux(v_in)
        output_video = output.add_stream(template=v_in)


        self.last_pts = 0
        self.step = 0
        for packet in video_p:  #looping through every packet
            if packet.dts is None:
                continue

            packet.dts = self.last_pts   #setting new pts and dts
            packet.pts = self.last_pts
            self.last_pts += packet.duration  #old one+duration of the previous one

            packet.stream = output_video     #assigns information of the new packet
            output.mux(packet)               # muxing, her occurs the warning
        
        output.close()
        video.close()



    


    The warning is as follows :

    


    Found duplicated MOOV Atom. Skipped it
Found duplicated MOOV Atom. Skipped it
 (repeated 58 more times)
Found duplicated MOOV Atom. Skipped it
Found duplicated MOOV Atom. Skipped it
 (repeated 58 more times)
DTS 0 < 447000 out of order
DTS 0 < 447000 out of order
 (repeated 58 more times)


    


    I would like to set the PTS/DTS of the packets so the warning would not occur. Of course, turning off the logging of av lib is an option,
av.logging.set_level(av.logging.PANIC)
however, I am looking for an more elegant and better solution. How could I set the the DTS to a correct value, and why is my solution still throwing errors ?

    


    Thanks in advance.