
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (40)
-
Selection of projects using MediaSPIP
2 mai 2011, parThe 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, parLes 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, parTo 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 DiaconoSo, 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 andself
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 PetersenMy 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 









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


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 ?


Code :


import discord
import youtube_dl
import asyncio


# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ""


ytdl_format_options = {
 "format": "bestaudio/best",
 "outtmpl": "%(extractor)s-%(id)s-%(title)s.%(ext)s",
 "restrictfilenames": True,
 "noplaylist": False,
 "yesplaylist": 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 at certain times
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source: discord.AudioSource, *, data: dict, volume: float = 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, timestamp = 0):
 ffmpeg_options = {
 "options": f"-vn -ss {timestamp}"}

 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:
 # Takes the first item from a playlist
 data = data["entries"][0]

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


intents = discord.Intents.default()

bot = discord.Bot(intents=intents)

@bot.slash_command()
async def play(ctx, audio: discord.Option(), seconds: discord.Option(), timestamp: discord.Option()):
 channel = ctx.author.voice.channel
 voice = await channel.connect()
 player = await YTDLSource.from_url(audio, loop=bot.loop, stream=True, timestamp=int(timestamp))
 voice.play(player)
 await asyncio.sleep(int(seconds))
 await voice.disconnect()

token = token value
bot.run(token)



-
Trying to install ffmpeg with brew and I keep getting errors related to "dav1d_bottle_manifest"
13 décembre 2022, par Jonathan DoeI 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.


I am running a 2019 macbook pro.


When I run brew intsall ffmpeg -d


I get this on my terminal output


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



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


I try to manually run :


brew update -d



and the update stalls forever on this section :


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



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