Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (111)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Supporting all media types

    13 avril 2011, par

    Unlike 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 (...)

  • 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 (...)

Sur d’autres sites (5317)

  • avcodec/indeo3data : fix undefined left shift of negative number

    19 septembre 2015, par Ganesh Ajjanagadde
    avcodec/indeo3data : fix undefined left shift of negative number
    

    This fixes a whole sea of -Wshift-negative-value reported with clang 3.7+, e.g
    http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7.
    Any half decent compiler should anyway optimize away the multiplication.

    Signed-off-by : Ganesh Ajjanagadde <gajjanagadde@gmail.com>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libavcodec/indeo3data.h
  • How to create a queue system with a discord.py bot

    20 août 2024, par Zamv

    I'm trying to create a bot with discord.py.

    &#xA;

    Also, I'm a beginner, so I'll be interested in what I can improve and any errors there are.

    &#xA;

    I've been stuck on trying to create this queue system for songs, the bot was working perfectly fine and played some urls before I implemented the play_next function. Now it doesn't even play the first song, even if it sends confirmation messages both in the terminal that in the discord channel. I know that the code might be a little confusing.

    &#xA;

    I wrote two main functions : "play_next" to play the next song in the queue and "play", the main command. Here is my play_next function :

    &#xA;

    async def play_next(self,ctx):&#xA;        if not ctx.voice_client.is_playing: #(don&#x27;t know if this is correct as I also check if the bot isn&#x27;t                     playing anything in the play function)&#xA;            &#xA;            if self.song.queue: &#xA;                next_song = self.song_queue.pop(0) #deleting the first element of the queue, so if we have (song_0, song_1 and song_2) the bot should delete (song_0) making in fact song_1 the "next" song_0&#xA;                try:&#xA;                    ctx.voice_client.play(discord.FFmpegPCMAudio(next_song), &#xA;                                          after=lambda e: self.bot.loop.create_task(self.play_next(ctx))) #Not gonna lie here, i asked chat gpt for this line, it should make the bot automatically play the next song one after another, correct me if I am wrong&#xA;&#xA;#this is not important&#xA;                    embed = discord.Embed(&#xA;                        title="Song",&#xA;                        description=f"Now playing {next_song}",&#xA;                        color = 0x1DB954&#xA;                    )&#xA;                    await ctx.send(embed=embed)&#xA;                except Exception as e:&#xA;                    print(f"Error playing the next song: {e}")&#xA;&#xA;            else:&#xA;                await ctx.voice_client.disconnect()  # disconnecting from the voice channel if the queue is empty&#xA;                print("Disconnected from the voice channel as the queue is empty.")&#xA;

    &#xA;

    I think that the main problem of my bot is the play_next function, but here it is my "play" function :

    &#xA;

        @commands.command(pass_context=True)&#xA;    async def play(self, ctx, url: str):  &#xA;        if ctx.author.voice:  # first checking if the user is in a voice channel&#xA;            if not ctx.voice_client: #then checking if the bot is already connected to a voice channel&#xA;                channel = ctx.message.author.voice.channel &#xA;                try:&#xA;                    await channel.connect()  #then joining&#xA;                    print("I joined the voice channel!")&#xA;                except Exception as e:&#xA;                    print(f"Failed to connect to the voice channel: {e}")&#xA;                    return&#xA;&#xA;            song_path = f"song_{self.song_index}.mp3" #note, im using cogs, i declared self.song_index with the value of 0 &#xA;            self.song_index &#x2B;= 1 #i thought that this was the easiest way of creating a new file for each song&#xA;&#xA;            ydl_opts = {&#xA;                &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;                &#x27;postprocesors&#x27;: [{&#xA;                    &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;                    &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;                    &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;                }],&#xA;                &#x27;outtmpl&#x27;: song_path&#xA;            }&#xA;            try:&#xA;                with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;                    print("Starting download...")&#xA;                    ydl.download([url]) #this is where it should download the song provided by the url&#xA;                    print("Download finished.")&#xA;            except Exception as e:&#xA;                await ctx.send(f"Failed to download the song: {e}")&#xA;                return&#xA;&#xA;#i think that the next two if statements are the main threats&#xA;            if os.path.exists(song_path): #if there is atleast 1 song in the queue&#xA;                self.song_queue.append(song_path) #append the next one&#xA;                embed = discord.Embed(&#xA;                    title="Added to Queue!",&#xA;                    description = f"{url} has been added to the queue.",&#xA;                    color=0x33ff33&#xA;                )&#xA;                await ctx.send(embed=embed)&#xA;&#xA;&#xA;                if not ctx.voice_client.is_playing(): #checking if the bot is already playing something, don&#x27;t know if i should put this if statement here&#xA;                    print("Starting playback...")&#xA;                    await self.play_next(ctx) #if nothing is playing, then the bot should play the next song&#xA;&#xA;&#xA;&#xA;            else:&#xA;                await ctx.send("Failed to download or find the audio file.")&#xA;&#xA;        else:&#xA;            embed = discord.Embed(&#xA;                title="❌You must be in a voice channel",&#xA;                color=0xff6666&#xA;            )&#xA;            await ctx.send(embed=embed)&#xA;

    &#xA;

  • Flutter : Failed assertion : 'file.absolute.existsSync()' : is not true

    11 août 2022, par whatwhatwhat

    In my app, a user can send a file to others in a group chat. First, the user records some audio using their mic. The file is then touched up using FFMPEG. Then, the file is uploaded to Firebase Cloud Storage and if this is successful, a record is written in Firebase Realtime Database.

    &#xA;

    I'm getting the error below when the user records a long audio file and then presses submit. It almost seems as though FFMPEG hasn't finished processing the file...but I thought I used my async/await correctly to make sure that this processing is finished before moving on ?

    &#xA;

    &#xA;

    ##MyAppFile## saveMyAppFileToCloudStorage Error : 'package:firebase_storage/src/reference.dart' : Failed assertion : line 127 pos 12 : 'file.absolute.existsSync()' : is not true.

    &#xA;

    &#xA;

    Psuedo-code :

    &#xA;

      &#xA;
    1. User records audio
    2. &#xA;

    3. Audio file is processed using FFMPEG and the new processed file is created on the user's phone
    4. &#xA;

    5. User hits submit, uploading the file to Cloud Storage and, if successful, writing a record to Realtime Database
    6. &#xA;

    &#xA;

    Order of Functions After User Hits Submit :

    &#xA;

      &#xA;
    1. msgInput.dart -> sendMyAppFile()
    2. &#xA;

    3. msgInput.dart -> prepareMyAppFileForSending()
    4. &#xA;

    5. msgInput.dart -> runFFMPEGHighLow()
    6. &#xA;

    7. message_dao.dart -> sendMyAppFile()
    8. &#xA;

    9. message_dao.dart -> saveMyAppFileToCloudStorage() //ERROR COMES FROM THIS FUNCTION
    10. &#xA;

    &#xA;

    The Code :

    &#xA;

    //msgInput.dart&#xA;Future<void> sendMyAppFile() async {&#xA;    if (sendableMyAppFileExists == 1) {&#xA;      final MyAppFileReadyToBeSent = await prepareMyAppFileForSending();&#xA;&#xA;      if (MyAppFileReadyToBeSent == &#x27;1&#x27;) {&#xA;        messageDao.sendMyAppFile(MyAppFile, filepath, filename); &#xA;      } else {&#xA;      &#xA;      }&#xA;    }&#xA;&#xA;    setState(() {&#xA;      sendableMyAppFileExists = 0;&#xA;    });&#xA;  }&#xA;  &#xA;  Future<string> prepareMyAppFileForSending() async {&#xA;    if (sendableMyAppFileExists == 1) {&#xA;      if (recordedMyAppFileFilterID == &#x27;1&#x27;) {&#xA;&#xA;        await runFFMPEGHighLow(&#x27;1&#x27;); &#xA;&#xA;        return &#x27;1&#x27;;&#xA;      }&#xA;&#xA;      if (recordedMyAppFileFilterID == &#x27;2&#x27;) {&#xA;&#xA;        await runFFMPEGHighLow(&#x27;2&#x27;); &#xA;&#xA;        return &#x27;1&#x27;;&#xA;      }&#xA;    }&#xA;&#xA;    return &#x27;0&#x27;;&#xA;  }&#xA;  &#xA;  Future<void> runFFMPEGHighLow(String filterID) async { &#xA;    if (filterID != &#x27;1&#x27; &amp;&amp; filterID != &#x27;2&#x27;) {&#xA;      return;&#xA;    }&#xA;&#xA;    if (sendableMyAppFileExists == 1) {&#xA;      if (filterID == &#x27;1&#x27;) {&#xA;&#xA;        await FFmpegKit.executeAsync(/*...parms...*/);&#xA;        setState(() {&#xA;          currentMyAppFileFilename = currentMyAppFileFilename &#x2B; &#x27;1.mp3&#x27;; &#xA;        });&#xA;&#xA;      }&#xA;&#xA;      if (filterID == &#x27;2&#x27;) {&#xA;&#xA;        await FFmpegKit.executeAsync(/*...parms...*/);&#xA;        setState(() {&#xA;          currentMyAppFileFilename = currentMyAppFileFilename &#x2B; &#x27;2.mp3&#x27;;&#xA;        });&#xA;&#xA;      }&#xA;    }&#xA;  }&#xA;  &#xA;//message_dao.dart&#xA;void sendMyAppFile(ChatData MyAppFile, String filepath, String filename) {&#xA;    saveMyAppFileToCloudStorage(filepath, filename).then((value) {&#xA;      if (value == true) {&#xA;        saveMyAppFileToRTDB(MyAppFile);&#xA;      }&#xA;    });&#xA;  }&#xA;  &#xA;Future<bool> saveMyAppFileToCloudStorage(String filepath, String filename) async {&#xA;    //filepath: /data/user/0/com.example.MyApp/app_flutter/MyApp/MyAppAudioFiles/MyAppFiles/2d7af6ae-6361-4be5-8209-8498dd17d77d1.mp3&#xA;    //filename: 2d7af6ae-6361-4be5-8209-8498dd17d77d1.mp3&#xA;&#xA;    _firebaseStoragePath = MyAppFileStorageDir &#x2B; filename;&#xA;    &#xA;    File file = File(filepath);&#xA;&#xA;    try {&#xA;      await _firebaseStorage&#xA;          .ref(_firebaseStoragePath)&#xA;          .putFile(file);&#xA;      return true;&#xA;    } catch (e) {&#xA;      print(&#x27;##MyAppFile## saveMyAppFileToCloudStorage Error: &#x27; &#x2B; e.toString()); //ERROR COMES FROM THIS LINE&#xA;      return false;&#xA;    }&#xA;    return true;&#xA;  }&#xA;</bool></void></string></void>

    &#xA;