
Recherche avancée
Autres articles (55)
-
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...) -
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (6338)
-
Discord Bot can't play audio from YouTube all of a sudden
22 mars 2023, par Aidan TweedyLast night my Discord bot stopped working out of the blue. The bot had been working perfectly for months until this point - no code changes occurred and it was running in a Docker container on my home server. Then last night, my
!play <url></url>
command stopped working. The bot would join the voice channel, but not actually play anything. Then it would need to be manually disconnected from the voice channel in order for it to do anything again. After the first play fails, and I try again I get this error message :

[youtube] crOZk88eCcg: Downloading webpage
 [youtube] crOZk88eCcg: Downloading android player API JSON
 [youtube] Extracting URL: https://www.youtube.com/watch?v=crOZk88eCcg&ab_channel=0foofighter0
 [youtube] crOZk88eCcg: Downloading webpage
 [youtube] crOZk88eCcg: Downloading android player API JSON
 [2023-03-22 00:27:59] [ERROR ] discord.ext.commands.bot: Ignoring exception in command play
 Traceback (most recent call last):
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 190, in wrapped
 ret = await coro(*args, **kwargs)
 File "/usr/src/app/./main.py", line 180, in play
 voice.play(player, after=lambda e: print(f'Player error: {e}') if e else None)
 File "/usr/local/lib/python3.10/dist-packages/discord/voice_client.py", line 600, in play
 raise ClientException('Not connected to voice.')
 discord.errors.ClientException: Not connected to voice.
 
 The above exception was the direct cause of the following exception:
 
 Traceback (most recent call last):
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/bot.py", line 1347, in invoke
 await ctx.command.invoke(ctx)
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 986, in invoke
 await injected(*ctx.args, **ctx.kwargs) # type: ignore
 File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 199, in wrapped
 raise CommandInvokeError(exc) from exc
 discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.
 [2023-03-22 00:27:59] [INFO ] discord.player: ffmpeg process 12 has not terminated. Waiting to terminate...
 [2023-03-22 00:27:59] [INFO ] discord.player: ffmpeg process 12 should have terminated with a return code of -9.



My first instinct was that ffmpeg was borking somehow, since it has been difficult to get working in the past. However I'm not sure how ffmpeg could've stopped working, since the bot never went down between working and not working. That leads me to believe it could be a change on Youtube/Discord's side ?


For context, here is a snippet of my
!play
code :

@client.command(pass_context = True)
async def play(ctx):
 url = ctx.message.content.split("!play ",1)[1]
 voice = discord.utils.get(client.voice_clients)
 if (ctx.author.voice):
 if voice == None:
 channel = ctx.message.author.voice.channel
 voice = await channel.connect()

 # Youtube Magic
 ydl_opts = {
 'format': 'worstaudio/worst',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }

 if "http" not in url:
 yt = YoutubeSearch(url, max_results=1).to_json()
 print(yt)
 yt_id = str(json.loads(yt)['videos'][0]['id'])
 yt_channel = str(json.loads(yt)['videos'][0]['channel']).strip().replace(" ", "")
 url = 'https://www.youtube.com/watch?v='+yt_id+"&ab_channel="+yt_channel

 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 song_info=ydl.extract_info(url, download=False)
 for file in os.listdir("./"):
 if file.endswith(".mp3"):
 os.rename(file, "song.mp3")

 voice.stop()

 embed_trk = discord.Embed(
 title="Now playing",
 color=ctx.author.color,
 )
 video_title = song_info.get('title', None)
 video_channel = song_info.get('uploader', None)
 embed_trk.add_field(name="Track title", value=video_title, inline=False)
 embed_trk.add_field(name="Channel", value=video_channel, inline=False)

 await ctx.send(embed=embed_trk)
 player = await YTDLSource.from_url(url, loop=client.loop, stream=True)
 voice.play(player, after=lambda e: print(f'Player error: {e}') if e else None)
 while voice.is_playing():
 await asyncio.sleep(1)
 
 await request_record(ctx, video_title)

 else:
 await ctx.send("You must be in a voice channel to run this command")



-
FFmpeg streaming to youtube very slowly
3 avril 2022, par codingmaster398Input :


const runCommand = require('./runCommand')

