Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (104)

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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (8399)

  • node.js ffmpeg spawn child_process unexpected data output

    5 septembre 2021, par PLNR

    
I'm rather new to backend stuff, so please excuse, if my question is trivial.
    
For an Intranet project, I want to present a video element in a webpage (React, HLS.js Player).
    
The video sources are mpeg-ts streams delivered as udp multicast.
    
A small node.js / express server should handle the ffmpeg commands, to transcode the multicast to hls to display them in a browser.
    

    
Problem is the Output :
    
The output is emitted on stderr... even the process is working as expected.
    
Here is the respective code I wrote for transcoding so far :

    


    const express = require("express");
const { spawn, exec } = require("child_process");
const process = require("process")

let ls;

const app = express();

app.get('/cam/:source', (body) => {
    const cam = body.params.source;
    console.log(cam);

    let source = "udp://239.1.1.1:4444";
    let stream = "/var/www/html/streams/tmp/cam1.m3u8"


    stream = spawn("ffmpeg", ["-re", "-i", source, "-c:v", "libx264", "-crf", "21", "-preset", "veryfast", "-c:a", "aac", "-b:a", "128k", "-ac", "2", "-f", "hls", "-hls_list_size", "5", "-hls_flags", "delete_segments", stream], {detached: true});

    stream.stdout.on("data", data => {
        console.log(`stdout: ${data}`);
    });

    stream.stderr.on("data", data => {
        console.log(`stderr: ${data}`);
    });

    stream.on("error", error => {
        console.log(`error: ${error.message}`);
    });

    stream.on("close", code => {
        console.log(`child process exited with code ${code}`);
    });
})

app.listen(5000, ()=> {
    console.log('Listening');
})


    


    This is maybe only cosmetics, but it makes me wondering.
    
Here is the terminal output :

    


    [nodemon] starting `node server.js`
Listening
camera stream reloaded
stderr: ffmpeg version 4.3.2-0+deb11u1ubuntu1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Ubuntu 10.2.1-20ubuntu1)

  --shortend--


pid:  4206
stderr: frame=    8 fps=0.0 q=0.0 size=N/A time=00:00:00.46 bitrate=N/A speed=0.931x    
pid:  4206
stderr: frame=   21 fps= 21 q=26.0 size=N/A time=00:00:00.96 bitrate=N/A speed=0.95x    
pid:  4206
stderr: frame=   33 fps= 22 q=26.0 size=N/A time=00:00:01.49 bitrate=N/A speed=0.982x    
pid:  4206
stderr: frame=   46 fps= 23 q=26.0 size=N/A time=00:00:02.00 bitrate=N/A speed=0.989x    
pid:  4206
stderr: frame=   58 fps= 23 q=26.0 size=N/A time=00:00:02.49 bitrate=N/A speed=0.986x    
pid:  4206


    


    and so on...
    

    
Any helpful information would be highly appreciated !
    
Many thanks in advance

    


  • Is it possible to upstream an audio file like mp4 or mpd to node media server using FFmpeg ?

    28 mars 2022, par King Ses

    As shown in the example from https://github.com/illuspas/Node-Media-Server. The command allows a video to be published and accessed through the URL.

    


    


    ffmpeg -re -i INPUT_FILE_NAME -c copy -f flv rtmp ://localhost/live/STREAM_NAME

    


    


    Is it possible to do the same for audio-only ? I have tried reading through the documentation at https://ffmpeg.org/ffmpeg-formats.html but I'm really unclear about options and what they actually do. Apologies if I'm making things confusing.

    


  • Can't stream video when using node-rtsp-stream latest version ?

    6 avril 2022, par cauchuyennhocuatoi

    I am using node-rtsp-stream latest version (0.0.9)

    


    https://www.npmjs.com/package/node-rtsp-stream


    


    I use it (node-rtsp-stream) to stream an IP camera. I also install the latest version of ffmpeg here :

    


    https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z


    


    Here is my code

    


    Stream = require('node-rtsp-stream');
stream = new Stream({
  name: 'test',
  streamUrl: 'rtsp://username:password@IP:PORT/cam/realmonitor?channel=1&subtype=0',
  wsPort: 9999,
  ffmpegOptions: { // options ffmpeg flags
    '-r': 30 // options with required values specify the value after the key
  }
});


    


    After running nodejs server I get the following output :

    


    Metadata:
    title           : Media Server
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 2688x1520, 25 tbr, 90k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'pipe:':
  Metadata:
    title           : Media Server
    encoder         : Lavf59.20.101
  Stream #0:0: Video: mpeg1video, yuv420p, 2688x1520, q=2-31, 200 kb/s, 30 fps, 90k tbn
    Metadata:
      encoder         : Lavc59.25.100 mpeg1video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)


    


    This result means I can't stream video from the camera yet. Output is empty, whereas if I use 0.04 version, I can streamming the videos. Below is output if I using node-rtsp-stream version 0.0.4 :

    


    Metadata:
    title           : Media Server
  Duration: N/A, start: 0.040000, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 2688x1520, 25 fps, 25 tbr, 90k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
Output #0, mpeg1video, to 'pipe:':
  Metadata:
    title           : Media Server
    encoder         : Lavf59.20.101
  Stream #0:0: Video: mpeg1video, yuv420p(tv, progressive), 2688x1520, q=2-31, 200 kb/s, 30 fps, 30 tbn
    Metadata:
      encoder         : Lavc59.25.100 mpeg1video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=  314 fps= 32 q=24.8 size=    4768kB time=00:00:10.40 bitrate=3755.7kbits/s dup=51 drop=0 speed=1.05x 


    


    But I need to use the latest version (node-rtsp-stream 0.0.9) for my project, please take a look.