Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (83)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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 (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (11637)

  • typeError when using ffmpeg with buffer in NodeJS ["argument must be of type string or an instance of Buffer"]

    16 mars 2021, par coolps811

    I am trying to covert buffer data into the correct mp4 video format. However I am getting an error : "UnhandledPromiseRejectionWarning : TypeError [ERR_INVALID_ARG_TYPE] : The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of FfmpegCommand". How can I fix this ?

    


    router.post("/download", (req, res, next) => {
  axios({
    method: "get",
    url: req.body.url,
    responseType: "arraybuffer",
  }).then(function (response) {
    const data = new Uint8Array(Buffer.from(response.data));

    const proc = new ffmpeg(data)
      .videoCodec("libx264")
      .outputOptions(["-movflags isml+frag_keyframe"])
      .toFormat("mp4")
      //.seekInput(offset) this is a problem with piping
      .on("error", function (err, stdout, stderr) {
        console.log("an error happened: " + err.message);
        console.log("ffmpeg stdout: " + stdout);
        console.log("ffmpeg stderr: " + stderr);
      })
      .on("end", function () {
        console.log("Processing finished !");
      })
      .on("progress", function (progress) {
        console.log("Processing: " + progress.percent + "% done");
      });

    fs.writeFile("Assets/test.mp4", proc, callback);
  });

  const callback = (err) => {
    if (err) throw err;
    console.log("It's saved!");
  };
});


    


  • ffmpeg taking lot of data for ip cams streaming

    14 mars 2021, par JCH

    I have an ip cam which is connected to a cellular router.

    


    rtsp ://admin:admin1234@172.xxx.xx.xxx:82/cam/realmonitor ?channel=1&subtype=1

    


    This is the rtsp link of my ip cam. When i insert this link inside VLC it gives me sub stream one (one with the less quality). Now when i compare the output of vlc to my cameras substream 1 it looks the same. Thats what i want. But when i put this link inside ffmpeg it gives me a much better quality video and it does not look like my sub stream 1 from the camera, but im using the same link. Because of this the router that my ip cam is connected is consuming a lot of data. Any help is appreciated.

    


    ffmpeg code

    


    ffmpeg -rtsp_transport tcp -v verbose  -i rtsp://admin:admin1234@172.xxx.xx.xxx:82/cam/realmonitor?channel=1&subtype=1    -f hls    -hls_flags delete_segments    -hls_time 5  -segment_time 5 -hls_list_size 5 C:\Apache24\htdocs\ipcam\video_1\stream.m3u8


    


  • ffmpeg won't exit normally with SIGINT

    2 mars 2021, par ntstlkr

    I'm trying to record video with ffmpeg and all works fine when I call stopRecord() function inside timeout :

    


    frame=  147 fps= 18 q=-1.0 Lsize=     290kB time=00:00:09.91 bitrate= 239.8kbits/s speed=1.24x    
video:129kB audio:156kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
2.159774%
[aac @ 0x55e825dbdc40] 
Qavg: 241.892
Exiting normally, received signal 2.
SIGINT
Recording process exit, code: 255, signal: null
Recording stopped


    


    But ffmpeg process won't exit and stays alive when I call stopRecord() function on API request inside express router.

    


    // here I create child process and try to close it in timeout which works.
export async function startRecord(producers: any, router: any, folderName: string, fileName: string) {
const sdp = `v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio ${ports[0]} RTP/AVPF 111
a=rtcp:${ports[0] + 1}
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1
m=video ${ports[1]} RTP/AVPF 125
a=rtcp:${ports[1] + 1}
a=rtpmap:125 H264/90000
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f`;

const cmdArgStr = [
    "-protocol_whitelist pipe,rtp,udp",
    "-fflags +genpts",
    "-f sdp",
    "-i pipe:0",
    "-map 0:a:0 -c:a aac",
    "-map 0:v:0 -c:v copy",
    "-f mp4 -strict experimental",
    `-y recording/${folderName}/${fileName}.mp4`,
].join(" ").trim();

let process = spawn('ffmpeg', cmdArgStr.split(/\s+/));

process.stdin.write(sdp);
process.stdin.end();

process.on("error", (err: string) => {
    console.log('error');
    console.error("Recording process error:", err);
});

process.on("exit", (code: string, signal: string) => {
    process.kill('SIGINT');
    console.log('SIGINT');
    console.log("Recording process exit, code: %d, signal: %s", code, signal);

    if (!signal || signal === "SIGINT") {


           console.log("Recording stopped");
        } else {
            console.warn(
                "Recording process didn't exit cleanly, output file might be corrupt"
            );
        }
    });

    process.stderr.on("data", (chunk: string) => {
        chunk
            .toString()
            .split(/\r?\n/g)
            .filter(Boolean)
            .forEach(async (line: any) => {
                console.log(line);
                if (line.startsWith("ffmpeg version")) {
                    for (const consumer of consumers) {
                        await consumer.resume();
                    }
                }
            });
    });

    // this works!!
    setTimeout(() => {
        stopRecord(process);
    }, 10000);


    return process;
}

// this not works!! I call this function externally inside express router on API request
export function stopRecord(process: any) {
    process.kill('SIGINT');
}


    


    Linux process stays alive when I call stopRecord() inside express router, but property "killed" of process marked as true. It's only works when I send "SIGKILL" inside express router. I need to exit normally, because ffmpeg needs to save mp4 metadata.

    


    So the general question is : Why stopRecord function works inside timeout even with "SIGINT" code, but it doesn't when I call this function externally inside express router. Only "SIGKILL" works when I call stopRecord() inside express router.

    


    Renaming my "process" field doesn't help.

    


    I really don't understand why the same function works different inside timeout and inside express router. And I very thankful for any advice !

    


    I'm using node, typescript and express.