
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (81)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer 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
Sur d’autres sites (4661)
-
FFmpegAudio object has no attribute _process
28 janvier 2023, par Benjamin TsoumagasI'm trying to make a Discord music bot that is remotely hosted and to do that I need ffmpeg to work. I was able to add it using my Dockerfile but upon trying to play music with the bot I get the following errors. For context, I am hosting on Fly.io and using python with the Nextcord library. Below is my relevant code and the error message. Please let me know if any more information is required.


import nextcord, os, json, re, youtube_dl
from nextcord import Interaction, application_checks
from nextcord.ext import commands

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': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0',
}

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

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)

class YTDLSource(nextcord.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(nextcord.FFmpegAudio(filename, *ffmpeg_options), data=data)

async def ensure_voice(interaction: Interaction):
 if interaction.guild.voice_client is None:
 if interaction.user.voice:
 await interaction.user.voice.channel.connect()
 else:
 await interaction.send("You are not connected to a voice channel.")
 raise commands.CommandError("Author not connected to a voice channel.")
 elif interaction.guild.voice_client.is_playing():
 interaction.guild.voice_client.stop()

class Music(commands.Cog, name="Music"):
 """Commands for playing music in voice channels"""

 COG_EMOJI = "🎵"

 def __init__(self, bot):
 self.bot = bot
 
 @application_checks.application_command_before_invoke(ensure_voice)
 @nextcord.slash_command()
 async def play(self, interaction: Interaction, *, query):
 """Plays a file from the local filesystem"""

 source = nextcord.PCMVolumeTransformer(nextcord.FFmpegPCMAudio(query))
 interaction.guild.voice_client.play(source, after=lambda e: print(f"Player error: {e}") if e else None)

 await interaction.send(f"Now playing: {query}")

 @application_checks.application_command_before_invoke(ensure_voice)
 @nextcord.slash_command()
 async def yt(self, interaction: Interaction, *, url):
 """Plays from a URL (almost anything youtube_dl supports)"""

 async with interaction.channel.typing():
 player = await YTDLSource.from_url(url, loop=self.bot.loop)
 interaction.guild.voice_client.play(
 player, after=lambda e: print(f"Player error: {e}") if e else None
 )

 await interaction.send(f"Now playing: {player.title}")

 @application_checks.application_command_before_invoke(ensure_voice)
 @nextcord.slash_command()
 async def stream(self, interaction: Interaction, *, url):
 """Streams from a URL (same as yt, but doesn't predownload)"""

 async with interaction.channel.typing():
 player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True)
 interaction.voice_client.play(
 player, after=lambda e: print(f"Player error: {e}") if e else None
 )

 await interaction.send(f"Now playing: {player.title}")

def setup(bot):
 bot.add_cog(Music(bot))



2023-01-28T23:16:15Z app[7d3b734a] yyz [info]Exception ignored in: <function at="at" 0x7fa78ea61fc0="0x7fa78ea61fc0">
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]Traceback (most recent call last):
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/player.py", line 116, in __del__
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] self.cleanup()
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/player.py", line 235, in cleanup
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] self._kill_process()
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/player.py", line 191, in _kill_process
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]AttributeError: 'FFmpegA
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]AttributeError: 'FFmpegA
dio' object has no attribute '_process'
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]Ignoring exception in command :
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]Traceback (most recent call last):
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/application_command.py", line 863, in invoke_callback_with_hooks
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] await self(interaction, *args, **kwargs)
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] File "/main/cogs/music.py", line 153, in yt
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] player = await YTDLSource.from_url(url, loop=self.bot.loop)
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] File "/main/cogs/music.py", line 71, in from_url 
2023-01-28T23:16:15Z app[7d3b734a] yyz [info] return cls(nextcord.FFmpegAudio(filename, *ffmpeg_options), data=data)
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]
The above exception was the direct cause of the following exception:

