Recherche avancée

Médias (91)

Autres articles (17)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

Sur d’autres sites (2541)

  • Discord music bot won't join Voice channel

    16 mars 2024, par Skely

    I followed a tutorial for creating a music bot in discord, but it will not join my vc no matter what. Every command works and it gives the correct responses and songs is in the queue. The bot have every permission know to man, but it still won't join. Any way to fix this issue ?
Thanks in advance !!

    


    This is my code and files

    


    main.py

    


    import discord
from discord.ext import commands
import os
import asyncio

from help_cog import help_cog
from music_cog import music_cog

bot = commands.Bot(
    command_prefix="?", 
    intents=discord.Intents.all(),
    help_command=None
)

async def main():
    async with bot:
        await bot.add_cog(help_cog(bot))
        await bot.add_cog(music_cog(bot))
        await bot.start(os.getenv("TOKEN"))

asyncio.run(main())


    


    music_cog.py

    


    import discord
from discord.ext import commands

from yt_dlp import YoutubeDL

import yt_dlp as youtube_dl

class music_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

        self.is_playing = False
        self.is_paused = False

        self.music_queue = []
        self.YDL_OPTIONS = {"format": "bestaudio", "postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "mp3", "preferredquality": "192",}]}
        self.FFMPEG_OPTIONS = {"before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5", "options": "-vn"}

        self.vc = None
        print("Success")

    def search_yt(self, item):
        with YoutubeDL(self.YDL_OPTIONS) as ydl:
            try:
                info = ydl.extract_info(f"ytsearch:{item}", download=False)["entries"][0]
            except Exception:
                return False
        return {"source": info["url"], "title": info["title"]}

    def play_next(self):
        if len(self.music_queue) > 0:
            self.is_playing = True

            m_url = self.music_queue[0][0]["source"]

            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
        else:
            self.is_playing = False

    async def play_music(self, ctx):
        if len(self.music_queue) > 0:
            self.is_playing = True
            m_url = self.music_queue[0][0]["source"]

            if self.vc == None or not self.vc.is_connected():
                self.vc = await self.music_queue[0][1].connect()

                if self.vc == None:
                    await ctx.send("Could not connect to the voice channel")
                    return
            else:
                await self.vc.move_to(self.music_queue[0][1])
            
            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())

        else:
            self.is_playing = False

    @commands.command(name="play", aliases=["p", "playing"], help="Play the selected song from YouTube")
    async def play(self, ctx, *args):
        query = " ".join(args)

        voice_channel = ctx.author.voice.channel
        if voice_channel is None:
            await ctx.send("Connect to a voice channel!")
        elif self.is_paused:
            self.vc.resume()
        else:
            song = self.search_yt(query)
            if type(song) == type(True):
                await ctx.send("Could not download the song. Incorrect format, try a different keyword")
            else:
                await ctx.send("Song added to queue")
                self.music_queue.append([song, voice_channel])

                if self.is_playing == False:
                    await self.play_music(ctx)
    
    @commands.command(name="pause", help="Pauses the current song being played")
    async def pause(self, ctx, *args):
        if self.is_playing:
            self.is_playing = False
            self.is_paused = True
            self.vc.pause()
        elif self.is_paused:
            self.is_playing = True
            self.is_paused = False
            self.vc.resume()

    @commands.command(name="resume", aliases=["r"], help="Resumes playing the current song")
    async def resume(self, ctx, *args):
        if self.is_paused:
            self.is_playing = True
            self.is_paused = False
            self.vc.resume()
        
    @commands.command(name="skip", aliases=["s"], help="Skips the currently played song")
    async def skip(self, ctx, *args):
        if self.vc != None and self.vc:
            self.vc.stop()
            await self.play_music(ctx)

    @commands.command(name="queue", aliases=["q"], help="Displays all the songs currently in queue")
    async def queue(self, ctx):
        retval = ""

        for i in range(0, len(self.music_queue)):
            if i > 4: break
            retval += self.music_queue[i][0]["title"] + "\n"

        if retval != "":
            await ctx.send(retval)
        else:
            await ctx.send("No music in the current queue")
    
    @commands.command(name="clear", aliases=["c", "bin"], help="Stops the current song and clears the queue")
    async def clear(self, ctx, *args):
        if self.vc != None and self.is_playing:
            self.vc.stop()
        self.music_queue = []
        await ctx.send("Music queue cleared")

    @commands.command(name="leave", aliases=["disconnect", "l", "d"], help="Kick the bot from the voice channel")
    async def leave(self, ctx):
        self.is_playing = False
        self.is_paused = False
        await self.vc.disconnect()


    


    help_cog.py

    


    import discord
from discord.ext import commands

