Recherche avancée

Médias (91)

Autres articles (19)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (4096)

  • Concatenate multiple videos with a black screen loop into one video

    23 février 2020, par Marcel

    I am using ffmpeg to join a bunch of videos together.
    I am using the classic join ffmpeg code :

    ffmpeg -f concat -i joinlist.txt -c copy joinedfile.mp4

    but the problem is that the videos are of different formats, encodings, but the same size : all 640x480. I want to join them all and put a black screen video with no sound every other video :

    video1 + black_screen_video + video2 + black_screen_video + video3 ...

    I generated a black screen video of 2 seconds duration using :

    ffmpeg -f lavfi -i color=c=black:s=640x480:d=2 black_screen_video.mp4

    so all of the videos are of the same size : 640x480, and 25 fps but different codecs. The videos have sound, except for the black screen video.
    I can’t do anything manual, because the number of videos are around several hundred. So it has got to be an automatic way to do all this.

    When I joined them together using the above code, the resulting video does not play correctly at all.

    I know that I have to re-encode them, but how to do this to all these videos at once, with one line of code ?

    Update :
    I am already using with success this code to join them together, but only three, if I have more than one hundred, it is time consuming to write down one by one :

    ffmpeg -i vid1.avi -i vid2.avi -i vid3.avi -filter_complex "[0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] concat=n=3:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4

    but this is joining only the videos, not looping the black screen video. When I do with black screen, ffmpeg gives me stream matching errors.

    update :

    here is the console image :
    enter image description here

    2nd update :

    a very long list of errors in red, of which a screenshot here :
    enter image description here

  • How to properly escape shell arguments on Windows ?

    20 novembre 2016, par PeeHaa

    I am trying to properly escape user supplied data for a command line script. Normally I would use escapeshellarg, however this will simply not work because it’s breaks the eventual command line in glorious ways.

    The use case is trying to add meta data to videos using ffmpeg. A simplified and isolated problem case is the following command :

    ffmpeg -i in.mp4 -metadata author="My Name" out.mp4

    The author value is user supplied (My Name). I tried escaping only the user supplied part which resulted in :

    ffmpeg -i in.mp4 -metadata author=""My Name"" out.mp4

    Which results in the following ffmpeg error :

    Name : Invalid argument

    Next I tried escaping the entire flag (-metadata author="My Name") which results in :

    ffmpeg -i in.mp4 "-metadata author= My Name " out.mp4

    "Unrecognized option ’metadata author= My Name ’.

    Test cases :

    $flag = '-metadata author="%s"';

    var_dump(sprintf($flag, escapeshellarg('My Name')));
    var_dump(escapeshellarg(sprintf($flag, 'My Name')));

    Is there anything that will properly escape the user supplied data so that users cannot pass arbitrary flags to my command and that will make ffmpeg happy without having to do it manually with the risk of forgetting something and screwing it up ?

    Update

    I also tried escaping the entire flag value which works unless there is a double quote inside the user supplied part :

    $flag = 'author="%s"';

    var_dump('-metadata ' . escapeshellarg(sprintf($flag, 'My Name')));
    var_dump('-metadata ' . escapeshellarg(sprintf($flag, 'My "Name"')));

    Which results in :

    -metadata "author= My Name "
    -metadata "author= My  Name  " // it eats my quotes
  • Stop encoding a video from piped video and directshow audio data

    9 avril 2023, par obscure

    Via node.js I'm spawning a FFmpeg process which generates a video using jpeg images received from a node.js stream. Additionally it records audio from a directshow device.

    


    const child = require("child_process");
const stream = require("stream");
let inputStream = new stream.PassThrough();
let ffmpeg = child.spawn("ffmpeg.exe", [
    "-f", "image2pipe", "-r", "24", "-fflags", "nobuffer",
    "-i", "pipe:0",
    "-f", "dshow",
    "-sample_rate",
    "48000",
    "-i", 'audio="Microphone"',
    "-acodec",
    "pcm_s16le",
    "-ac", "2",
    "-ar", "48000",
    "-vcodec", "libx264",
    "-crf", "10",
    "-preset", "veryfast",
    "-framerate", "1",
    "output.mkv"
]);

inputStream.pipe(ffmpeg.stdin);


    


    The problem is, if I later stop sending images down the pipe

    


    inputStream.end();


    


    to ultimately stop FFmpeg from encoding the video, it does not stop - I guess because it's still grabbing audio data from the directshow device.

    


    After digging through the FFmpeg manual I've found the -shortest output options which should :

    


    


    ...Finish encoding when the shortest output stream ends...

    


    


    So upon adding the option e.g.

    


    ...
    "-preset", "veryfast",
    "-framerate", "1",
    "-shortest"
    "output.mkv"
]);


    


    it indeed stops encoding but it's happening too fast.

    


    So a video worth 10 seconds of data just has 5 seconds of audio and from second 5 - 10 there's just silence. I assume it's happening because it doesn't drain the rest of the audio buffer before stopping.

    


    How can I stop encoding the output from the video and the audio data, while keeping all the data up to the point I've triggered the 'stop' ?