re given
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]The above exception was the direct cause of the following exception:
2023-01-28T23:16:15Z app[7d3b734a] yyz [info]nextcord.errors.ApplicationInvokeError: Command raised an exception: TypeError: FFmpegAudio.__init__() takes 2 positional arguments but 3 were given 
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]Exception ignored in: <function at="at" 0x7fa78ea61fc0="0x7fa78ea61fc0">
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]Traceback (most recent call last):
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/player.py", line 116, in __del__
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] self.cleanup()
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/player.py", line 235, in cleanup
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] self._kill_process()
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/player.py", line 191, in _kill_process
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] proc = self._process
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]AttributeError: 'FFmpegAudio' object has no attribute 
'_process'
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]Ignoring exception in command :
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]Traceback (most recent call last):
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] File "/usr/local/lib/python3.10/site-packages/nextcord/application_command.py", line 863, in invoke_callback_with_hooks
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] await self(interaction, *args, **kwargs)
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] File "/main/cogs/music.py", line 153, in yt
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] player = await YTDLSource.from_url(url, loop=self.bot.loop)
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] File "/main/cogs/music.py", line 71, in from_url 
2023-01-28T23:16:19Z app[7d3b734a] yyz [info] return cls(nextcord.FFmpegAudio(filename, *ffmpeg_options), data=data)
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]TypeError: FFmpegAudio.__init__() takes 2 positional arguments but 3 were given
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]The above exception was the direct cause of the following exception:
2023-01-28T23:16:19Z app[7d3b734a] yyz [info]nextcord.errors.ApplicationInvokeError: Command raised an exception: TypeError: FFmpegAudio.__init__() takes 2 positional arguments but 3 were given
</function></function>


Similar posts have been made but their issues were typos in changing 'option' : '-vn' to 'options' : '-vn'. I've combed through for any other errors but I can't find any. I was hoping to see I made a similar mistake, but this is the template I was following from the Nextcord developers and I had no luck :


-
Matomo’s privacy-friendly web analytics software named best of the year 2022
25 janvier 2023, par Erin -
VideoWriter Doesn't work using openCV, ubuntu, Qt
25 janvier 2023, par underflow223My code :


cv::VideoWriter(
 strFile.toStdString(),
 cv::VideoWriter::fourcc('m','p','4','v'),
 nfps,
 cv::Size(1920/nresize, 1080/nresize)
);



Error message :


[mpeg4_v4l2m2m @ 0x7f50a43c50] arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '7'.
Could not find a valid device
[mpeg4_v4l2m2m @ 0x7f50a43c50] can't configure encoder



If I use MJPG codec, it works fine thow.


This is OPENCV configure info :


-- General configuration for OpenCV 4.6.0 =====================================
-- Version control: unknown
-- 
-- Extra modules:
-- Location (extra): /home/firefly/Downloads/opencv_contrib-4.6.0/modules
-- Version control (extra): unknown
-- 
-- Platform:
-- Timestamp: 2023-01-19T02:11:26Z
-- Host: Linux 5.10.110 aarch64
-- CMake: 3.16.3
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
-- 
-- CPU/HW features:
-- Baseline: NEON FP16
-- 
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ standard: 11
-- C++ Compiler: /usr/bin/c++ (ver 9.4.0)
-- C++ flags (Release): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
-- Linker flags (Debug): -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: dl m pthread rt
-- 3rdparty dependencies:
-- 
-- OpenCV modules:
-- To be built: aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 python3 sfm viz
-- Applications: tests perf_tests apps
-- Documentation: NO
-- Non-free algorithms: NO
-- 
-- GUI: GTK3
-- GTK+: YES (ver 3.24.20)
-- GThread : YES (ver 2.64.6)
-- GtkGlExt: NO
-- VTK support: NO
-- 
-- Media I/O: 
-- ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
-- JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
-- WEBP: build (ver encoder: 0x020f)
-- PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
-- TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
-- JPEG 2000: build (ver 2.4.0)
-- OpenEXR: build (ver 2.3.0)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
-- 
-- Video I/O:
-- DC1394: YES (2.2.5)
-- FFMPEG: YES
-- avcodec: YES (58.54.100)
-- avformat: YES (58.29.100)
-- avutil: YES (56.31.100)
-- swscale: YES (5.5.100)
-- avresample: YES (4.0.0)
-- GStreamer: YES (1.16.2)
-- v4l/v4l2: YES (linux/videodev2.h)
-- 
-- Parallel framework: pthreads
-- 
-- Trace: YES (with Intel ITT)
-- 
-- Other third-party libraries:
-- Lapack: NO
-- Eigen: NO
-- Custom HAL: YES (carotene (ver 0.0.1))
-- Protobuf: build (3.19.1)
-- 
-- OpenCL: YES (no extra features)
-- Include path: /home/firefly/Downloads/opencv-4.6.0/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
-- 
-- Python (for build): /usr/bin/python2.7
-- 
-- Java: 
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
-- 
============================================================================================



ffmpeg info :


============================================================================================
ffmpeg
ffmpeg version 4.2.4-1ubuntu1.0firefly5 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
 configuration: --prefix=/usr --extra-version=1ubuntu1.0firefly5 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-librga --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared --disable-doc
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
====================================================================================