
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (62)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (10140)
-
How can I stream mjpeg file as rtsp
24 août 2013, par Ilya YevlampievWe have an mjpeg video, obtained from the webcam and stored into *.avi file, still encoded as mjpeg.
We need to restream this file as rtsp (and stil preserve the mjpeg there, i.e. no decoding). The goal is to emulate the webcam this video was obtained from for the software that processes the video. The file can be open with vlc/ffplay with no problems. The ffmpeg behaves like it is streaming it, however, ffplay/vlc can't open this stream.
We tried to stream if with gstreamer.
1) we fount no free rtsp sink element for gstreamer pipeline. So, is there a free analogue for rtspsink to launch this pipeline with gst-launch ? we need and only cast, so we don't need so advanced element as rtspsink is.
2) we also tried to build own simple rtsp server as described in http://weeklybuild.com/2013/01/creating-an-rtsp-stream-with-gstreamer/
replacing videotestsrc with filesrc ; but what kind of elements we should use there ? usage of an only filesrc doesn't help ; we get the same problem as if we stream with ffmpeg. But what kind of lements we need there, if we dont' wan to decode/encode it, just to stream the file (to reproduce the thing what the webcam actually does).
$ ffplay rtsp://127.0.0.1:8554/test -loglevel debug
avplay version 0.8.5-6:0.8.5-1, Copyright (c) 2003-2012 the Libav developers
built on Jan 13 2013 12:05:48 with gcc 4.7.2
configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
avutil configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.4-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
avcodec configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.4-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
avformat configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.4-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
swscale configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.4-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
postproc configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.4-1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable- postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
libavutil 51. 22. 1 / 51. 22. 1
libavcodec 53. 35. 0 / 53. 35. 0
libavformat 53. 21. 1 / 53. 21. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 15. 0 / 2. 15. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 52. 0. 0 / 52. 0. 0
[rtsp @ 0x7f558c0008c0] method DESCRIBE failed: 503 Service Unavailable
[rtsp @ 0x7f558c0008c0] CSeq: 2
Server: GStreamer RTSP server
Date: Thu, 22 Aug 2013 07:49:30 GMT
rtsp://127.0.0.1:8554/test: Invalid data found when processing inputAnd everything is okay when I try gstreamer server built as in example, i.e. using videotestsrc
-
Why does my discord bot not able to find the file that is there when I open the folder manually ?
22 juin 2021, par TomaI made a discord bot that should play music using ffmpeg.


It's connecting and downloading the youtube webm file after which it should convert and rename it to
song.mp3
but it doesn't manage to do so. I check the folder and the error message doesn't match what I see - the file is there and has been renamed.

- 

