Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (107)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Ajout d’utilisateurs manuellement par un administrateur

    12 avril 2011, par

    L’administrateur d’un canal peut à tout moment ajouter un ou plusieurs autres utilisateurs depuis l’espace de configuration du site en choisissant le sous-menu "Gestion des utilisateurs".
    Sur cette page il est possible de :
    1. décider de l’inscription des utilisateurs via deux options : Accepter l’inscription de visiteurs du site public Refuser l’inscription des visiteurs
    2. d’ajouter ou modifier/supprimer un utilisateur
    Dans le second formulaire présent un administrateur peut ajouter, (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (13980)

  • How to convert multiple files with ffmpeg to GIFs [closed]

    26 juillet 2020, par mriisa

    I found in this forum Convert-mp4-to-gif at good batch-code for converting videos to GIF-files by just dragging and dropping the files onto the batch files. The problem is I can only drop one file at the time, whereas I have maybe hundres of files, which I just want my computer to work on.

    



    The code is as seen here :

    



    @echo off
::** create animated GIF w/ optimized palette
::
:: https://ffmpeg.org/ffmpeg-all.html#gif-2
:: http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
:: http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality

if not exist "%~dpnx1" goto :EOF
cd "%~dp1" 

::** generate palette
@echo on
@echo.
"c:\program files\ffmpeg\bin\ffmpeg.exe" ^
 -v warning -i "%~nx1" ^
 -vf "palettegen" ^
 -y tmp-palette.png

::** generate GIF
@echo.
"c:\program files\ffmpeg\bin\ffmpeg.exe" ^
 -v warning -i "%~nx1" ^
 -i tmp-palette.png ^
 -lavfi "[0][1:v] paletteuse" ^
 "%~n1.gif"
@echo off

del /q tmp-palette.png

if errorlevel 1 pause
goto :eof


    



    I have absolutely no idea how to program batch files, and this code was just something I found online which worked for me. Can anybody help me adding the needed code for making me able to drag and drop multiple files ?

    


  • Joining realtime raw PCM streams with ffmpeg and streaming them back out

    15 avril 2024, par Nathan Ladwig

    I am trying to use ffmpeg to join two PCM streams. I have it sorta kinda working but it's not working great.

    


    I am using Python to receive two streams from two computers running Scream Audio Driver ( ttps ://github.com/duncanthrax/scream )

    


    I am taking them in over UDP and writing them to pipes. The pipes are being received by ffmpeg and mixed, it's writing the mixed stream to another pipe. I'm reading that back in Python and sending it to the target receiver.

    


    My ffmpeg command is

    


    ['ffmpeg', 
'-use_wallclock_as_timestamps', 'true', '-f', 's24le', '-ac', '2', '-ar', '48000', '-i', '/tmp/ffmpeg-fifo-1',
'-use_wallclock_as_timestamps', 'true', '-f', 's24le', '-ac', '2', '-ar', '48000', '-i', '/tmp/ffmpeg-fifo-2',
'-filter_complex', '[0]aresample=async=1[a0],[1]aresample=async=1[a1],[a0][a1]amix', '-y',
'-f', 's24le', '-ac', '2', '-ar', '48000', '/tmp/ffmpeg-fifo-in']


    


    My main issue is that it should be reading ffmpeg-fifo-1 and ffmpeg-fifo-2 asynchronously, but it appears to be not. When the buffers get more than 50 frames out of sync with each other ffmpeg hangs and doesn't recover. I would like to fix this.

    


    In this hacky test code the number of frames sent over each stream are counted and empty frames are sent if the count hits 12. This keeps ffmpeg happy.

    


    The code below takes in two 48KHz 24-bit stereo PCM streams with Scream's header, mixes them, applies the same header, and sends them back out.

    


    It works most of the time. Sometimes I'm getting blasted with static, I think this is when only one or two bytes of a frame are making it to ffmpeg, and it loses track.

    


    The header is always 1152 bytes of pcm data with a 5 byte header. It's described in the Scream repo readme

    


    This is my header :

    


    01 18 02 03 00

    


    01 - 48KHz
18 - Sampling Rate (18h=24d, 24bit)
02 - 2 channels
03 00 - WAVEFORMATEXTENSIBLE

    


    import socket
import struct
import threading
import os
import sys
import time
import subprocess
import tempfile
import select

class Sender(threading.Thread):
    def __init__(self):
        super().__init__()
        TEMPDIR = tempfile.gettempdir() + "/"
        self.fifoin = TEMPDIR + "ffmpeg-fifo-in"
        self.start()

    def run(self):
        self.fd = open(self.fifoin, "rb")
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        while True:
            try:
                header = bytes([0x01, 0x18, 0x02, 0x03, 0x00])  # 48khz, 24-bit, stereo
                data = self.fd.read(1152)
                sendbuf = header + data
                self.sock.sendto(sendbuf, ("192.168.3.199", 4010))  # Audio sink
            except Exception as e:
                print("Except")
                print(e)

class Receiver(threading.Thread):
    def __init__(self):
        super().__init__()
        TEMPDIR = tempfile.gettempdir() + "/"
        self.fifo1 = TEMPDIR + "ffmpeg-fifo-1"
        self.fifo2 = TEMPDIR + "ffmpeg-fifo-2"
        self.fifoin = TEMPDIR + "ffmpeg-fifo-in"
        self.fifos = [self.fifo1, self.fifo2]
        try:
            try:
                os.remove(self.fifoin)
            except:
                pass
            os.mkfifo(self.fifoin)
        except:
            pass
        self.start()
        sender=Sender()

    def run(self):
        ffmpeg_command=['ffmpeg', '-use_wallclock_as_timestamps', 'true', '-f', 's24le', '-ac', '2', '-ar', '48000', '-i', self.fifo1,
                                  '-use_wallclock_as_timestamps', 'true', '-f', 's24le', '-ac', '2', '-ar', '48000', '-i', self.fifo2,
                                  '-filter_complex', '[0]aresample=async=1[a0],[1]aresample=async=1[a1],[a0][a1]amix', "-y", '-f', 's24le', '-ac', '2', '-ar', '48000', self.fifoin]
        print(ffmpeg_command)

        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        sock.setsockopt(socket.SOL_SOCKET,socket.SO_RCVBUF,4096)
        sock.bind(("", 16401))

        recvbuf = bytearray(1157)
        framecount = [0,0]
        closed = 1
        while True:
            ready = select.select([sock], [], [], .2)
            if ready[0]:
                recvbuf, addr = sock.recvfrom(1157)
                if closed == 1:
                    for fifo in self.fifos:
                        try:
                            try:
                                os.remove(fifo)
                            except:
                                pass
                            os.mkfifo(fifo)
                        except:
                            pass
                    framecount = [0,0]
                    print("data, starting ffmpeg")
                    ffmpeg = subprocess.Popen (ffmpeg_command, shell=False, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
                    fifo1_fd = os.open(self.fifo1, os.O_RDWR)
                    fifo1_file = os.fdopen(fifo1_fd, 'wb', 0)
                    fifo2_fd = os.open(self.fifo2, os.O_RDWR)
                    fifo2_file = os.fdopen(fifo2_fd, 'wb', 0)
                    closed = 0
                    for i in range(0,6):
                        fifo1_file.write(bytes([0]*1157))
                        fifo2_file.write(bytes([0]*1157))

                if addr[0] == "192.168.3.199":
                    fifo1_file.write(recvbuf[5:])
                    framecount[0] = framecount[0] + 1

                if addr[0] == "192.168.3.119":
                    fifo2_file.write(recvbuf[5:])
                    framecount[1] = framecount[1] + 1

                # Keep buffers roughly in sync while playing
                targetframes=max(framecount)
                if targetframes - framecount[0] > 11:
                    while (targetframes - framecount[0]) > 0:
                        fifo1_file.write(bytes([0]*1157))
                        framecount[0] = framecount[0] + 1

                if targetframes - framecount[1] > 11:
                    while (targetframes - framecount[1]) > 0:
                        fifo2_file.write(bytes([0]*1157))
                        framecount[1] = framecount[1] + 1
            else:
                if closed == 0:
                    ffmpeg.kill()
                    print("No data, killing ffmpeg")
                    fifo1_file.close()
                    fifo2_file.close()
                    closed = 1
receiver=Receiver()

while True:
    time.sleep(50000)


    


    Does anybody have any pointers on how I can make this better ?

    


  • Comment pourrions-nous améliorer le site piwik.org ? Retours, suggestions Feedback

    11 novembre 2011, par Piwik team — Communauté

    Bien que nous estimions que le site piwik.org remplit correctement son rôle, nous avons conscience qu’il peut être amélioré. Nous espérons de la sorte mieux servir la communauté Piwik.

    Dans un premier temps, nous avons l’intention de travailler sur une refonte du site piwik.org , qui contient les différentes documentations, des FAQs, le compteur de téléchargements, Participé au projet, et beaucoup d’autres pages.

    Quelles sont vos suggestions relatives à la refonte du site web ? Quelle apparence, impression doit-il avoir, etc.

    Veuillez nous présenter vos meilleures suggestions / vos retours constructifs, soit dans un commentaire posté sur notre blog, soit sur la page fan de Facebook, ou tout autre moyen dont vous disposeriez pour nous contacter. Merci à tous de nous faire profiter de vos suggestions !

    Bonne vie & analyses,
    L’équipe Piwik