Recherche avancée

Médias (0)

Mot : - Tags -/alertes

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (32)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

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

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

Sur d’autres sites (6737)

  • Discord bot returns ffmpeg error despite being added to PATH

    22 février 2024, par Sam

    I am creating a Discord bot to play music via Youtube as practice with APIs. Every time I run the command to play a Youtube video I am met with "ffmpeg was not found". I have downloaded ffmpeg (as I'm on Windows) and moved the folder to my C : drive. Once done, I've added it to the path within environment variables. The error persists.

    


      

    • I've added ffmpeg to my PATH as described in this video.
    • 


    • Additionally, I've found forums where the suggested answer is to add ffmpeg to your PATH.
    • 


    


    In command prompt, if I type "ffmpeg" it returns "'FFmpeg' is not recognized as an internal or external command, operable program or batch file."

    


    Here is my code :

    


    from typing import Final
import os
from dotenv import load_dotenv
from discord import Intents, Client, Message
from responses import get_response
import asyncio
import yt_dlp
import discord

#Step 0: Load our token from somewhere safe
load_dotenv()
#Final decorator makes it so that this cannot be overwritten or have subclasses
TOKEN: Final[str] = os.getenv('DISCORD_TOKEN')


voice_clients = {}
#Settings for the video download.
yt_dl_opts = {'format': 'bestaudio/best'}
ytdl = yt_dlp.YoutubeDL(yt_dl_opts)

#Settings for ffmpeg. 
ffmpeg_options = {'options': '-vn'}

# Step 1: Bot Setup - activate intents
intents: Intents = Intents.default()
intents.message_content = True #NOQA
client: Client = Client(intents=intents)

#Step 2: Message Functionality
async def send_message(message: Message, user_message: str):
    if not user_message:
        print('Message was empty because intents were not enabled... probably')
        return
    
    # The := "Walrus Operator" is used to prompt for input.
    if is_private := user_message[0] == '?':
        user_message = user_message[1:]
    
    try:
        response: str = get_response(user_message)
        await message.author.send(response) if is_private else await message.channel.send(response)
    except Exception as e:
        print(e)

#Step 3: Handling the startup for our bot.
        
@client.event
async def on_ready() -> None:
    print(f"{client.user} is now running")

#Step 4: Handle incoming messages
@client.event
async def on_message(message: Message) -> None:
    if message.author == client.user:
        return
    
    username: str = str(message.author)
    user_message: str = message.content
    channel: str = str(message.channel)

    print(f"[{channel}] {username}: '{user_message}")
    await send_message(message, user_message)

    if message.content.startswith("!play"):
        try:
            url = message.content.split()[1]
            
            #Handles the voice connection that a bot has to a certain channel
            voice_client = await message.author.voice.channel.connect()
            voice_clients[voice_client.guild.id] = voice_client

            loop = asyncio.get_event_loop()
            data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=False))

            song = data['url']
            player = discord.FFmpegPCMAudio(song, **ffmpeg_options)

            voice_client.play(player)



        except Exception as err:
            print(err)

# Step 5: Main entry point
def main() -> None:
    client.run(token=TOKEN)

if __name__ == '__main__':
    main()```


    


  • Using ffmpeg to record screen returns corrupted file

    8 août 2020, par odddollar

    I'm using ffmpeg and python to record my desktop screen. I've got it working so that when I input a shortcut, it starts recording. Then I use .terminate() on the subprocess to stop recording. When outputting to an mp4, this corrupts the file and makes it unreadable. I can output the file as an flv or avi and it doesn't get corrupted, but then the video doesn't contain time/duration data, something I need.

    


    Is there a way I can gracefully stop the recording when outputting an mp4 ?
Or is there a way I can include the time/duration data in the flv/avi ?

    


    import keyboard
import os
from subprocess import Popen

class Main:
    def __init__(self):
        self.on = False

    def main(self):
        if not self.on:
            if os.path.isfile("output.mp4"):
                os.remove("output.mp4")

            self.process = Popen('ffmpeg -f gdigrab -framerate 30 -video_size 1920x1080 -i desktop -b:v 5M output.mp4')
            self.on = True
        else:
            self.process.terminate()

            self.on = False

run = Main()
keyboard.add_hotkey("ctrl+shift+g", lambda:run.main())

keyboard.wait()


    


  • libavfilter/x86/vf_convolution : add sobel filter optimization and unit test with...

    4 novembre 2022, par bwang30
    libavfilter/x86/vf_convolution : add sobel filter optimization and unit test with intel AVX512 VNNI
    

    This commit enabled assembly code with intel AVX512 VNNI and added unit test for sobel filter

    sobel_c : 4537
    sobel_avx512icl 2136

    Signed-off-by : bwang30 <bin.wang@intel.com>
    Signed-off-by : Haihao Xiang <haihao.xiang@intel.com>

    • [DH] libavfilter/convolution.h
    • [DH] libavfilter/vf_convolution.c
    • [DH] libavfilter/x86/vf_convolution.asm
    • [DH] libavfilter/x86/vf_convolution_init.c
    • [DH] tests/checkasm/Makefile
    • [DH] tests/checkasm/checkasm.c
    • [DH] tests/checkasm/checkasm.h
    • [DH] tests/checkasm/vf_convolution.c
    • [DH] tests/fate/checkasm.mak