- Am I using the replace command correctly to move the file ?
- I'd note that I'm using windows10 and that the folders are all read only and that although I'm the admin I can't change that no matter what I do (I guess it's a win10 bug). Does that have anything to do with it ?
- Is there another mistake in the code that'd prevent the file from being found by the bot ?








My code :


import discord
from discord.ext import commands
import youtube_dl #for url music command
import os

client = commands.Bot(command_prefix = '><')

#connect to voice channel
@client.command(aliases = ['c'])
async def connect(ctx, vcName):
 voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
 voiceChannel = discord.utils.get(ctx.guild.channels, name=str(vcName))
 if voice == None: #if voice is not connected to any channel
 await voiceChannel.connect()
 else:
 if voice.channel == vcName: #if trying to connect to the same channel
 await ctx.send('already connected to this channel')
 else:
 await voice.move_to(vcName)

@client.command(aliases = ['d'])
async def delFile(ctx):
 song_there = os.path.exists(os.getcwd()+'/music/current/song.mp3') #true when song.mp3 exists in 'current' folder in 'music' folder
 if song_there:
 await ctx.send('song was detected')
 os.remove('song.mp3')
 if song_there:
 await ctx.send('song was not deleted')
 else:
 await ctx.send('File is not found. check the name again')

#play music from url

@client.command(aliases = ['p'])
async def playMusic(ctx, vcName, url : str): #play music file
 song_there = os.path.exists(os.path.join(os.getcwd(),'/music/current/song.mp3'))
 try:
 if song_there:
 print('previous song found')
 os.remove(os.path.join(os.getcwd(),'/music/current/song.mp3')) #removes the song in current to make room for a new song
 if song_there:
 print('song was not deleted')
 else:
 print('song deleted')
 except PermissionError:
 await ctx.send('A song is currently playing')
 return
 voiceChannel = discord.utils.get(ctx.guild.channels, name=str(vcName))
 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }]
 }


 for file in os.listdir('./'):
 if file.endswith('.mp3'): #if song.mp3 already exists delete it to make room for a new download
 os.remove('song.mp3')
 else: #download the file from youtube
 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([url])
 for file in os.listdir('./'): #after downloading rename the file and move it to current folder
 if not file == ('song.mp3') and file.endswith('.mp3'):
 os.rename(file, 'song.mp3')
 print(os.path.join(os.getcwd(), 'song.mp3'))
 print(os.path.join(os.getcwd(), '/music/current/song.mp3'))
 os.replace(os.path.join(os.getcwd(), 'song.mp3'), os.path.join(os.getcwd(), '/music/current/song.mp3')) #move file to current

 voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
 if not voice is None: #if voice is already created
 if not voice.is_connected(): #and is not connected
 await voiceChannel.connect()
 voice.play(discord.FFmpegPCMAudio('song.mp3'))
 else:
 await ctx.send('Bot made an oopsy. Cast mending and heal bot.')
client.run('token')



Error :


[youtube] wkJ7oDMqz0A: Downloading webpage
[download] The Minor Bee-wkJ7oDMqz0A.webm has already been downloaded
[download] 100% of 5.13MiB
[ffmpeg] Destination: The Minor Bee-wkJ7oDMqz0A.mp3
Deleting original file The Minor Bee-wkJ7oDMqz0A.webm (pass -k to keep)
[youtube] wkJ7oDMqz0A: Downloading webpage
[download] Destination: The Minor Bee-wkJ7oDMqz0A.webm
[download] 100% of 5.13MiB in 00:00 
[ffmpeg] Destination: The Minor Bee-wkJ7oDMqz0A.mp3
Deleting original file The Minor Bee-wkJ7oDMqz0A.webm (pass -k to keep)
[youtube] wkJ7oDMqz0A: Downloading webpage
[download] Destination: The Minor Bee-wkJ7oDMqz0A.webm
[download] 100% of 5.13MiB in 00:00 
[ffmpeg] Destination: The Minor Bee-wkJ7oDMqz0A.mp3
Deleting original file The Minor Bee-wkJ7oDMqz0A.webm (pass -k to keep)
C:.....song.mp3 -> **C:/music/current/song.mp3**
Ignoring exception in command playMusic:
Traceback (most recent call last):
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "C:...tut-bot.py", line 84, in playMusic
 os.replace(os.path.join(os.getcwd(), 'song.mp3'), os.path.join(os.getcwd(), '/music/current/song.mp3')) #move file to current
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\....\\song.mp3' -> 'C:/music/current/song.mp3'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
 raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\...\\song.mp3' -> 'C:/music/current/song.mp3'



-
Why is my discord bot not able to find the file that is there when I open the folder manually ?
22 juin 2021, par TomaI made a discord bot that should play music using ffmpeg.


It's connecting and downloading the youtube webm file after which it should convert and rename it to
song.mp3
but it doesn't manage to do so. I check the folder and the error message doesn't match what I see - the file is there and has been renamed.

- 

