
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (38)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to translation
13 avril 2011You 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 (7132)
-
My heroku music bot works fine if i launch it through my pc yet when i run it through heroku it doesn't work
6 mars 2020, par Flii TVI have ffmpeg, youtube-dl installed, i have every requirement installed, it downloads the song renames it but then nothing happens !
@client.command()
async def play(ctx, *url: str):
song_there = os.path.isfile("song.mp3")
try:
if song_there:
os.remove("song.mp3")
print("Removed old song file")
except PermissionError:
print("Trying to delete song file, but it's being played")
await ctx.send("ERROR: Music playing")
return
await ctx.send("Getting everything ready now")
voice = get(client.voice_clients, guild=ctx.guild)
ydl_opts = {
'format': 'bestaudio/best',
'quiet': True,
'outtmpl':"./song.mp3",
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
song_search = " ".join(url)
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
print("Downloading audio now\n")
ydl.download([f"ytsearch1:{song_search}"])
for file in os.listdir("./"):
if file.endswith(".mp3"):
name = file
print(f"Renamed File: {file}\n")
os.rename(file, "song.mp3")
voice.play(discord.FFmpegPCMAudio("song.mp3"), after=lambda e: print(f"{name} has finished playing"))
voice.source = discord.PCMVolumeTransformer(voice.source)
voice.source.volume = 0.10
nname = name.rsplit("-", 2)
await ctx.send(f"Currently playing: {nname}")
print("playing\n") -
I am streaming mp3 music via ffmpeg to a local rtmp server then converting to hls, but am having difficulties end to end testing
12 avril 2020, par SquirrelSenpaiI am streaming mp3 music via ffmpeg to a local rtmp server then converting to hls, but am having difficulties end to end testing. I am know test.m3u8 playlist should be produce, however I am unable to check inside /nginx/hls/ as it is locked by www-data during operation. I have tried multiple permutation of what I thought the output hls stream would be in vlc with no luck. localhost:8080/live/test.m3u8, localhost:8080/hls/test.m3u8



Any tips on effective testing would be much appreciated.



Technologies involved :



- 

- FFMPEG
- NGINX (This and the below 3 are part of a module)
- HLS
- RTMP











Working :



ffmpeg -hide_banner -i http://149.255.59.164:8138 -f mp3 test.mp3




Seemingly working, correctly reads files, shows conversion of some kind

size= 362kB time=00:00:23.09 bitrate= 128.3kbits/s speed=3.21x


fmpeg -hide_banner -i http://x.x.x.x:8138 -f mp3 rtmp://localhost:1935/live/test




Nginx.conf



user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
 worker_connections 768;
 # multi_accept on;
}

rtmp_auto_push on;

rtmp{

 server{

 listen 1935;

 chunk_size 4000;

 #one publisher, many subscribers

 application live {

 # enable live streaming
 live on;
 record off;

 # publish only from localhost
 allow publish 127.0.0.1;
 deny publish all;

 # hls - required for web browser consumption
 hls on;
 hls_path /tmp/hls;
 hls_fragment 3;
 hls_playlist_length 60;

 # disable consuming the streaming from nginx as rtmp
 deny play all;

 }

 }

}

# HTTP can be used for accessing RTMP stats
http {

 server {

 listen 8080;

 # This URL provides RTMP statistics in XML
 location /stat {
 rtmp_stat all;

 # Use this stylesheet to view XML as web page
 # in browser
 rtmp_stat_stylesheet stat.xsl;
 }

 location /stat.xsl {
 # XML stylesheet to view RTMP stats.
 # Copy stat.xsl wherever you want
 # and put the full directory path here
 root /path/to/stat.xsl/;
 }

 location /hls {
 # Serve HLS fragments
 types {
 application/vnd.apple.mpegurl m3u8;
 video/mp2t ts;
 }
 root /tmp;
 add_header Cache-Control no-cache;
 }

 location /dash {
 # Serve DASH fragments
 root /tmp;
 add_header Cache-Control no-cache;
 }
 }
}



-
ffmpeg doesn't work, when starting up it doesn't play music, it gives errors
14 août 2024, par Оля Михееваimport discord
from discord import FFmpegPCMAudio
import os
import random
from gtts import gTTS
import asyncio

TOKEN="***"
VOICE_CHANNEL_ID=11122224444

class Voice_Bot(discord.Client):
 def __init__(self):
 intents = discord.Intents.default()
 intents.message_content = True
 intents.voice_states=True
 super().__init__(intents=intents)
 print(os.getcwd())
 self.sounds_hello = os.listdir(os.path.join('sounds','hello'))
 self.sounds_bye = os.listdir('sounds\\bye')
 self.sounds = os.listdir('sounds\\nature')

 async def on_ready(self): 
 self.voice_channel = self.get_channel(VOICE_CHANNEL_ID) 
 if self.voice_channel == None:
 print('Не удалось подключиться к голосовому каналу.')
 return
 self.voice_client = await self.voice_channel.connect()
 print('Бот подключен к голосовому каналу')
 await self.text_to_speech("Lets play Guess the Tune")
 
 async def on_message(self,message):
 if message.author==self.user:
 return
 if message.content.startswith("game"):
 await self.text_to_speech("let's start the game guess the melody")
 music=os.listdir("sounds\\music")
 self.melody=random.choice(music)
 await self.play_sound(f"sounds\\music\\{self.melody}")
 elif message.content==self.melody[0:len(self.melody)-4]:
 if (self.voice_client.is_playing()):
 self.voice_client.stop()
 await self.text_to_speech(f"Congratulations, {message.author.name} answered correctly! To continue, type game")
 else:
 if (self.voice_client.is_playing()):
 self.voice_client.stop()
 await self.text_to_speech(f"Unfortunately, {message.author.name} did not guess. To continue, write game")


 async def on_voice_state_update(self,member,before,after):
 if member.id ==self.user.id:
 print('Someone entered or left the voice channel.')
 else:
 try:
 if before.channel == None:
 print(f'{member.name} entered the voice channel {after.channel}.')
 await self.play_sound(f'sounds\\hello\\{random.choice(self.sounds_hello)}')
 elif after.channel == None:
 print(f'{member.name} left the voice channel {before.channel}.')
 await self.play_sound(f'sounds\\bye\\{random.choice(self.sounds_bye)}')
 except Exception as e:
 print(f"Error in on_voise_state_update: {e}")

 async def text_to_speech(self,text):
 try:
 tts = gTTS(text=text, lang ="en")
 tts.save("text.mp3")
 except Exception as e:
 print(f"Error e: {e}")
 await self.voice_channel.send(text)
 await self.play_sound("text.mp3")

 def play_sound(self,path):
 print(path)
 source=discord.FFmpegPCMAudio(source=path, executable="ffmpeg\\bin\\ffmpeg.exe")
 if (self.voice_client.is_playing()):
 self.voice_client.stop()
 self.voice_client.play(source) 

client = Voice_Bot()
client.run(TOKEN)



[enter image description here](https://i.sstatic.net/ys8Xza0w.jpg)