Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (40)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (5037)

  • My music doesn't play correctly and other problems - Discord.py

    24 mars 2021, par Diacono

    So, I'm triying to let my bot play songs directly from the url (without downloading them like the song.mp3 method) but I'm having a hard time. The bot plays only 1 song and when I try to play another song it doesn't play it.
I'm also getting 2 errors : video_link is not defined and self is not defined.
Also when I try to play live music like "lofi hip hop radio - beats to relax/study to" nothing happens.
Can you help me please ???

    


    This is my code

    


    import asyncio
import discord
from discord.ext import commands, tasks
import requests
import json
from random import choice
from discord.utils import get
from discord import FFmpegPCMAudio
import youtube_dl
bot = commands.Bot(command_prefix="!")



ytdl_format_options = {
    'format': 'bestaudio/best',
    'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
    'restrictfilenames': True,
    'noplaylist': True,
    'nocheckcertificate': True,
    'ignoreerrors': False,
    'logtostderr': False,
    'quiet': True,
    'no_warnings': True,
    'default_search': 'auto',
    'source_address': '0.0.0.0' # bind to ipv4 since ipv6 addresses cause issues sometimes
}

ffmpeg_options = {
    'options': '-vn'
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)

class YTDLSource(discord.PCMVolumeTransformer):
    def __init__(self, source, *, data, volume=0.5):
        super().__init__(source, volume)

        self.data = data

        self.title = data.get('title')
        self.url = data.get('url')

    @classmethod
    async def from_url(cls, url, *, loop=None, stream=False):
        loop = loop or asyncio.get_event_loop()
        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download= not stream))

        if 'entries' in data:
            data = data['entries'][0]

        filename = data['url'] if stream else ytdl.prepare_filename(data)
        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)


@bot.command()
async def play(ctx, url):
    voice = await ctx.author.voice.channel.connect()
    player = await YTDLSource.from_url(url, loop=client.loop)
    ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
    ydl_opts = {'format': 'bestaudio'}
    FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
         info = ydl.extract_info(video_link, download=False)
         URL = info['formats'][0]['url']
    voice = get(self.bot.voice_clients, guild=ctx.guild)
    voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))


    


  • Seeking with ffmpeg options fails or causes delayed playback in Discord bot

    29 août 2022, par J Petersen

    My Discord bot allows users to play a song starting from a timestamp.

    


    The problem is that playback is delayed and audio plays faster and is jumbled if start times >= 30s are set.

    


    Results from testing different start times. Same URL, 30 second duration :

    


    





    


    


    


    


    


    



    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    Entered Start Time (s) Playback Delay (s) Song Playback Time (s)
    0 3 30
    30 10 22
    60 17 17
    120 31 2
    150 120 <1

    &#xA;

    &#xA;

    I am setting the start time using ffmpeg_options as suggested in this question.

    &#xA;

    Does anyone understand why the audio playback is being delayed/jumbled ? How can I improve playback delay and allow users to start in the middle of a multi-chapter YouTube video ?

    &#xA;

    Code :

    &#xA;

    import discord&#xA;import youtube_dl&#xA;import asyncio&#xA;&#xA;&#xA;# Suppress noise about console usage from errors&#xA;youtube_dl.utils.bug_reports_message = lambda: ""&#xA;&#xA;&#xA;ytdl_format_options = {&#xA;    "format": "bestaudio/best",&#xA;    "outtmpl": "%(extractor)s-%(id)s-%(title)s.%(ext)s",&#xA;    "restrictfilenames": True,&#xA;    "noplaylist": False,&#xA;    "yesplaylist": True,&#xA;    "nocheckcertificate": True,&#xA;    "ignoreerrors": False,&#xA;    "logtostderr": False,&#xA;    "quiet": True,&#xA;    "no_warnings": True,&#xA;    "default_search": "auto",&#xA;    "source_address": "0.0.0.0",  # Bind to ipv4 since ipv6 addresses cause issues at certain times&#xA;}&#xA;&#xA;ytdl = youtube_dl.YoutubeDL(ytdl_format_options)&#xA;&#xA;&#xA;class YTDLSource(discord.PCMVolumeTransformer):&#xA;    def __init__(self, source: discord.AudioSource, *, data: dict, volume: float = 0.5):&#xA;        super().__init__(source, volume)&#xA;&#xA;        self.data = data&#xA;&#xA;        self.title = data.get("title")&#xA;        self.url = data.get("url")&#xA;&#xA;    @classmethod&#xA;    async def from_url(cls, url, *, loop=None, stream=False, timestamp = 0):&#xA;        ffmpeg_options = {&#xA;            "options": f"-vn -ss {timestamp}"}&#xA;&#xA;        loop = loop or asyncio.get_event_loop()&#xA;&#xA;        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))&#xA;        if "entries" in data:&#xA;            # Takes the first item from a playlist&#xA;            data = data["entries"][0]&#xA;&#xA;        filename = data["url"] if stream else ytdl.prepare_filename(data)&#xA;        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)&#xA;&#xA;&#xA;intents = discord.Intents.default()&#xA;&#xA;bot = discord.Bot(intents=intents)&#xA;&#xA;@bot.slash_command()&#xA;async def play(ctx, audio: discord.Option(), seconds: discord.Option(), timestamp: discord.Option()):&#xA;    channel = ctx.author.voice.channel&#xA;    voice = await channel.connect()&#xA;    player = await YTDLSource.from_url(audio, loop=bot.loop, stream=True, timestamp=int(timestamp))&#xA;    voice.play(player)&#xA;    await asyncio.sleep(int(seconds))&#xA;    await voice.disconnect()&#xA;&#xA;token = token value&#xA;bot.run(token)&#xA;

    &#xA;

  • Trying to install ffmpeg with brew and I keep getting errors related to "dav1d_bottle_manifest"

    13 décembre 2022, par Jonathan Doe

    I am trying to do some basic DSP in python and in order to play some of my audio files I need to install ffmpeg on my computer.

    &#xA;

    I am running a 2019 macbook pro.

    &#xA;

    When I run brew intsall ffmpeg -d

    &#xA;

    I get this on my terminal output

    &#xA;

    rm: /usr/local/Homebrew/.git/TMP_FETCH_FAILURES: is a directory&#xA;rm: /usr/local/Homebrew/.git/TMP_FETCH_FAILURES: is a directory&#xA;Running `brew update --auto-update`...&#xA;

    &#xA;

    This auto update just runs forever with no updates of any kind. I'm not sure if it is broken or stuck or what.

    &#xA;

    I try to manually run :

    &#xA;

     brew update -d&#xA;

    &#xA;

    and the update stalls forever on this section :

    &#xA;

    &#x2B; [[ -f /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD ]]&#xA;&#x2B; touch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD&#xA;&#x2B; [[ -z &#x27;&#x27; ]]&#xA;&#x2B; [[ 200 == \3\0\4 ]]&#xA;&#x2B; [[ -n &#x27;&#x27; ]]&#xA;&#x2B; local tmp_failure_file=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/TMP_FETCH_FAILURES&#xA;&#x2B; rm -f /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/TMP_FETCH_FAILURES&#xA;&#x2B; [[ -n &#x27;&#x27; ]]&#xA;&#x2B; git fetch --tags --force -q origin refs/heads/master:refs/remotes/origin/master&#xA;

    &#xA;

    I am having so many problems with brew any help would be appreciated.

    &#xA;