Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (44)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (7248)

  • How to make the discord bot queue local mp3 ?

    26 mars 2021, par jaos1

    I'm new to python, so I wonder if there's a way to do so.

    


    Here's my play mp3 command :

    


    @bot.command()
async def play_song1(ctx):
  global voice
  channel = ctx.message.author.voice.channel
  voice = get(bot.voice_clients, guild=ctx.guild)

  if voice and voice.is_connected():
    await voice.move_to(channel)
  else:
    voice = await channel.connect()
    voice.play(discord.FFmpegPCMAudio('./mp3/song1.mp3'))
    voice.source = discord.PCMVolumeTransformer(voice.source)
    voice.source.volume = 0.1
    await ctx.send ('playing')
    while voice.is_playing():
      await asyncio.sleep(.1)  
    await voice.disconnect()


    


    I made 2 more same commands but for song2 and song3, and now I want to queue the mp3 when someone calls them.

    


  • Creating a Discord Bot to play .mp3 files

    31 décembre 2020, par TheGr3atJosh

    My goal at the moment is to create a Discord Bot that can play .mp3 files for my private Discord Server. This is my code. The file test.mp3 is in the same folder as the .py file. The error message is : "NameError : name 'FFmpegPCMAudio' is not defined". I added the ffmpeg executable in my path environment variable. Can anyone help ?

    


    import discord
import asyncio
import time

client = discord.Client()

@client.event
async def on_message(message):
    if "test" in message.content:
        user = message.author
        voice_channel = user.voice.channel
        channel = None
        if voice_channel != None:
            channel = voice_channel.name
            vc = await voice_channel.connect()
            player = vc.play(FFmpegPCMAudio("test.mp3"), after=lambda: print('done'))
            player.start()
            while not player.is_done():
                await asyncio.sleep(1)
            player.stop()
            await vc.disconnect()

client.run(TOKEN)


    


  • How to read a UDP stream and forward it as SRT ?

    27 décembre 2020, par andrea-f

    During this holidays I started a small hobby project to learn how SRT works. I got a simple Android app set up with NodeMediaClient (https://github.com/NodeMedia/NodeMediaClient-Android/tree/master/nodemediaclient/src) which publishes an UDP stream, which I read by :

    


         private final Object txFrameLock = new Object();
     [...]

     t = new Thread(new Runnable() {
        public void run() {

            byte[] message = new byte[MAX_UDP_DATAGRAM_LEN];

            try {
                socket = new DatagramSocket(UDP_SERVER_PORT);
                while (!Thread.currentThread().isInterrupted()) {
                    while (!socket.isClosed()) {
                        DatagramPacket packet = new DatagramPacket(message, message.length);
                        socket.receive(packet);
                       
                        ByteBuffer tsUDPPack = ByteBuffer.wrap(packet.getData());
                        int ret = parseTSPack(tsUDPPack);
                        
                        Log.i("srtstreaming SRT packet sent", String.format("%d", ret));
                    }
                    synchronized (txFrameLock) {
                        try {
                            txFrameLock.wait(10);
                            //Thread.sleep(500);

                        } catch (InterruptedException ie) {
                            t.interrupt();
                        }
                    }
                }

            } catch (SocketException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (socket != null) {
                    socket.close();
                }
            }
        }
    });
    t.start();


    


    parseTSPack looks like :

    


        private int parseTSPack(ByteBuffer tsUDPPack)
    {
        byte[] ts_pack = new byte[TS_PACK_LEN];
        if (tsUDPPack.remaining() != TS_UDP_PACK_LEN) {
            Log.i(TAG, "srtestreaming ts udp len is not 1316.");
            return 0;
        }
        int count = 0;
        while (tsUDPPack.remaining() > 0) {
            tsUDPPack.get(ts_pack);
            int ret = mSrt.send(ts_pack);
            count++;
            Log.i("srtstreaming ts packets ", String.format("%d", count));
        }
        return count;
    }


    


    Then the JNI implementation takes care of opening the stream (srt://192.168.1.238:4200?streamid=test/live/1234) and then handling the mSrt.send(ts_pack) call to forward the packets to SRT caller.
On the receiving side I am using : ffmpeg -v 9 -loglevel 99 -report -re -i 'srt://192.168.1.238:4200?streamid=test/live/1234&mode=listener' -c copy -copyts -f mpegts ./srt_recording_ffmpeg.ts the video arrives broken and no frames can be decoded.
In FFMPEG output I am getting something along the lines :

    


    [mpegts @ 0x7f9a0f008200] Probe: 176, score: 1, dvhs_score: 1, fec_score: 1 
[mpegts @ 0x7f9a0f008200] Probe: 364, score: 2, dvhs_score: 1, fec_score: 1 
[mpegts @ 0x7f9a0f008200] Probe: 552, score: 3, dvhs_score: 1, fec_score: 1 
[mpegts @ 0x7f9a0f008200] Probe: 740, score: 3, dvhs_score: 1, fec_score: 1 
[mpegts @ 0x7f9a0f008200] Packet corrupt (stream = 1, dts = 980090).
[mpegts @ 0x7f9a0f008200] rfps: 7.583333 0.011807
[mpegts @ 0x7f9a0f008200] rfps: 8.250000 0.014541
[...]
[mpegts @ 0x7f9a10809000] Non-monotonous DTS in output stream 0:1; previous: 1193274, current: 1189094; changing to 1193275. This may result in incorrect timestamps in the output file.
[mpegts @ 0x7f9a10809000] Non-monotonous DTS in output stream 0:1; previous: 1199543, current: 1199543; changing to 1199544. This may result in incorrect timestamps in the output file.


    


    Any ideas how to correctly forward the udp packets to the SRT library ?