
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (71)
-
MediaSPIP Player : les contrôles
26 mai 2010, parLes contrôles à la souris du lecteur
En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...) -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté. -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (5449)
-
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 :


-
ffmpeg realtime bad quality variable fps cams inputs to constant framerate problem
23 janvier 2023, par BloodMan../ffmpeg/ffmpeg -err_detect ignore_err -nostdin -threads 0 -y -strict experimental -thread_queue_size 10M -max_delay 20M -rtbufsize 20M -fflags +discardcorrupt \
 -i "${cam1}" -i "${cam2}" -i "${cam3}" -i "${cam4}" \
 -filter_complex " \
 nullsrc=size=3840x2160:rate=30 [main1]; \
 anullsrc=channel_layout=stereo:sample_rate=44100 [a]; \
 [0:v] scale=1920:1080 [overlay1]; \
 [1:v] scale=1920:1080 [overlay2]; \
 [2:v] scale=1920:1080 [overlay3]; \
 [3:v] scale=1920:1080 [overlay4]; \
 [main1][overlay1] overlay=0:0 [main2]; \
 [main2][overlay2] overlay=1920:0 [main3]; \
 [main3][overlay3] overlay=0:1080 [main4]; \
 [main4][overlay4] overlay=1920:1080 [v] " \
 -t 10 -r 30 -g 60 -map "[v]" -map "[a]" \
 -shortest -video_size 3840x2160 -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -tune zerolatency -minrate 2M -maxrate 2M -bufsize 20M -c:a aac -b:a 96k -ac 2 -ar 48000 -copytb 1 \
 -f flv -y -fflags +genpts rtmp://b.rtmp.youtube.com/live2/${key}?backup=1



ffmpeg version N-109650-g9d5e66942c Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 10 (Debian 10.2.1-6)
 configuration: --prefix=/home/bloodman/ffmpeg --pkg-config-flags=--static --extra-cflags='-I/home/bloodman/ffmpeg/include -march=native' --extra-ldflags=-L/home/bloodman/ffmpeg/lib --extra-libs='-lpthread -lm' --bindir=/home/bloodman/ffmpeg --enable-gpl --enable-nonfree --enable-libx264 --enable-libfdk-aac --enable-libmp3lame --enable-libfreetype --enable-hardcoded-tables
 libavutil 57. 44.100 / 57. 44.100
 libavcodec 59. 56.100 / 59. 56.100
 libavformat 59. 35.100 / 59. 35.100
 libavdevice 59. 8.101 / 59. 8.101
 libavfilter 8. 54.100 / 8. 54.100
 libswscale 6. 8.112 / 6. 8.112
 libswresample 4. 9.100 / 4. 9.100
 libpostproc 56. 7.100 / 56. 7.100
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db77780] Opening 'cams/stream1_113.ts' for reading
Input #0, hls, from 'cams/stream1.m3u8':
 Duration: N/A, start: 1122.341667, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #0:0: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 2048x1536, 15 fps, 15 tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
[hls @ 0x56019db9e980] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db9e980] Opening 'cams/stream2_105.ts' for reading
Input #1, hls, from 'cams/stream2.m3u8':
 Duration: N/A, start: 1042.633000, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #1:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 100 tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
[hls @ 0x56019dccdbc0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019dccdbc0] Opening 'cams/stream3_14.ts' for reading
Input #2, hls, from 'cams/stream3.m3u8':
 Duration: N/A, start: 132.469000, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #2:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 2688x1520, 25 fps, 100 tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
[hls @ 0x56019f0ec980] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019f0ec980] Opening 'cams/stream4_26.ts' for reading
Input #3, hls, from 'cams/stream4.m3u8':
 Duration: N/A, start: 253.389000, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #3:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 1920x1080, 90k tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
Stream mapping:
 Stream #0:0 (h264) -> scale:default
 Stream #1:0 (h264) -> scale:default
 Stream #2:0 (h264) -> scale:default
 Stream #3:0 (h264) -> scale:default
 overlay:default -> Stream #0:0 (libx264)
 anullsrc:default -> Stream #0:1 (aac)
