
Recherche avancée
Médias (3)
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (111)
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Les notifications de la ferme
1er décembre 2010, parAfin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
Les notifications de changement de statut
Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
À la demande d’un canal
Passage au statut "publie"
Passage au (...) -
Initialisation de MediaSPIP (préconfiguration)
20 février 2010, parLors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
Dans un premier temps il active ou désactive des options de SPIP qui ne le (...)
Sur d’autres sites (6680)
-
How to replace the video track in a video file with a still image ?
22 février 2021, par cornerstoreI am trying to use ffmpeg to replace the video track in a video file with a still image. I tried some commands I got from other questions such as the one here


ffmpeg -i x.png -i orig.mp4 final.mp4


ffmpeg -r 1/5 -i x.png -r 30 -i orig.mp4 final.mp4


But these didn't work. I'm not sure which of these arguments are required or not. The output should be accepted by YouTube as a valid video - I was able to simply remove the video track, but apparently they don't let you upload a video without a video track.


-
Pycord Music Bot : AttributeError : 'FFmpegAudio' object has no attribute '_process'
5 juin 2022, par Steven MaoI'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">
Traceback (most recent call last):
 File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 127, in __del__
 self.cleanup()
 File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 247, in cleanup
 self._kill_process()
 File "/home/stevenmao/.local/lib/python3.8/site-packages/discord/player.py", line 198, in _kill_process
 proc = self._process
AttributeError: 'FFmpegAudio' object has no attribute '_process'
</function>


-
Why i get error when i try to run command play in python script of discord bot
30 mai 2022, par UNDERTAKER 86My code of music discord bot :


import ffmpeg
import asyncio
import discord
from discord.ext import commands
import os
import requests
import random
import json
from replit import db
import youtube_dl
from keep_alive import keep_alive

class music(commands.Cog):
 def __init__(self, client):
 self.client = client

 @commands.command()
 async def join(self, ctx):
 if ctx.author.voice is None:
 await ctx.send(f'{ctx.message.author.mention}, Ты не подключён к голосовому чату!')
 voice_channel = ctx.author.voice.channel
 if ctx.voice_client is None:
 await voice_channel.connect()
 else:
 await ctx.voice_client.move_to(voice_channel)
 
 @commands.command()
 async def leave(self, ctx):
 if ctx.author.voice is None:
 await ctx.send(f'{ctx.message.author.mention}, Ты не подключён к голосовому чату!')
 else:
 await ctx.voice_client.disconnect()
 await ctx.send(f'{ctx.message.author.mention}, Пока!')

 @commands.command()
 async def play(self, ctx, *, url):
 if ctx.author.voice is None:
 await ctx.send(f'{ctx.message.author.mention}, Ты не подключён к голосовому чату!')
 ctx.voice_client.stop()
 ffmpeg_options = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 YDL_OPTIONS = {'format': 'bestaudio/best', 'noplaylist': 'True', 'simulate': 'True',
 'preferredquality': '32bits', 'preferredcodec': 'wav', 'key': 'FFmpegExtractAudio'}
 vc = ctx.voice_client

 with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
 if 'https://' in url:
 info = ydl.extract_info(url, download=False)
 else:
 info = ydl.extract_info(f'ytsearch:{url}', download=False)['entries'][0]
 url2 = info['formats'][0]['url']
 source = await discord.FFmpegOpusAudio.from_probe(url2, **ffmpeg_options)
 vc.play(source)

 @commands.command()
 async def pause(self, ctx):
 if ctx.author.voice is None:
 await ctx.send(f'{ctx.message.author.mention}, Ты не подключён к голосовому чату!')
 await ctx.voice_client.pause()
 await ctx.send(f'{ctx.message.author.mention}, Пауза')

 @commands.command()
 async def resume(self, ctx):
 if ctx.author.voice is None:
 await ctx.send(f'{ctx.message.author.mention}, Ты не подключён к голосовому чату!')
 await ctx.voice_client.resume()
 await ctx.send(f'{ctx.message.author.mention}, Играет')

# @commands.command()
 # async def stop(self, ctx):
 # await ctx.voice_client.stop()
 # ctx.send(f'{author.mention}, Остановлен')

# @commands.command()
 # async def repeat(self, ctx):
 # await ctx.voice_client.repeat()
 # ctx.send(f'{author.mention}, Повтор')

# @commands.command()
 # async def loop(self, ctx):
 # await ctx.voice_client.loop()
 # ctx.send(f'{author.mention}, Повтор')

keep_alive()
def setup(client):
 client.add_cog(music(client))



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


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



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 ?