runCommand(
 'ffmpeg',
 `-threads:v 2 -threads:a 8 -filter_threads 2 -thread_queue_size 512 \
-loop 1 -i ./place.png \
-stream_loop -1 \
-i ./track.mp3 \
-pix_fmt yuv420p -c:v libx264 -qp:v 19 -profile:v high -rc:v cbr_ld_hq -level:v 4.2 -r:v 60 -g:v 120 -bf:v 3 -refs:v 16 -preset fast -f flv rtmp://a.rtmp.youtube.com/live2/${process.env.streamkey}`,
 (data) => console.log(data),
 () => console.log('finished')
 )



Output :


x 
frame= 588 fps=8.7 q=21.0 size= 9000kB time=00:00:22.76 bitrate=3238.2kbits/s speed=0.339x 
frame= 590 fps=8.7 q=19.0 size= 9001kB time=00:00:22.83 bitrate=3229.4kbits/s speed=0.336x 
frame= 597 fps=8.7 q=21.0 size= 9007kB time=00:00:23.11 bitrate=3191.5kbits/s speed=0.337x 
frame= 603 fps=8.7 q=20.0 size= 9012kB time=00:00:23.36 bitrate=3159.3kbits/s speed=0.338x 
frame= 608 fps=8.7 q=21.0 size= 9016kB time=00:00:23.56 bitrate=3133.9kbits/s speed=0.339x 
frame= 614 fps=8.8 q=19.0 size= 9021kB time=00:00:23.80 bitrate=3104.9kbits/s speed=0.339x 
frame= 617 fps=8.7 q=21.0 size= 10702kB time=00:00:23.92 bitrate=3663.8kbits/s speed=0.337x 
frame= 623 fps=8.7 q=20.0 size= 10735kB time=00:00:24.16 bitrate=3638.9kbits/s speed=0.338x 
frame= 629 fps=8.7 q=21.0 size= 10740kB time=00:00:24.40 bitrate=3605.8kbits/s speed=0.338x 
frame= 635 fps=8.7 q=20.0 size= 10745kB time=00:00:24.63 bitrate=3573.1kbits/s speed=0.339x 
frame= 643 fps=8.8 q=20.0 size= 10751kB time=00:00:24.96 bitrate=3527.4kbits/s speed=0.341x 
frame= 646 fps=8.8 q=19.0 size= 10754kB time=00:00:25.08 bitrate=3512.1kbits/s speed=0.341x 
frame= 651 fps=8.8 q=20.0 size= 10758kB time=00:00:25.28 bitrate=3485.6kbits/s speed=0.341x 
frame= 656 fps=8.8 q=21.0 size= 10762kB time=00:00:25.48 bitrate=3459.6kbits/s speed=0.341x 
frame= 658 fps=8.7 q=19.0 size= 10764kB time=00:00:25.56 bitrate=3448.7kbits/s speed=0.338x 
frame= 664 fps=8.7 q=21.0 size= 10769kB time=00:00:25.81 bitrate=3417.9kbits/s speed=0.338x



Why is my FPS so low when streaming to Youtube ?


P.S. The process is using very low memory and CPU, can I sacrifice a bit more for it ?



-
How to use ffmpeg on Android, Kivy, python3, youtube-dl
7 avril 2022, par Adarsh SinghI am trying to create an app using Kivy 1.11.1 using youtube-dl module in python3. I am using buildozer to create apk from python source code which usage python-for-android to create apk. I have mentioned ffmpeg in buildozer requirements. I can see ffmpeg in pythonforandroid/recipes/.
After installing form apk, when I try to print ffmpeg version using the following


merger = youtube_dl.postprocessor.FFmpegMergerPP()
merger._determine_executables()
print(merger.get_versions())



I get this output


{'avprobe': False, 'avconv': False, 'ffmpeg': False, 'ffprobe': False}



which indicate that ffmpeg in not installed in android


this line is included in my buildozer.spec


requirements = python3,kivy,ffmpeg,youtube_dl,kivymd,kivmob,ffpyplayer,ffpyplayer_codecs,ffmpeg-python



except ffmpeg rest all package are installed properly


I am not sure whether this is useful but I saw this in pythonforandroid/recipes/ffmpeg/init.py


def build_arch(self, arch):
 with current_directory(self.get_build_dir(arch.arch)):
 env = arch.get_env()

 flags = ['--disable-everything']



**Goal : ** I want to use ffmpeg in youtube_dl via python3 after installing application from apk created by buildozer.