Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (62)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (11839)

  • ffmpeg : overlay video on top of a cropped video, map the overlay audio, cut the base video to the overlays length

    14 mars 2023, par roku

    I'm trying to overlay a video on top of a base video which is cropped to a shorts video format (standing phone). The overlayed video should be centered on top of the base layer. The base video's length should be reduced to the overlay's length. And I want to save only the overlay's audio.

    


    I've tried a bunch of stuff without much success. The current state of my ffmpeg command is this :

    


    ffmpeg -i overlay.mp4 -ss 00:00:00 -to <insert base="base"> -i base.mp4 -map 1:v:0 -map 1:a -vf "crop=ih*(9/16):ih" -crf 21 output.mp4&#xA;</insert>

    &#xA;

    But this only gives me the cropped version of the base video. So my questions are :

    &#xA;

      &#xA;
    1. How can I figure out the base video's length ?
    2. &#xA;

    3. How can I actually overlay (not map) other video on top of the base video ?
    4. &#xA;

    5. How can I map the overlay's audio ? Since -map 1:a the base's audio and -map 0:a says : "Stream map '0:a' matches no streams. To ignore this, add a trailing ' ?' to the map."
    6. &#xA;

    &#xA;

    Any help is appreciated.

    &#xA;

  • Discord.py - IndexError : list index out of range

    23 novembre 2020, par itsnexn

    Hello i start to learn python and i make bot for practie but i got this error

    &#xA;

    Ignoring exception in command play:&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\sinad\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped&#xA;    ret = await coro(*args, **kwargs)&#xA;  File "d:\Projects\discord\musicbot.py", line 147, in play&#xA;    player = await YTDLSource.from_url(queue[0], loop=client.loop)&#xA;IndexError: list index out of range&#xA;

    &#xA;

    and i use ffmpeg to convert audio&#xA;and i write this bot in youtube and discord.py documentation&#xA;itswork well without music commend but if i use that i got error and isnt working idk why ...&#xA;this is my first python project so this is happening and its normal&#xA;and this is my code :

    &#xA;

    import discord&#xA;from discord.ext import commands, tasks&#xA;from discord.voice_client import VoiceClient&#xA;&#xA;import youtube_dl&#xA;&#xA;from random import choice&#xA;&#xA;from youtube_dl.utils import lowercase_escape&#xA;&#xA;youtube_dl.utils.bug_reports_message = lambda: &#x27;&#x27;&#xA;&#xA;ytdl_format_options = {&#xA;    &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;    &#x27;outtmpl&#x27;: &#x27;%(extractor)s-%(id)s-%(title)s.%(ext)s&#x27;,&#xA;    &#x27;restrictfilenames&#x27;: True,&#xA;    &#x27;noplaylist&#x27;: True,&#xA;    &#x27;nocheckcertificate&#x27;: True,&#xA;    &#x27;ignoreerrors&#x27;: False,&#xA;    &#x27;logtostderr&#x27;: False,&#xA;    &#x27;quiet&#x27;: True,&#xA;    &#x27;no_warnings&#x27;: True,&#xA;    &#x27;default_search&#x27;: &#x27;auto&#x27;,&#xA;    &#x27;source_address&#x27;: &#x27;0.0.0.0&#x27; # bind to ipv4 since ipv6 addresses cause issues sometimes&#xA;}&#xA;&#xA;ffmpeg_options = {&#xA;    &#x27;options&#x27;: &#x27;-vn&#x27;&#xA;}&#xA;&#xA;ytdl = youtube_dl.YoutubeDL(ytdl_format_options)&#xA;&#xA;class YTDLSource(discord.PCMVolumeTransformer):&#xA;    def __init__(self, source, *, data, volume=0.5):&#xA;        super().__init__(source, volume)&#xA;&#xA;        self.data = data&#xA;&#xA;        self.title = data.get(&#x27;title&#x27;)&#xA;        self.url = data.get(&#x27;url&#x27;)&#xA;&#xA;    @classmethod&#xA;    async def from_url(cls, url, *, loop=None, stream=False):&#xA;        loop = loop or asyncio.get_event_loop()&#xA;        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))&#xA;&#xA;        if &#x27;entries&#x27; in data:&#xA;            # take first item from a playlist&#xA;            data = data[&#x27;entries&#x27;][0]&#xA;&#xA;        filename = data[&#x27;url&#x27;] if stream else ytdl.prepare_filename(data)&#xA;        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)&#xA;&#xA;&#xA;client = commands.Bot(command_prefix=&#x27;.&#x27;)&#xA;&#xA;status = [&#x27;&#x27;]&#xA;queue = []&#xA;&#xA;#print on terminal when is bot ready&#xA;@client.event&#xA;async def on_ready():&#xA;    change_status.start()&#xA;    print(&#x27;Bot is online!&#x27;)&#xA;&#xA;#Welcome message&#xA;@client.event&#xA;async def on_member_join(member):&#xA;    channel = discord.utils.get(member.guild.channels, name=&#x27;general&#x27;)&#xA;    await channel.send(f&#x27;Welcome {member.mention}!  Ready to jam out? See `.help` command for details!&#x27;)&#xA;&#xA;#ping&#xA;@client.command(name=&#x27;ping&#x27;, help=&#x27;This command returns the latency&#x27;)&#xA;async def ping(ctx):&#xA;    await ctx.send(f&#x27;**Ping!** Latency: {round(client.latency * 1000)}ms&#x27;)&#xA;&#xA;@client.event&#xA;async def on_message(message):&#xA;&#xA;    if message.content in [&#x27;hello&#x27;, &#x27;Hello&#x27;]:&#xA;        await message.channel.send("**wasaaaaaap**")&#xA;&#xA;    await client.process_commands(message)&#xA;&#xA;&#xA;#join&#xA;@client.command(name=&#x27;join&#x27;, help=&#x27;This command makes the bot join the voice channel&#x27;)&#xA;async def join(ctx):&#xA;    if not ctx.message.author.voice:&#xA;        await ctx.send("You are not connected to a voice channel")&#xA;        return&#xA;&#xA;    else:&#xA;        channel = ctx.message.author.voice.channel&#xA;&#xA;    await channel.connect()&#xA;&#xA;#queue&#xA;@client.command(name=&#x27;queue&#x27;, help=&#x27;This command adds a song to the queue&#x27;)&#xA;async def queue_(ctx, url):&#xA;    global queue&#xA;&#xA;    queue.append(url)&#xA;    await ctx.send(f&#x27;`{url}` added to queue!&#x27;)&#xA;&#xA;#remove&#xA;@client.command(name=&#x27;remove&#x27;, help=&#x27;This command removes an item from the list&#x27;)&#xA;async def remove(ctx, number):&#xA;    global queue&#xA;&#xA;    try:&#xA;        del(queue[int(number)])&#xA;        await ctx.send(f&#x27;Your queue is now `{queue}!`&#x27;)&#xA;&#xA;    except:&#xA;        await ctx.send(&#x27;Your queue is either **empty** or the index is **out of range**&#x27;)&#xA;&#xA;#play&#xA;@client.command(name=&#x27;play&#x27;, help=&#x27;This command plays songs&#x27;)&#xA;async def play(ctx):&#xA;    global queue&#xA;&#xA;    server = ctx.message.guild&#xA;    voice_channel = server.voice_client&#xA;&#xA;    async with ctx.typing():&#xA;        player = await YTDLSource.from_url(queue[0], loop=client.loop)&#xA;        voice_channel.play(player, after=lambda e: print(&#x27;Player error: %s&#x27; % e) if e else None)&#xA;&#xA;    await ctx.send(&#x27;**Now playing:** {}&#x27;.format(player.title))&#xA;    del(queue[0])&#xA;&#xA;#pause&#xA;@client.command(name=&#x27;pause&#x27;, help=&#x27;This command pauses the song&#x27;)&#xA;async def pause(ctx):&#xA;    server = ctx.message.guild&#xA;    voice_channel = server.voice_client&#xA;&#xA;    voice_channel.pause()&#xA;&#xA;#resune&#xA;@client.command(name=&#x27;resume&#x27;, help=&#x27;This command resumes the song!&#x27;)&#xA;async def resume(ctx):&#xA;    server = ctx.message.guild&#xA;    voice_channel = server.voice_client&#xA;&#xA;    voice_channel.resume()&#xA;&#xA;#viow&#xA;@client.command(name=&#x27;view&#x27;, help=&#x27;This command shows the queue&#x27;)&#xA;async def view(ctx):&#xA;    await ctx.send(f&#x27;Your queue is now `{queue}!`&#x27;)&#xA;&#xA;#leave&#xA;@client.command(name=&#x27;leave&#x27;, help=&#x27;This command stops makes the bot leave the voice channel&#x27;)&#xA;async def leave(ctx):&#xA;    voice_client = ctx.message.guild.voice_client&#xA;    await voice_client.disconnect()&#xA;&#xA;#stop&#xA;@client.command(name=&#x27;stop&#x27;, help=&#x27;This command stops the song!&#x27;)&#xA;async def stop(ctx):&#xA;    server = ctx.message.guild&#xA;    voice_channel = server.voice_client&#xA;&#xA;    voice_channel.stop()&#xA;&#xA;@tasks.loop(seconds=20)&#xA;async def change_status():&#xA;    await client.change_presence(activity=discord.Game(choice(status)))&#xA;&#xA;client.run("my_secret")&#xA;

    &#xA;

  • FFmpeg combine Stream Loop and Filter into one command

    5 juin 2022, par Ace

    I'm currently running two FFmpeg commends :

    &#xA;

    [1] Looping a video for the entire duration of an audio file.

    &#xA;

    ffmpeg  -stream_loop -1 -i 1min-loop.mp4 -i 2min-song.mp3 -shortest -map 0:v:0 -map 1:a:0 -y looped-video.mp4&#xA;

    &#xA;

    [2] Taking the resulting file add overlaying image files.

    &#xA;

    ffmpeg -i looped-video.mp4 -i overlay.png -i art.jpeg -filter_complex "\&#xA;  [2:v]scale=400:400[resized-artwork];\&#xA;  [0][resized-artwork]overlay=100:100[vid-and-artwork];\&#xA;  [vid-and-artwork][1:v]overlay=0:0" final-video.mp4&#xA;

    &#xA;

    Is it possible to combine these into one command ? Thx

    &#xA;