class help_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

        self.help_message = """
        Help message
"""

        self.text_channel_text = []
    
    @commands.Cog.listener()
    async def on_ready(self):
        for guild in self.bot.guilds:
            for channel in guild.text_channels:
                self.text_channel_text.append(channel)

        await self.send_to_all(self.help_message)

    async def send_to_all(self, msg):
        for text_channel in self.text_channel_text:
            await text_channel.send(msg)
        
    @commands.command(name="help", help="Displays all the available commands")
    async def help(self, ctx):
        await ctx.send(self.help_message)


    


  • Edited video produces smaller image that original, even with higher resolution

    10 juillet 2020, par ceperman

    I've a .ts format recording from my Humax, which completely fills the window horizontally when played with VLC. In full-screen it fills the screen horizontally in letterbox style, and the same on the TV when played through my PS/3. All good so far.

    


    This is the ffprobe output :

    


    Duration: 02:16:37.72, start: 74238.902878, bitrate: 2554 kb/s
Stream #0:0[0x931]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 704x576 [SAR 16:11 DAR 16:9], max. 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc


    


    I used ffmpeg to change the audio track :

    


    ffmpeg -i movie.ts -c:v libx264 -c:a ac3 -crf 20 -map 0:v:0 -map 0:a:1 movie.mp4


    


    and produced an .mp4 which also plays correctly.

    


    ffprobe :

    


    Duration: 02:16:37.68, start: 0.005333, bitrate: 1129 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 704x576 [SAR 16:11 DAR 16:9], 932 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)


    


    However, if I edit it using OpenShot, I cannot find any export format that produces an image that fills the window horizontally in the same way, regardless of what resolution or aspect ratio I use.

    


    Example : export format "DV/DVD Widescreen PAL (720x576)" produces this (sample) file :

    


    Duration: 00:00:39.12, start: 0.040000, bitrate: 563 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576, 477 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)


    


    OpenShot appears not to set the AR, so it initially shows in VLC in 5:4 aspect, but even changing the VLC AR to the maximum of 2.39:1 does not stretch it fully from side-to-side.

    


    I've used ffmpeg to experiment with changing the aspect ratio, changing the resolution, and setting the SAR and DAR, all without success.

    


    This can't be a resolution issue, as I've exported 720p and 1080i, plenty of pixels but all produce roughly the same result - a small image that doesn't fill the window, and ditto on the TV. The original recording is only 704x576 but fills the window. Also the aspect ratio of the original recording is 16:9 (VLC agrees) but the actual measured AR of the screen image is closer to 2.04:1.

    


    I'm hoping that while this could be an OpenShot issue, the cause of the problem should be visible to ffprobe and perhaps fixable with ffmpeg. Help wil be appreciated.

    


  • Android MediaClipsRecorder : Error starting recorder -19

    25 octobre 2017, par Burak iren

    I’m using FFmpeg at my project. It was working 4 days ago. I have changed java sdk from 1.8 to 1.7 . Later I have tried, camera shutting on some devices. I dont know what is the problem. I checkout the project to working branch but still error continue.

    My code is

    public void start() {
       if (mMediaRecorder == null) {
           return;
       }
       Log.v(LOG_TAG, "Preparing recorder");
       if (mCurrentFile == null) {
           newTempFile();
       }
       try {
           mMediaRecorderConfigurer.configureMediaRecorder(mMediaRecorder);
           mMediaRecorder.setOutputFile(mCurrentFile.getAbsolutePath());
           mMediaRecorder.setOnInfoListener(this);
           mMediaRecorder.setOnErrorListener(this);
           mMediaRecorder.prepare();
       } catch (IOException e) {
           if (mMediaRecorder != null) {
               release();
           }
           Log.e(LOG_TAG, "Error preparing recorder", e);
           if (mListener != null) {
               mListener.onMediaRecorderError(e);
           }
           return;
       }

       try {
           mMediaRecorder.start();
           // There's a slight delay before it starts recording.
           mStartTimeMillis = SystemClock.uptimeMillis() + START_DELAY_MILLIS;
       } catch (Exception e) {
           if (mMediaRecorder != null) {
               release();
           }
           Log.e(LOG_TAG, "Error starting recorder", e);
           if (mListener != null) {
               mListener.onMediaRecorderError(e);
           }
       }
    }

    My error is

    10-25 15:18:21.000 5960-5960/com.leadtimeapp.io.internal.debug
    V/FFmpegRecorderActivity: Remaining millis 60000
    10-25 15:18:21.117 5960-5960/com.leadtimeapp.io.internal.debug
    E/MediaRecorder: start failed: -19
    10-25 15:18:21.121 5960-5960/com.leadtimeapp.io.internal.debug
    E/MediaClipsRecorder: Error starting recorder
                                                                                    java.lang.RuntimeException: start failed.
                                                                                        at android.media.MediaRecorder.start(Native Method)
                                                                                        at com.amosyuen.videorecorder.recorder.MediaClipsRecorder.start(MediaClipsRecorder.java:144)
                                                                                        at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.startRecording(FFmpegRecorderActivity.java:494)
                                                                                        at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.onTouch(FFmpegRecorderActivity.java:593)
                                                                                        at android.view.View.dispatchTouchEvent(View.java:9371)
                                                                                        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
                                                                                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)

    10-25 15:18:21.123 5960-5960/com.leadtimeapp.io.internal.debug
    I/FFmpegRecorderActivity: Discard recording