Recherche avancée

Médias (91)

Autres articles (76)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (7562)

  • Ffmpeg output stream closed

    29 novembre 2023, par excalibur

    There is one problem in my code that uses ffmpeg to convert webm videos to mp4 and set duration to 10 seconds, it works well but, sometimes returns "output Stream closed" error. What can be a reason of this problem, and how can i solve it ?

    


    My code :

    


    async convertWebmVideoToMp4(buffer: any) {
    try {
        return new Promise((resolve, reject) => {
            const videoMp4Buffer = Buffer.from(buffer);

            const readable = Readable.from(videoMp4Buffer);

            const outputBuffer = [];

            const outputStream = new Writable({
                write(chunk, encoding, callback) {
                    outputBuffer.push(chunk);
                    callback();
                },
            });

            const ffmpegProcess = ffmpeg()
                .input(readable)
                .outputFormat('mp4')
                .videoCodec('libx264')
                .audioCodec('aac')
                .duration(10)
                .outputOptions([
                    '-movflags frag_keyframe+empty_moov',
                    '-preset ultrafast',
                    '-c:a aac',
                    '-r 30',
                    '-tune fastdecode',
                ])
                .on('end', () => {
                    outputStream.end();
                    const finalOutputBuffer = Buffer.concat(outputBuffer);
                    resolve(finalOutputBuffer);
                })
                .on('error', (err, stdout, stderr) => {
                    console.error(err);
                    reject(err);
                });

            outputStream.on('error', err => {
                this.logger.error(err);
            });

            ffmpegProcess.pipe(outputStream, { end: true });
        });
    } catch (error) {
        throw error;
    }
}


    


    My code should return the buffer of video that type is mp4 and length is 10 seconds, but it returns "output stream closed" error.

    


  • How to stop perl buffering ffmpeg output

    4 février 2017, par Sebastian King

    I am trying to have a Perl program process the output of an ffmpeg encode, however my test program only seems to receive the output of ffmpeg in periodic chunks, thus I am assuming there is some sort of buffering going on. How can I make it process it in real-time ?

    My test program (the tr command is there because I thought maybe ffmpeg’s carriage returns were causing perl to see one big long line or something) :

    #!/usr/bin/perl

    $i = "test.mkv"; # big file, long encode time
    $o = "test.mp4";

    open(F, "-|", "ffmpeg -y -i '$i' '$o' 2>&1 | tr '\r' '\n'")
           or die "oh no";

    while(<f>) {
           print "A12345: $_"; # some random text so i know the output was processed in perl
    }
    </f>

    Everything works fine when I replace the ffmpeg command with this script :

    #!/bin/bash

    echo "hello";

    for i in `seq 1 10`; do
           sleep 1;
           echo "hello $i";
    done

    echo "bye";

    When using the above script I see the output each second as it happens. With ffmpeg it is some 5-10 seconds or so until it outputs and will output sometimes 100 lines each output.

    I have tried using the program unbuffer ahead of ffmpeg in the command call but it seems to have no effect. Is it perhaps the 2>&amp;1 that might be buffering ?
    Any help is much appreciated.

    If you are unfamiliar with ffmpeg’s output, it outputs a bunch of file information and stuff to STDOUT and then during encoding it outputs lines like

    frame=  332 fps= 93 q=28.0 size=     528kB time=00:00:13.33 bitrate= 324.2kbits/s speed=3.75x

    which begin with carriage returns instead of new lines (hence tr) on STDERR (hence 2>&amp;1).

  • Capturing network video using opencv

    3 septembre 2014, par Subhendu Sinha Chaudhuri

    I am using ffserver and ffmpeg combination to capture web camera video and transmit it through my network.

    I want to capture this video using opencv and python from another computer.
    I can see the video (cam1.asf) in the browser of another computer. But my opencv + python code could not capture any frame.

    Code for ffserver

    HTTPPort 8090
    HTTPBindAddress 0.0.0.0
    MaxHTTPConnections 2000
    MaxClients 1000
    MaxBandWidth 2000

    <feed>
      File ./tmp/feed1.ffm
      FileMaxSize 1G
      ACL allow 127.0.0.1
    </feed>

    <stream>
     Feed feed1.ffm
     Format asf
     VideoCodec msmpeg4v2
     VideoFrameRate 30
     VideoSize vga
    </stream>

    FFmpeg

    $ffmpeg -f video4linux2 -i /dev/video0 192.168.1.3 /cam1.ffm

    This stream can be seen in the browser

    But with opencv code

    import sys
    import cv2.cv as cv
    import numpy

    video="http://http://192.168.1.3:8090/cam1.asf"
    capture =cv.CaptureFromFile(video)
    cv.NamedWindow('Video Stream', 1 )
    while True:
     # capture the current frame
     frame = cv.QueryFrame(capture)
     #if frame is None:
      # break
     #else:
       #detect(frame)
     cv.ShowImage('Video Stream', frame)
     if cv.WaitKey(10) == 27:
       print 'ESC pressed. Exiting ...'
       break

    I donot get any output in the stream

    My aim is to work with the web camera video both at the base station (ie where the web camera is connected) and also at the network location