Recherche avancée

Médias (91)

Autres articles (74)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 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 2013

    Jolie 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 (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (11880)

  • Can't save a file in moviepy python

    23 juillet 2023, par user9102437

    I have seen a few questions about this here, but none of them solved the issue for me, so maybe my case is different in some way.

    


    I am trying to achieve a simple result : read a file and write it. Here is the code :

    


    import os
os.environ['FFMPEG_BINARY'] = '/usr/bin/ffmpeg'

from moviepy.editor import VideoFileClip
name = 'test.mp4'

clip = VideoFileClip('./vids/'+name)

clip.write_videofile('./vids/'+name, codec='libx264', fps=30)


    


    This code comes up with an error :

    


    ---> 88     '-r', '%.02f' % fps,
     89     '-an', '-i', '-'
     90 ]
     91 if audiofile is not None:
     92     cmd.extend([
     93         '-i', audiofile,
     94         '-acodec', 'copy'
     95     ])

TypeError: must be real number, not NoneType


    


    You may notice that I have set the environment variable for ffmpeg (I have also changed that in configure_defaults.py). This is because it was suggested in other questions. Also based on them I have run the following commands before running the code :

    


    sudo apt -y update
sudo apt -y install ffmpeg
pip install decorator
pip install moviepy --upgrade
pip install ffmpeg --upgrade


    


    I am using a Debian GNU/Linux 10 (buster) machine, and the versions of moviepy and ffmpeg are 1.0.3 and 4.1.10-0+deb10u1 respectively.

    


    Nothing seems to be helping to solve this. What am I missing here ?

    


  • How to make a bot to search song automatically on YouTube after input some words of the song ?

    30 juin 2021, par SOHAM DAS BISWAS.

    I had made a discord bot using python which plays YouTube songs. It takes the link to play a song I want to make it short. I want to give some words of the song and it will search automatically the song on YouTube and play it for me.

    


    My Code :-

    


    import discord,requests, sys, webbrowser, bs4
import youtube_dl
import os
from dotenv import load_dotenv
import ffmpeg
from discord.ext import *
from discord.ext import commands
from discord.ext.commands import Bot
from discord.voice_client import VoiceClient
import asyncio
@client.command(pass_context=True)                      #====================================Join
async def join(ctx):
    channel = ctx.author.voice.channel
    await channel.connect()
@client.command()                                         #===================================Play
async def play(ctx, url:str):
    song_there = os.path.isfile("song.mp3")
    try:
        if song_there:
            os.remove("song.mp3")
            player.clear()
    except PermissionError:
        await ctx.send("Wait for the current playing music end or use the 'stop' command...")
        return
    await ctx.send("Getting everything ready, playing audio soon, depends on your internet speed...")
    print("Someone wants to play music let me get that ready for them...")
    voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
    ydl_opts = {
        'format': 'bestaudio/best',
            'postprocessors': [{
            'key': 'FFmpegExtractAudio',
            'preferredcodec': 'mp3',
            'preferredquality': '192',
        }],
    }
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        ydl.download([url])
    for file in os.listdir("./"):
        if file.endswith(".mp3"):
            os.rename(file, 'song.mp3')
    voice.play(discord.FFmpegPCMAudio("song.mp3"))
    
    voice.volume = 100


    


    Please help me to solve this.

    


  • converting youtube audio into .mp3 with ffmpeg : ERROR : audio conversion failed : encoder : Lavc58.91.100 libmp3lame

    12 mars 2021, par letgomyleghoe

    I'm getting the error below when trying to play audio through my discord bot, I have all the dependencies installed and afaik ffmpeg is working.

    


    The bot has connected to General

Downloading audio now

[youtube] X9zaArvqZXM: Downloading webpage
[download] Destination: Wombo Combo _ Shotgun Willy ft. Lil Kapow _ Lyrics-X9zaArvqZXM.webm
[download] 100% of 2.87MiB in 00:00
[ffmpeg] Destination: Wombo Combo _ Shotgun Willy ft. Lil Kapow _ Lyrics-X9zaArvqZXM.mp3
ERROR: audio conversion failed:       encoder         : Lavc58.91.100 libmp3lame


    


    my ydl_opts are below

    


    ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '128',
    }],
}


    


    any help is appreciated, thanks