Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (68)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (6092)

  • 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!");
  };
});


    


  • Filtering string for hidden character when read from file in bash [duplicate]

    19 mai 2021, par BharathYes

    I am writing a bash script to trim video file into small pieces and finally merge them into a single video file using ffmpeg based on specified time.

    


    #!/bin/bash

filename="$1"
linecount=`wc -l "${filename}.txt"`
echo -n "" > to-merge.list

# file split by time
count=0
IFS=''
while read -r fromTime ; read -r toTime; do
    echo "$fromTime and $toTime done"
    ffmpeg -i "${filename}.mp4" -ss $fromTime -to $toTime -c copy "${filename}_pt_${count}.mp4"
    echo "file '${filename}_pt_${count}.mp4'" >> to-merge.list
    count=$((count+1))
done < "${filename}.txt"

# file merge
`ffmpeg -f concat -safe 0 -i to-merge.list -c copy "${filename}-trimmed.mp4"`


    


    The input file contains time (odd lines are taken as start time and even as the end time). A file I use is :

    


    00:00:00
00:39:34
00:39:38
01:23:14
01:23:16
02:03:45
02:03:48
02:43:43


    



    


    problem faced

    


    The echo in while loop prints this : done02:03:45

    


    The overwriting makes me think the time stored in the variables must contain a special character at the end that makes it invalid in ffmpeg.
ffmpeg throws this error : Invalid duration specification for ss: 01:23:16

    


    Is there a way to cleanup the time variable ?

    


    I have tried to find what is causing this issue or how to get rid of it but drawing a blank.

    



    


    what I have tried so far

    


    use grep -Eo '[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}' to find time. While this works on the shell I am unable to use it in the script.

    


    Tried splitting time by : into hour, min and sec and saving them into an array to then merge them back but this makes it unnecessarily complicated and error prone.

    


    PS :
Is while read to be preferred for reading multiple lines like here or should tools like sed be used for best practice ? Such as sed '2,4 !d' /tmp/test.txt ?

    


  • avcodec/bsf : switch to av_get_token to parse bsf list string

    3 juillet 2021, par Gyan Doshi
    avcodec/bsf : switch to av_get_token to parse bsf list string
    

    The recently added setts bsf makes use of the eval API whose
    expressions can contain commas. The existing parsing in
    av_bsf_list_parse_str() uses av_strtok to naively split
    the string at commas, thus preventing the use of setts filter
    with expressions containing commas.

    av_get_token can work with escaped commas, allowing full use of setts.

    • [DH] libavcodec/bsf.c