[hls @ 0x56019db77780] Opening 'cams/stream1_114.ts' for reading
[hls @ 0x56019db77780] Opening 'cams/stream1_115.ts' for reading
[swscaler @ 0x5601a2c78e40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5601a332c940] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5601a2c78e40] deprecated pixel format used, make sure you did set range correctly
 Last message repeated 2 times
[swscaler @ 0x5601a332c940] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5601a361fc00] deprecated pixel format used, make sure you did set range correctly
 Last message repeated 1 times
[libx264 @ 0x56019e5212c0] using SAR=1/1
[libx264 @ 0x56019e5212c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x56019e5212c0] profile Constrained Baseline, level 5.1, 4:2:0, 8-bit
[libx264 @ 0x56019e5212c0] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8 lookahead_threads=8 sliced_threads=1 slices=8 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=60 keyint_min=6 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2000 vbv_bufsize=20000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, flv, to 'rtmp://b.rtmp.youtube.com/live2/XXXX-XXXX-XXXX-XXXX-XXXX?backup=1':
 Metadata:
 encoder : Lavf59.35.100
 Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 1k tbn
 Metadata:
 encoder : Lavc59.56.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 2000000/0/0 buffer size: 20000000 vbv_delay: N/A
 Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 96 kb/s
 Metadata:
 encoder : Lavc59.56.100 aac
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')00:00:03.22 bitrate=7519.6kbits/s speed=0.359x
[hls @ 0x56019db77780] Opening 'cams/stream1_116.ts' for reading
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')00:00:07.23 bitrate=4470.2kbits/s speed=0.383x
[hls @ 0x56019db77780] Opening 'cams/stream1_117.ts' for reading
[hls @ 0x56019f0ec980] Skip ('#EXT-X-VERSION:3')00:00:09.04 bitrate=3978.1kbits/s speed=0.384x
[hls @ 0x56019f0ec980] Opening 'cams/stream4_27.ts' for reading
[hls @ 0x56019dccdbc0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019dccdbc0] Opening 'cams/stream3_15.ts' for reading
[hls @ 0x56019db9e980] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db9e980] Opening 'cams/stream2_106.ts' for reading
[flv @ 0x56019e639a00] Failed to update header with correct duration.811.6kbits/s speed=0.385x
[flv @ 0x56019e639a00] Failed to update header with correct filesize.
frame= 299 fps= 12 q=34.0 Lsize= 4622kB time=00:00:09.98 bitrate=3792.7kbits/s speed=0.386x
video:4603kB audio:3kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.349536%
[libx264 @ 0x56019e5212c0] frame I:5 Avg QP:45.60 size:275880
[libx264 @ 0x56019e5212c0] frame P:294 Avg QP:38.77 size: 11340
[libx264 @ 0x56019e5212c0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x56019e5212c0] mb P I16..4: 1.4% 0.0% 0.0% P16..4: 4.7% 0.0% 0.0% 0.0% 0.0% skip:93.9%
[libx264 @ 0x56019e5212c0] coded y,uvDC,uvAC intra: 16.2% 8.9% 1.2% inter: 1.8% 0.6% 0.0%
[libx264 @ 0x56019e5212c0] i16 v,h,dc,p: 64% 17% 15% 5%
[libx264 @ 0x56019e5212c0] i8c dc,h,v,p: 90% 6% 3% 1%
[libx264 @ 0x56019e5212c0] kb/s:3783.23
[aac @ 0x56019e63a700] Qavg: 65511.207
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db77780] Opening 'cams/stream1_118.ts' for reading



NOTES : sources are cams streamed first to hls/m3u8. -t 10 only for testing purposes.


The problem is variable output fps= 12 (sometimes 2, 5, 10, maybe 13) where I expect 30. Machine is 10 times greater (encode uses up to 5% cpu).


Im trying adding -re, -r 30, -r 15 to sources, convert sources via stream_filter (,fps=30), vsync (old versions of ffmpeg), wallclock time, etc. and reading stackoverflow of course. And... nothing.


Where is the problem ?


-
Introducing the Data Warehouse Connector feature
30 janvier, par Matomo Core Team