Recherche avancée

Médias (91)

Autres articles (68)

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

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (8039)

  • Read portion of lines from child process in Rust (chunk of data)

    2 octobre 2022, par Alexey Volodko

    When I try to spawn a child ffmpeg process I use additonal flag -progress, next I use pipe to pass this progress output to the stderr.
So the whole command looks like :

    


    ffmpeg -i ... -progress pipe:2 ...


    


    Without -progress flag ffmepg outputs following line in stderr, probably once per second :

    


    frame=46 46 fps=0.0 q=0.0 size=       0kB time=00:00:01.72 bitrate=   0.2kbits/s speed=2.69x


    


    With -progress flag ffmepg outputs (multiple lines) in stderr, probably once per second :

    


    frame=1   1 fps=0.0 q=0.0 size=       0kB time=00:00:00.19 bitrate=   2.0kbits/s speed=2.94x    
fps=0.00
stream_0_0_q=0.0
bitrate=   2.0kbits/s
total_size=48
out_time_us=192000
out_time_ms=192000
out_time=00:00:00.192000
dup_frames=0
drop_frames=0
speed=2.94x
progress=continue


    


    The main puppose of using -progress flag is to calc percentage of completion by parsing out_time_ms line and comparing to the whole duration.

    


    Reading this chunk (portion of lines) is pretty simple in NodeJS :

    


    const { spawn } = require('child_process');
const child = spawn('ffmpeg', [..., '-progress', 'pipe:2', ...]);

child.stderr.on('data', (data) => {
  // data will contain multiple lines, exactly one chunk
});


    


    Reading this chunk (portion of lines) is pretty simple in Deno also :

    


    const child = Deno.spawnChild("ffmpeg", {
  args: [..., '-progress', 'pipe:2', ...],
});
const stderrReader = child.stderr.getReader();
let readResult = await stderrReader.read();
while (readResult.done !== true) {
  readResult = await stderrReader.read();
  // readResult will contain multiple lines, exactly one chunk
}


    


    I can't achieve the same in rust :

    


    let mut command = Command::new("ffmpeg");
command.args(["...", "-progress", "pipe:2", "..."]);
let mut child = command
  .stdout(Stdio::piped())
  .stderr(Stdio::piped())
  .spawn()
  .unwrap();

let child_stderr = child.stderr.as_mut().expect("Unable to pipe stderr");
let mut reader = BufReader::new(child_stderr);
let mut buff = String::new();
while reader.read_line(&mut buff).expect("Unable to read chunk") > 0 {
  // buff will contain only on line
  buff.clear();
}


    


    I am new in Rust. I can not detect what character signals end of chunk.

    


      

    • Runnig read_line() - will read only one line.
    • 


    • Runnig read_to_end() - will read the whole output until the end of process (EOF).
    • 


    


    How can I read in Rust portion of lines that ffmpeg outputs probably once per second ?
How Node/Deno detects this "end of chunk" ?
Does rust have such event/signal also ?

    


  • Creating an Init file from existing non-fragmented, segmented MP4 files

    20 novembre 2018, par slhck

    I am performing chunked encodes of longer video files, where I’ve split the original file into individual sequences that I have encoded separately. These sequences are files of different length, depending on where the scene cuts appear—they may be between 2 and 5 seconds long. They all start with an I-frame and are standalone.

    My encoded sequences are all MP4s, e.g. :

    test_0000.mp4
    test_0001.mp4
    test_0002.mp4
    test_0003.mp4
    test_0004.mp4

    They all have common properties :

    $ mp4info test_0000.mp4

    File:
     major brand:      isom
     minor version:    200
     compatible brand: isom
     compatible brand: iso2
     compatible brand: mp41
     fast start:       no

    Movie:
     duration:   2016 ms
     time scale: 1000
     fragments:  no

    ...

    Now, in order to play those with a DASH player, I have to create an initialization segment and individual fragmented MP4s.

    I could generate the fragmented MP4s via mp4fragment which I run on each standalone MP4 file :

    $ mp4info test_0000.m4s
    File:
     major brand:      isom
     minor version:    200
     compatible brand: isom
     compatible brand: iso2
     compatible brand: mp41
     compatible brand: iso5
     fast start:       yes

    Movie:
     duration:   2016 ms
     time scale: 1000
     fragments:  yes

    ...

    But obviously, these are now not according to spec, and all contain a moov atom :

    What I’d need is individual media segments with only one moof and mdat box, which then require an initialization segment with only a moov box.

    How can I generate that from the existing, already encoded segments ?

    I know this appears like an XY problem. In principle, I could already segment my original file directly after encoding, and run those encodes at the same time, e.g. using ffmpeg’s dash muxer, or MP4Box, however :

    • There is almost no control over the resulting segment sizes, with respect to minimum and maximum duration
    • This approach does not parallelize

    I have also checked Bento4 ; it does not seem to offer this functionality. Neither does FFmpeg. MP4Box behaves similarly. They all assume you have one long file to start with.


    I see I could splice off the ftyp and moov boxes from these “fake fragments” in order to create an initialization segment. But I would end up with segments containing multiple moof and mdat boxes, which is not according to the specification – it only allows one fragment and media data box :

    4. Media Segments

    […] one optional Segment Type Box (styp) followed by a single Movie Fragment Box (moof) followed by one or more Media Data Boxes (mdat).

    I guess I can live with this the styp not being present.

  • fftools/graphprint : Add execution graph printing

    15 mai, par softworkz
    fftools/graphprint : Add execution graph printing
    

    The key benefits are :

    - Different to other graph printing methods, this is outputting :
    - all graphs with runtime state
    (including auto-inserted filters)
    - each graph with its inputs and outputs
    - all filters with their in- and output pads
    - all connections between all input- and output pads
    - for each connection :
    - the runtime-negotiated format and media type
    - the hw context
    - if video hw context, both : hw pixfmt + sw pixfmt
    - Output can either be printed to stdout or written to specified file
    - Output is machine-readable
    - Use the same output implementation as ffprobe, supporting multiple
    formats

    Signed-off-by : softworkz <softworkz@hotmail.com>

    • [DH] doc/ffmpeg.texi
    • [DH] fftools/Makefile
    • [DH] fftools/ffmpeg.c
    • [DH] fftools/ffmpeg.h
    • [DH] fftools/ffmpeg_filter.c
    • [DH] fftools/ffmpeg_opt.c
    • [DH] fftools/graph/graphprint.c
    • [DH] fftools/graph/graphprint.h
    • [DH] fftools/textformat/avtextformat.c
    • [DH] fftools/textformat/avtextformat.h
    • [DH] fftools/textformat/tf_mermaid.c
    • [DH] fftools/textformat/tf_mermaid.h