Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (60)

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

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (7754)

  • ffmpeg doesn't work, when starting up it doesn't play music, it gives errors

    14 août 2024, par Оля Михеева
    import discord
from discord import FFmpegPCMAudio
import os
import random
from gtts import gTTS
import asyncio

TOKEN="***"
VOICE_CHANNEL_ID=11122224444

class Voice_Bot(discord.Client):
    def __init__(self):
        intents = discord.Intents.default()
        intents.message_content = True
        intents.voice_states=True
        super().__init__(intents=intents)
        print(os.getcwd())
        self.sounds_hello = os.listdir(os.path.join('sounds','hello'))
        self.sounds_bye = os.listdir('sounds\\bye')
        self.sounds = os.listdir('sounds\\nature')

    async def on_ready(self):        
        self.voice_channel = self.get_channel(VOICE_CHANNEL_ID) 
        if self.voice_channel == None:
            print('Не удалось подключиться к голосовому каналу.')
            return
        self.voice_client = await self.voice_channel.connect()
        print('Бот подключен к голосовому каналу')
        await self.text_to_speech("Lets play Guess the Tune")
        
    async def on_message(self,message):
        if message.author==self.user:
            return
        if message.content.startswith("game"):
            await self.text_to_speech("let's start the game guess the melody")
            music=os.listdir("sounds\\music")
            self.melody=random.choice(music)
            await self.play_sound(f"sounds\\music\\{self.melody}")
        elif message.content==self.melody[0:len(self.melody)-4]:
            if (self.voice_client.is_playing()):
                self.voice_client.stop()
            await self.text_to_speech(f"Congratulations, {message.author.name} answered correctly! To continue, type game")
        else:
            if (self.voice_client.is_playing()):
                self.voice_client.stop()
            await self.text_to_speech(f"Unfortunately, {message.author.name} did not guess. To continue, write game")


    async def on_voice_state_update(self,member,before,after):
        if member.id ==self.user.id:
            print('Someone entered or left the voice channel.')
        else:
            try:
                if before.channel == None:
                    print(f'{member.name} entered the voice channel {after.channel}.')
                    await self.play_sound(f'sounds\\hello\\{random.choice(self.sounds_hello)}')
                elif after.channel == None:
                    print(f'{member.name} left the voice channel {before.channel}.')
                    await self.play_sound(f'sounds\\bye\\{random.choice(self.sounds_bye)}')
            except Exception as e:
                print(f"Error in on_voise_state_update: {e}")

    async def text_to_speech(self,text):
        try:
            tts = gTTS(text=text, lang ="en")
            tts.save("text.mp3")
        except Exception as e:
            print(f"Error e: {e}")
        await self.voice_channel.send(text)
        await self.play_sound("text.mp3")

    def play_sound(self,path):
        print(path)
        source=discord.FFmpegPCMAudio(source=path, executable="ffmpeg\\bin\\ffmpeg.exe")
        if (self.voice_client.is_playing()):
            self.voice_client.stop()
        self.voice_client.play(source)                

client = Voice_Bot()
client.run(TOKEN)


    


    [enter image description here](https://i.sstatic.net/ys8Xza0w.jpg)

    


  • ffmpeg nvenc_h264 streaming uhd2160 rawvideo. Youtube buffering

    23 janvier 2019, par Alex Deroza

    I use this batch file for starting my stream :

    echo starting transocding from native uhd2160 to fhd format.. Host: YouTube
    ffmpeg ^
       -loglevel -8 ^
       -f rawvideo -s:v 1920x1080 -r 60 -pix_fmt nv12 ^
       -f dshow -i video="Game Capture 4K60 Pro Video 01":audio="Game Capture 4K60 Pro Audio 01" ^
       -c:v h264_nvenc ^
       -level:v 4.2 ^
       -profile:v high ^
       -preset:v hq ^
       -b:v 8.8M ^
       -color_range 2 ^
       -colorspace bt709 ^
       -bf 0 ^
       -g 60 ^
       -2pass 1 ^
       -rc:v cbr ^
       -coder cabac ^
       -acodec aac ^
       -ab 128k ^
       -movflags +faststart ^
       -f flv rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx && pause

    Stream on YouTube starts fine, and plays with good quality. But stream stops after when "Buffer Health" emptied. And in this situation Youtube says that "Video output low", "YouTube is not receiving enough video to maintain smooth streaming. As such, viewers will experience buffering."

    I can’t understand why it happens. Because I’ve a good ISP, and over 30 mbps inet to YT services within 90ms latency to them.

    YouTube is not receiving enough video to maintain smooth streaming. As
    such, viewers will experience buffering.

    Your encoder is sending data faster than realtime (multipleseconds of
    video each second). You must rate limit your livevideo upload to
    approximately 1 second of video each second.

    The stream’s current bitrate (5730.00 Kbps) is lower than the
    recommended bitrate. We recommend that you use a stream bitrate of
    4500 Kbps.

  • How to extract frames in sequence as PNG images from ffmpeg stream ?

    7 janvier, par JamesJGoodwin

    I'm trying to create a program that would capture my screen (a game to be precise) using ffmpeg and stream frames to NodeJS for live processing. So, if the game runs at 60 fps then I expect ffmpeg to send 60 images per second down to stdout. I've written a code for that

    


        import { spawn as spawnChildProcess } from 'child_process';

    const videoRecordingProcess = spawnChildProcess(
      ffmpegPath,
      [
        '-init_hw_device',
        'd3d11va',
        '-filter_complex',
        'ddagrab=0,hwdownload,format=bgra',
        '-c:v',
        'png',
        '-f',
        'image2pipe',
        '-loglevel',
        'error',
        '-hide_banner',
        'pipe:',
      ],
      {
        stdio: 'pipe',
      },
    );

    videoRecordingProcess.stderr.on('data', (data) => console.error(data.toString()));

    videoRecordingProcess.stdout.on('data', (data) => {
      fs.promises.writeFile(`/home/goodwin/genshin-repertoire-autoplay/imgs/${Date.now()}.bmp`, data);
    });


    


    Currently I'm streaming those images onto disk for debugging and it's almost working except that the image is cropped. Here's what's going on. I get 4 images saved on disk :

    


      

    1. Valid image that is 2560x1440, but only 1/4 or even 1/5 of the screen is present at the top, the remaining part of the image is empty (transparent)
    2. 


    3. Broken image that won't open
    4. 


    5. Broken image that won't open
    6. 


    7. Broken image that won't open
    8. 


    


    This pattern is nearly consistent. Sometimes it's 3, sometimes 4 or 5 images between valid images. What did I do wrong and how do I fix it ? My guess is that ffmpeg is streaming images in chunks, each chunk represents a part of the frame that was already processed by progressive scan. Though I'm not entirely sure if I should try and process it manually. There's gotta be a way to get fully rendered frames in one piece sequentially.