Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (30)

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (3432)

  • Does anyone know how to speed up this FFMPEG command set ?

    5 juin 2022, par user19275422

    does anyone know how to speed up this FFMPEG set ? I want it to be started by a sensor but it takes to long to render. Thank you for any help.

    


    ffmpeg -i voice.wav -f lavfi -t 1 -i anullsrc=channel_layout=stereo:sample_rate=44100 -i music.mp3 -filter_complex "[0:0][1:0][2:0]concat=n=3:v=0:a=1[out]" -map "[out]" audio.wav

    


    ffmpeg -i video.mov -itsoffset 3.84 -i audio.wav -c:v copy audio.mp4

    


    ffmpeg -i audio.mp4' + ' -filter_complex "scale=3840:2160,drawtext=text="' + string + '":fontcolor=white:fontsize=94:fontfile=Jost.ttf' + ':x=(w-text_w)/1.1:y=(h-text_h)/2" -pix_fmt yuv420p display.mp4

    


    I think the last one takes the longest.

    


  • Pycord Music Bot : AttributeError : 'FFmpegAudio' object has no attribute '_process'

    5 juin 2022, par Steven Mao

    I've made a discord Cog that should be able to queue up and play music, but I'm getting an error from FFmpeg when I actually try to play the URL. I have found an identical question on StackOverflow, but this user's problem was a random typo. The inputs should all be correct, so I am not sure if the problem is my code or my package.

    


    What have I done wrong ?

    


    class MusicClass(commands.Cog):
    #universal attributes
    YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
    FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}

    def __init__(self, bot):
        self.bot = bot
        self.is_playing = False
        self.music_queue = [[],''] #[[music1, music2, music3...], channel_obj]
        self.vc = ''

    @commands.command()
    async def join(self, ctx):
        if not ctx.message.author.voice:
            await ctx.send("{} is not connected to a voice channel".format(ctx.message.author.name))
            return
        else:
            channel = ctx.message.author.voice.channel
        await channel.connect()

    @commands.command()
    async def leave(self, ctx):
        voice_client = ctx.message.guild.voice_client
        if voice_client.is_connected():
            await voice_client.disconnect()
        else:
            await ctx.send("The bot is not connected to a voice channel.")
    
    #rtype: list[dict{str:}]
    #params: search string/web URL, top number of results to show
    #returns list of top 5 queries and their information
    def search_yt(self, search_query, num_results = 3):
        with YoutubeDL(self.YDL_OPTIONS) as ydl:
            try:
                top_results = ydl.extract_info(f"ytsearch{num_results}:{search_query}", download=False)['entries'][0:{num_results}]
                for i in range(len(top_results)):
                    top_results[i] = {
                        'title': top_results[i]['title'],
                        'source': top_results[i]['formats'][0]['url'],
                        'channel': top_results[i]['channel'],
                        'duration': top_results[i]['duration'],
                        'url': top_results[i]['webpage_url']
                    }
            except:
                print(f'SEARCH_YT ERROR\t search="{search_query}"')
                return False
            return top_results
    
    #rtype: None
    #looks at queue, decides whether to play the next song in queue or stop
    def play_next(self):
        print('called play_next')
        if len(self.music_queue) > 0:
            self.is_playing = True
            #assigns url AND removes from queue
            music_url = self.music_queue[0][0]['source']
            self.music_queue[0].pop(0)
            self.vc.play(discord.FFmpegAudio(music_url, **self.FFMPEG_OPTIONS), after = lambda e: self.play_next())
        else:
            self.is_playing = False

    #rtype: None
    #similar to play_next but optimized for first-time playing
    #checks if a song in queue + checks if bot's connected, then begins to play
    async def play_now(self):
        print('called play_now, queue:', self.music_queue[0])
        if len(self.music_queue) > 0:
            self.is_playing = True
            music_url = self.music_queue[0][0]['source']
            if self.vc == '' or not self.vc.is_connected():
                self.vc = await self.music_queue[1].connect()
            else:
                print('moving to new channel')
                self.vc = await self.bot.move_to(self.music_queue[1])
            self.music_queue[0].pop(0)

            #######################################################################################################
            print('ERROR HAPPENS RIGHT HERE')
            self.vc.play(discord.FFmpegAudio(music_url, **self.FFMPEG_OPTIONS), after = lambda e: self.play_next())
            #######################################################################################################
            
        else:
            self.is_playing = False

    @commands.command()
    #dynamically checks for URL link or search query, then attempts to play
    async def p(self, ctx, *args):
        voice_channel = ctx.author.voice.channel

        if voice_channel == None: #not in a VC
            await ctx.send('You have to be in a voice channel first')
            return
        else: #set channel, search and play music
            if self.music_queue[1] != voice_channel:
                self.music_queue[1] = voice_channel
            if args[0].startswith('https://www.youtube.com/watch'): #search URL
                #search web_url directly and send object to music queue
                with YoutubeDL(self.YDL_OPTIONS) as ydl:
                    try:
                        print('attempting to extract URL:', args[0])
                        music_obj = ydl.extract_info(args[0], download=False)
                        music_obj = {
                        'title': music_obj['title'],
                        'source': music_obj['formats'][0]['url'],
                        'channel': music_obj['channel'],
                        'duration': music_obj['duration'],
                        'url': music_obj['webpage_url']
                        }
                        print('music object:', music_obj)
                        print('appending URL song queue')
                        self.music_queue[0].append(music_obj)
                    except:
                        print('URL search failed. URL =', args[0])
            else: #search query, display search results, ask for which one, then add to queue
                num_results = args[len(args)-1] if args[len(args)-1].isdigit() else 3
                song_list = self.search_yt(' '.join(args), num_results)
            
            if not self.is_playing:
                await self.play_now()


    


    Now my error message...

    


    Exception ignored in: <function at="at" 0x7ff4b0a5b5e0="0x7ff4b0a5b5e0">&#xA;Traceback (most recent call last):&#xA;  File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 127, in __del__&#xA;    self.cleanup()&#xA;  File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 247, in cleanup&#xA;    self._kill_process()&#xA;  File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 198, in _kill_process&#xA;    proc = self._process&#xA;AttributeError: &#x27;FFmpegAudio&#x27; object has no attribute &#x27;_process&#x27;&#xA;</function>

    &#xA;

  • Why i get error when i try to run command play in python script of discord bot

    30 mai 2022, par UNDERTAKER 86

    My code of music discord bot :

    &#xA;

    import ffmpeg&#xA;import asyncio&#xA;import discord&#xA;from discord.ext import commands&#xA;import os&#xA;import requests&#xA;import random&#xA;import json&#xA;from replit import db&#xA;import youtube_dl&#xA;from keep_alive import keep_alive&#xA;&#xA;class music(commands.Cog):&#xA;    def __init__(self, client):&#xA;        self.client = client&#xA;&#xA;    @commands.command()&#xA;    async def join(self, ctx):&#xA;        if ctx.author.voice is None:&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Ты не подключён к голосовому чату!&#x27;)&#xA;        voice_channel = ctx.author.voice.channel&#xA;        if ctx.voice_client is None:&#xA;            await voice_channel.connect()&#xA;        else:&#xA;            await ctx.voice_client.move_to(voice_channel)&#xA;  &#xA;    @commands.command()&#xA;    async def leave(self, ctx):&#xA;        if ctx.author.voice is None:&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Ты не подключён к голосовому чату!&#x27;)&#xA;        else:&#xA;            await ctx.voice_client.disconnect()&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Пока!&#x27;)&#xA;&#xA;    @commands.command()&#xA;    async def play(self, ctx, *, url):&#xA;        if ctx.author.voice is None:&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Ты не подключён к голосовому чату!&#x27;)&#xA;        ctx.voice_client.stop()&#xA;        ffmpeg_options = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;, &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;        YDL_OPTIONS = {&#x27;format&#x27;: &#x27;bestaudio/best&#x27;, &#x27;noplaylist&#x27;: &#x27;True&#x27;, &#x27;simulate&#x27;: &#x27;True&#x27;,&#xA;                       &#x27;preferredquality&#x27;: &#x27;32bits&#x27;, &#x27;preferredcodec&#x27;: &#x27;wav&#x27;, &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;}&#xA;        vc = ctx.voice_client&#xA;&#xA;        with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:&#xA;            if &#x27;https://&#x27; in url:&#xA;                info = ydl.extract_info(url, download=False)&#xA;            else:&#xA;                info = ydl.extract_info(f&#x27;ytsearch:{url}&#x27;, download=False)[&#x27;entries&#x27;][0]&#xA;            url2 = info[&#x27;formats&#x27;][0][&#x27;url&#x27;]&#xA;            source = await discord.FFmpegOpusAudio.from_probe(url2, **ffmpeg_options)&#xA;            vc.play(source)&#xA;&#xA;    @commands.command()&#xA;    async def pause(self, ctx):&#xA;        if ctx.author.voice is None:&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Ты не подключён к голосовому чату!&#x27;)&#xA;            await ctx.voice_client.pause()&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Пауза&#x27;)&#xA;&#xA;    @commands.command()&#xA;    async def resume(self, ctx):&#xA;        if ctx.author.voice is None:&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Ты не подключён к голосовому чату!&#x27;)&#xA;            await ctx.voice_client.resume()&#xA;            await ctx.send(f&#x27;{ctx.message.author.mention}, Играет&#x27;)&#xA;&#xA;#    @commands.command()&#xA; #   async def stop(self, ctx):&#xA;  #      await ctx.voice_client.stop()&#xA;   #     ctx.send(f&#x27;{author.mention}, Остановлен&#x27;)&#xA;&#xA;#   @commands.command()&#xA; #  async def repeat(self, ctx):&#xA;  #    await ctx.voice_client.repeat()&#xA;   #   ctx.send(f&#x27;{author.mention}, Повтор&#x27;)&#xA;&#xA;#   @commands.command()&#xA; #  async def loop(self, ctx):&#xA;  #    await ctx.voice_client.loop()&#xA;   #   ctx.send(f&#x27;{author.mention}, Повтор&#x27;)&#xA;&#xA;keep_alive()&#xA;def setup(client):&#xA;    client.add_cog(music(client))&#xA;

    &#xA;

    But i get error when i write in discord command play :

    &#xA;

    [youtube] rUd2diUWDyI: Downloading webpage&#xA;[youtube] Downloading just video rUd2diUWDyI because of --no-playlist&#xA;[youtube] rUd2diUWDyI: Downloading webpage&#xA;[youtube] Downloading just video rUd2diUWDyI because of --no-playlist&#xA;Ignoring exception in command play:&#xA;Traceback (most recent call last):&#xA;  File "/home/runner/MBOT/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped&#xA;    ret = await coro(*args, **kwargs)&#xA;  File "/home/runner/MBOT/music.py", line 51, in play&#xA;    source = await discord.FFmpegOpusAudio.from_probe(url2, **ffmpeg_options)&#xA;  File "/home/runner/MBOT/venv/lib/python3.8/site-packages/discord/player.py", line 387, in from_probe&#xA;    return cls(source, bitrate=bitrate, codec=codec, **kwargs)&#xA;  File "/home/runner/MBOT/venv/lib/python3.8/site-packages/discord/player.py", line 324, in __init__&#xA;    super().__init__(source, executable=executable, args=args, **subprocess_kwargs)&#xA;  File "/home/runner/MBOT/venv/lib/python3.8/site-packages/discord/player.py", line 138, in __init__&#xA;    self._process = self._spawn_process(args, **kwargs)&#xA;  File "/home/runner/MBOT/venv/lib/python3.8/site-packages/discord/player.py", line 147, in _spawn_process&#xA;    raise ClientException(executable &#x2B; &#x27; was not found.&#x27;) from None&#xA;discord.errors.ClientException: ffmpeg was not found.&#xA;

    &#xA;

    I try install ffmpeg in console python, but this dont helped me. Please, give me answer on my question. I use service replit.com to coding on python. Because i want to install this script on server. How i can solve this problem ?

    &#xA;