- Am I using the replace command correctly to move the file ?
- I'd note that I'm using windows10 and that the folders are all read only and that although I'm the admin I can't change that no matter what I do (I guess it's a win10 bug). Does that have anything to do with it ?
- Is there another mistake in the code that'd prevent the file from being found by the bot ?








My code :


import discord
from discord.ext import commands
import youtube_dl #for url music command
import os

client = commands.Bot(command_prefix = '><')

#connect to voice channel
@client.command(aliases = ['c'])
async def connect(ctx, vcName):
 voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
 voiceChannel = discord.utils.get(ctx.guild.channels, name=str(vcName))
 if voice == None: #if voice is not connected to any channel
 await voiceChannel.connect()
 else:
 if voice.channel == vcName: #if trying to connect to the same channel
 await ctx.send('already connected to this channel')
 else:
 await voice.move_to(vcName)

@client.command(aliases = ['d'])
async def delFile(ctx):
 song_there = os.path.exists(os.getcwd()+'/music/current/song.mp3') #true when song.mp3 exists in 'current' folder in 'music' folder
 if song_there:
 await ctx.send('song was detected')
 os.remove('song.mp3')
 if song_there:
 await ctx.send('song was not deleted')
 else:
 await ctx.send('File is not found. check the name again')

#play music from url

@client.command(aliases = ['p'])
async def playMusic(ctx, vcName, url : str): #play music file
 song_there = os.path.exists(os.path.join(os.getcwd(),'/music/current/song.mp3'))
 try:
 if song_there:
 print('previous song found')
 os.remove(os.path.join(os.getcwd(),'/music/current/song.mp3')) #removes the song in current to make room for a new song
 if song_there:
 print('song was not deleted')
 else:
 print('song deleted')
 except PermissionError:
 await ctx.send('A song is currently playing')
 return
 voiceChannel = discord.utils.get(ctx.guild.channels, name=str(vcName))
 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }]
 }


 for file in os.listdir('./'):
 if file.endswith('.mp3'): #if song.mp3 already exists delete it to make room for a new download
 os.remove('song.mp3')
 else: #download the file from youtube
 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([url])
 for file in os.listdir('./'): #after downloading rename the file and move it to current folder
 if not file == ('song.mp3') and file.endswith('.mp3'):
 os.rename(file, 'song.mp3')
 print(os.path.join(os.getcwd(), 'song.mp3'))
 print(os.path.join(os.getcwd(), '/music/current/song.mp3'))
 os.replace(os.path.join(os.getcwd(), 'song.mp3'), os.path.join(os.getcwd(), '/music/current/song.mp3')) #move file to current

 voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
 if not voice is None: #if voice is already created
 if not voice.is_connected(): #and is not connected
 await voiceChannel.connect()
 voice.play(discord.FFmpegPCMAudio('song.mp3'))
 else:
 await ctx.send('Bot made an oopsy. Cast mending and heal bot.')
client.run('token')



Error :


[youtube] wkJ7oDMqz0A: Downloading webpage
[download] The Minor Bee-wkJ7oDMqz0A.webm has already been downloaded
[download] 100% of 5.13MiB
[ffmpeg] Destination: The Minor Bee-wkJ7oDMqz0A.mp3
Deleting original file The Minor Bee-wkJ7oDMqz0A.webm (pass -k to keep)
[youtube] wkJ7oDMqz0A: Downloading webpage
[download] Destination: The Minor Bee-wkJ7oDMqz0A.webm
[download] 100% of 5.13MiB in 00:00 
[ffmpeg] Destination: The Minor Bee-wkJ7oDMqz0A.mp3
Deleting original file The Minor Bee-wkJ7oDMqz0A.webm (pass -k to keep)
[youtube] wkJ7oDMqz0A: Downloading webpage
[download] Destination: The Minor Bee-wkJ7oDMqz0A.webm
[download] 100% of 5.13MiB in 00:00 
[ffmpeg] Destination: The Minor Bee-wkJ7oDMqz0A.mp3
Deleting original file The Minor Bee-wkJ7oDMqz0A.webm (pass -k to keep)
C:.....song.mp3 -> **C:/music/current/song.mp3**
Ignoring exception in command playMusic:
Traceback (most recent call last):
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "C:...tut-bot.py", line 84, in playMusic
 os.replace(os.path.join(os.getcwd(), 'song.mp3'), os.path.join(os.getcwd(), '/music/current/song.mp3')) #move file to current
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\....\\song.mp3' -> 'C:/music/current/song.mp3'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "C:\Program Files\Python38\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
 raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\...\\song.mp3' -> 'C:/music/current/song.mp3'