Recherche avancée

Médias (91)

Autres articles (65)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (10441)

  • QML multimedia cannot play m3u8 that is generated with ffmpeg

    5 juin 2023, par LeXela-ED

    With the following command, I am trying to stream an IP camera over web :

    


    ffmpeg -re -i "rtsp://<user>:<password>@<ip>:<port>" -c:v copy -c:a copy -hls_segment_type mpegts -hls_list_size 5 -hls_wrap 5 -hls_time 2 -hls_flags split_by_time -segment_time_delta 1.00 -reset_timestamps 1 -hls_allow_cache 0 -movflags faststart live.m3u8```&#xA;</port></ip></password></user>

    &#xA;

    This command, produces live.m3u8 and five ts files : live0.ts, live1.ts, live2.ts, live3.ts, and live4. And conversion goes smoothly. At some random point, the content of live.m3u8 is as follows :

    &#xA;

    #EXTM3U&#xA;#EXT-X-VERSION:3&#xA;#EXT-X-TARGETDURATION:2&#xA;#EXT-X-MEDIA-SEQUENCE:92&#xA;#EXTINF:2.000000,&#xA;live2.ts&#xA;#EXTINF:2.000000,&#xA;live3.ts&#xA;#EXTINF:2.035800,&#xA;live4.ts&#xA;#EXTINF:2.000000,&#xA;live0.ts&#xA;#EXTINF:1.963278,&#xA;live1.ts&#xA;

    &#xA;

    However, when I tried to play live.m3u8 with the following QML code, it only played a very first segments of it :

    &#xA;

    import QtQuick 2.15&#xA;import QtQuick.Window 2.15&#xA;import QtQuick.Controls 2.15&#xA;import QtQuick.Layouts 1.15&#xA;import QtMultimedia 5.15&#xA;&#xA;Window&#xA;{&#xA;    width: 640&#xA;    height: 480&#xA;    visible: true&#xA;&#xA;    Item&#xA;    {&#xA;        anchors.fill: parent&#xA;&#xA;        MediaPlayer&#xA;        {&#xA;            id: mediaplayer&#xA;            source: "path-to-live/live.m3u8"&#xA;            videoOutput: videoOutput&#xA;        }&#xA;&#xA;        VideoOutput&#xA;        {&#xA;            id: videoOutput&#xA;            anchors.fill: parent&#xA;        }&#xA;&#xA;        MouseArea&#xA;        {&#xA;            anchors.fill: parent&#xA;            onPressed: mediaplayer.play();&#xA;        }&#xA;    }&#xA;}&#xA;&#xA;

    &#xA;

    The interesting thing is : I manually deleted live.m3u8, and obviously, ffmpeg generated another one after ! Then I clicked on the QML program window, and surprisingly, it played the stream nonstop as it was expected at the first run !

    &#xA;

    What is the problem here ? What I am missing ? Should I change the ffmpeg command or do something with my qml code ? Any idea or help ?

    &#xA;

    Thank you in advance.

    &#xA;

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

    14 août 2024, par Оля Михеева
    import discord&#xA;from discord import FFmpegPCMAudio&#xA;import os&#xA;import random&#xA;from gtts import gTTS&#xA;import asyncio&#xA;&#xA;TOKEN="***"&#xA;VOICE_CHANNEL_ID=11122224444&#xA;&#xA;class Voice_Bot(discord.Client):&#xA;    def __init__(self):&#xA;        intents = discord.Intents.default()&#xA;        intents.message_content = True&#xA;        intents.voice_states=True&#xA;        super().__init__(intents=intents)&#xA;        print(os.getcwd())&#xA;        self.sounds_hello = os.listdir(os.path.join(&#x27;sounds&#x27;,&#x27;hello&#x27;))&#xA;        self.sounds_bye = os.listdir(&#x27;sounds\\bye&#x27;)&#xA;        self.sounds = os.listdir(&#x27;sounds\\nature&#x27;)&#xA;&#xA;    async def on_ready(self):        &#xA;        self.voice_channel = self.get_channel(VOICE_CHANNEL_ID) &#xA;        if self.voice_channel == None:&#xA;            print(&#x27;Не удалось подключиться к голосовому каналу.&#x27;)&#xA;            return&#xA;        self.voice_client = await self.voice_channel.connect()&#xA;        print(&#x27;Бот подключен к голосовому каналу&#x27;)&#xA;        await self.text_to_speech("Lets play Guess the Tune")&#xA;        &#xA;    async def on_message(self,message):&#xA;        if message.author==self.user:&#xA;            return&#xA;        if message.content.startswith("game"):&#xA;            await self.text_to_speech("let&#x27;s start the game guess the melody")&#xA;            music=os.listdir("sounds\\music")&#xA;            self.melody=random.choice(music)&#xA;            await self.play_sound(f"sounds\\music\\{self.melody}")&#xA;        elif message.content==self.melody[0:len(self.melody)-4]:&#xA;            if (self.voice_client.is_playing()):&#xA;                self.voice_client.stop()&#xA;            await self.text_to_speech(f"Congratulations, {message.author.name} answered correctly! To continue, type game")&#xA;        else:&#xA;            if (self.voice_client.is_playing()):&#xA;                self.voice_client.stop()&#xA;            await self.text_to_speech(f"Unfortunately, {message.author.name} did not guess. To continue, write game")&#xA;&#xA;&#xA;    async def on_voice_state_update(self,member,before,after):&#xA;        if member.id ==self.user.id:&#xA;            print(&#x27;Someone entered or left the voice channel.&#x27;)&#xA;        else:&#xA;            try:&#xA;                if before.channel == None:&#xA;                    print(f&#x27;{member.name} entered the voice channel {after.channel}.&#x27;)&#xA;                    await self.play_sound(f&#x27;sounds\\hello\\{random.choice(self.sounds_hello)}&#x27;)&#xA;                elif after.channel == None:&#xA;                    print(f&#x27;{member.name} left the voice channel {before.channel}.&#x27;)&#xA;                    await self.play_sound(f&#x27;sounds\\bye\\{random.choice(self.sounds_bye)}&#x27;)&#xA;            except Exception as e:&#xA;                print(f"Error in on_voise_state_update: {e}")&#xA;&#xA;    async def text_to_speech(self,text):&#xA;        try:&#xA;            tts = gTTS(text=text, lang ="en")&#xA;            tts.save("text.mp3")&#xA;        except Exception as e:&#xA;            print(f"Error e: {e}")&#xA;        await self.voice_channel.send(text)&#xA;        await self.play_sound("text.mp3")&#xA;&#xA;    def play_sound(self,path):&#xA;        print(path)&#xA;        source=discord.FFmpegPCMAudio(source=path, executable="ffmpeg\\bin\\ffmpeg.exe")&#xA;        if (self.voice_client.is_playing()):&#xA;            self.voice_client.stop()&#xA;        self.voice_client.play(source)                &#xA;&#xA;client = Voice_Bot()&#xA;client.run(TOKEN)&#xA;

    &#xA;

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

    &#xA;

  • Pygame : Frame ghosting ?

    31 décembre 2013, par Sam Tubb

    I am working on a animation environment in python using pygame. The user draw's each frame, and then using ffmpeg the animation is saved as an .avi movie. I would like to implement a feature, but am not sure how.. frame ghosting. Like display the previous frame while you draw the current.

    I tried creating a surface called ghost that copies the current frame when the next-frame key is pressed. Then draws it with an alpha level of 10, but this didn't work out correctly.

    I am not sure what to do, here is the source code for anyone that thinks they have an idea :

    #Anim8

    import pygame,subprocess,shutil
    from os import makedirs
    from pygame.locals import *
    from random import randrange
    pygame.init()
    screen=pygame.display.set_mode((740,580))
    draw=pygame.Surface((740,540))
    draw.fill((200,200,200))
    bcol=(200,200,200)
    gui=pygame.Surface((740,40))
    gui.fill((50,50,50))
    size=2
    color=(0,0,0)
    screen.fill((200,200,200))
    prevcol=0
    newcol=0
    f=0
    msg=&#39;&#39;
    framerate=60
    try:
       makedirs(&#39;anim&#39;)
    except:
       pass
    def DrawColors(x,y):
       pygame.draw.rect(gui, (255,0,0), (x+3,y+3,15,15),0)
       pygame.draw.rect(gui, (0,0,0), (x+3,y+21,15,15),0)
       pygame.draw.rect(gui, (0,255,0), (x+21,y+3,15,15),0)
       pygame.draw.rect(gui, (200,200,200), (x+21,y+21,15,15),0)
       pygame.draw.rect(gui, (0,0,255), (x+39,y+3,15,15),0)
    while True:
       pygame.display.set_caption(&#39;Anim8 - Sam Tubb - &#39;+&#39;Frame: &#39;+str(f)+&#39; &#39;+str(msg))
       mse=pygame.mouse.get_pos()
       screen.blit(gui, (0,0))
       DrawColors(0,0)
       screen.blit(draw,(0,40))
       key=pygame.key.get_pressed()
       if key[K_1]:
           framerate=10
           msg=&#39;Frame Rate set to 10&#39;
       if key[K_2]:
           framerate=20
           msg=&#39;Frame Rate set to 20&#39;
       if key[K_3]:
           framerate=30
           msg=&#39;Frame Rate set to 30&#39;
       if key[K_4]:
           framerate=40
           msg=&#39;Frame Rate set to 40&#39;
       if key[K_5]:
           framerate=50
           msg=&#39;Frame Rate set to 50&#39;
       if key[K_6]:
           framerate=60
           msg=&#39;Frame Rate set to 60&#39;
       if key[K_7]:
           framerate=70
           msg=&#39;Frame Rate set to 70&#39;
       if key[K_8]:
           framerate=80
           msg=&#39;Frame Rate set to 80&#39;
       if key[K_9]:
           framerate=90
           msg=&#39;Frame Rate set to 90&#39;
       if key[K_0]:
           framerate=100
           msg=&#39;Frame Rate set to 100&#39;

       if key[K_a]:
           pygame.image.save(draw, &#39;anim/frame&#39;+str(f)+&#39;.png&#39;)
           f+=1
       for e in pygame.event.get():
           if e.type==QUIT:
               shutil.rmtree(&#39;anim&#39;)
               exit()
           if e.type==KEYDOWN:
               if e.key==K_s:
                   msg=&#39;Added Frame!&#39;
                   pygame.image.save(draw, &#39;anim/frame&#39;+str(f)+&#39;.png&#39;)
                   f+=1
               if e.key==K_c:
                   draw.fill(bcol)
               if e.key==K_r:
                   name=&#39;anim&#39;+str(randrange(0,999))+str(randrange(0,999))+&#39;.avi&#39;
                   msg=&#39;Rendering: &#39;+name
                   pygame.display.set_caption(&#39;Anim8 - Sam Tubb - &#39;+&#39;Frame: &#39;+str(f)+&#39; &#39;+str(msg))
                   subprocess.call(&#39;ffmpeg -f image2 -s 640x480 -i anim/frame%01d.png -r &#39;+str(framerate)+&#39; &#39;+name,shell=True)
                   msg=&#39;Done!&#39;
               if e.key==K_p:
                   subprocess.call(&#39;ffplay &#39;+name,shell=True)
           if e.type==MOUSEBUTTONDOWN:
               if e.button==1:
                   try:
                       prevcol=color
                       newcol=gui.get_at(mse)
                       if newcol==(50,50,50):
                           newcol=prevcol
                       color=newcol
                   except:
                       pass
               if e.button==3:
                   try:
                       prevcol=bcol
                       newcol=gui.get_at(mse)
                       if newcol==(50,50,50):
                           newcol=prevcol
                       draw.fill(newcol)
                       bcol=newcol
                   except:
                       pass
               if e.button==4:
                   size+=1
                   if size>7:
                       size=7
               if e.button==5:
                   size-=1
                   if size==0:
                       size=1
           if e.type == pygame.MOUSEMOTION:
               lineEnd = pygame.mouse.get_pos()
               lineEnd = (lineEnd[0],lineEnd[1]-40)
               if pygame.mouse.get_pressed() == (1, 0, 0):
                       pygame.draw.line(draw, color, lineStart, lineEnd, size)
               lineStart = lineEnd

       pygame.display.flip()

    Oh, and on another note, just if anyone was curious, here is what the output looks like.. I made a little new year's animation :

    Animation Test