Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (51)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • 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 ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (11112)

  • How does ffmpeg read stdin pipe ?

    17 novembre 2017, par ciclopez

    I’m working on a Python script that generates an image sequence based on user real time remote interaction, and uses ffmpeg to compress and stream this image sequence over the network for the user to watch it.
    As soon as an image is generated the script writes it to ffmpeg’s stdin and this action is repeated inside a loop to form a video.

    I was wondering what happens when ffmpeg is busy processing the previous image when I write to stdin.

    • Does the .stdin.write() command block execution until ffmpeg finishes processing the previous image ? (Consequence of the pipe buffer filling up)
    • What’s the buffer size of subprocess.PIPE ?
    • Is it editable ?
    • Is it possible to overwrite this buffer if it’s full, instead of blocking execution ?
    • Does ffmpeg continually read it’s input in a parallel process and buffers it until it’s free to take care of it ?
    • If that’s the case, what’s the size of ffmpeg’s input buffer and how can I change it ?

    I’m asking this because I want to fully understand how the data travels between Python and ffmpeg to reduce the latency to its minimum.

    Here is the part of the code I’m using to start ffmpeg :

    cmd = ['ffmpeg',
       '-f', 'rawvideo',
       '-s', '%dx%d'%(width, height),
       '-pix_fmt', 'rgba',
       '-r', '%d'%fps,
       '-i', '-',
       '-an',
       '-vcodec', 'libx264',
       '-tune', 'zerolatency',
       '-preset', 'ultrafast',
       '-bf', '0',
       '-f', 'mpegts',
       'udp://xxx.xxx.xxx.xxx:xxxxx']

    proc = subprocess.Popen(cmd, stdin=subprocess.PIPE)

    And this is what I call inside a loop when I want to pass an image to ffmpeg :

    proc.stdin.write(image)
  • make fifo pipe in java(windows), write some data into it, let other process read the pipe

    9 novembre 2017, par vs93

    My objective is to create a named pipe(fifo) in windows(java), write some data(coming from camera) into that and invoke ffmpeg command to make mp4 from that data. But I suspect that it is not opening a fifo pipe, rather it is opening a file. How can I make it open a fifo pipe ?
    Here is the code :

    public void run () {
    String mp4Folder = "C://Users/user_2/Desktop/streamDestination";            // Where the MP4 is to be kept
    VFrame frame = null;
    int actualPipeValLen = 0;
    FileOutputStream requestStream = null;
    long lastProcessedTS = 0;
    final String FIFOPATH = "D://FIFO//";
    final String PIPE_NAME = FIFOPATH + "myfifo";
    final String MKFIFOCOMMAND = "mkfifo -m=rw " + PIPE_NAME;
    final String DELFIFOCOMMAND = "rm -r " + PIPE_NAME;
    String mp4FileName = mp4Folder + File.separator + "1.mp4";
    mp4FileName = mp4FileName.replace("\\", "/");
    long firstTimeStamp = 0;
    try {
       Runtime.getRuntime().exec(MKFIFOCOMMAND);
    } catch (IOException e1) {
       e1.printStackTrace();
    }
    if(firstTimeStamp == 0) {
       firstTimeStamp = frame.getTimestamp();
    }
    if((frame.getTimestamp() - firstTimeStamp) > (15 * 1000)) {
       if(requestStream != null) {
           requestStream.close();
           requestStream = null;
       }
       if(actualPipeValLen > 0) {
           String[] ffmpeg = new String[] {"ffmpeg", "-i", PIPE_NAME , "-vcodec", "copy", mp4FileName };
           Process ffmpegProcess = Runtime.getRuntime().exec(ffmpeg);
           actualPipeValLen = 0;
           firstTimeStamp = lastProcessedTS;
           Thread.sleep(2 * 1000);
           try {
               Runtime.getRuntime().exec(DELFIFOCOMMAND);
           } catch (IOException e1) {
               e1.printStackTrace();
           }
           System.exit(0);
       }
    } else {
       System.out.println("Writing into pipe : " + actualPipeValLen);
       if(requestStream == null) {
           requestStream = new  FileOutputStream(PIPE_NAME);
       }
       requestStream.write(frame.getFrame());
       actualPipeValLen += frame.getFrame().length;
       lastProcessedTS = frame.getTimestamp();
    }

    }

  • Python creating two PIPE's

    1er novembre 2017, par Rockybilly

    I am accessing an executable file through subprocess, The exe, takes two file inputs like so,

    foo.exe file1.txt file2.txt

    It also accepts pipe’s as inputs, so I give one of the files to the exe through a subprocess.PIPE, which works fine(can test it with a single file), however, because each process has a single stdin, I cannot supply the second file. I could pipe one input, then write, read the other, however both of the input files are generated inside the Python program, I don’t want to decrease the speed of the code by writing to hard disk, rather use some other method to pipe the second file, which is on RAM. How can I achieve this ?

    I am on Windows 10, with Python 3 (if the solution is system dependant).