Recherche avancée

Médias (0)

Mot : - Tags -/médias

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (78)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Les images

    15 mai 2013
  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (3999)

  • How do you cut HLS(.m3u8) video with FFMPEG in javascript ?

    5 août 2021, par Slykeren

    I am working on a project and one of the features is clipping, I got clipping to work for mp4 files but I am unable to find a way to clip HLS.

    


    This is what I am currently using to clip mp4 files

    


    router.post("/clip", async (req, res) => {
  try {
    const { url, startTime, length, clipName } = req.body;
    const outputURL = process.env.OUTPUTURL + clipName;
    ffmpeg(url)
      .setStartTime(startTime)
      .setDuration(length)
      .output(outputURL)
      .on("end", function (err) {
        if (!err) {
          console.log("conversion Done");
          res.send(clipName);
          setTimeout(function () {
            fs.unlink(outputURL, function () {
              console.log("success");
            });
          }, /* This value deterimines how long before the clip will be deleted in miliseconds */ 300000);
        }
      })
      .on("error", function (err) {
        console.log("error: ", err);
      })
      .run();
  } catch (e) {
    console.log(e);
  }
});


    


    Any advice on this problem would be greatly appreciated.

    


  • FFMPEG : Cannot read properties of undefined (reading 'format')

    1er avril 2023, par Donnyb

    I am currently to convert a video file to produce a thumbnail through ffmpeg, react-dropzone, and express. However I keep getting a error of "Cannot read properties of undefined (reading 'format')" in my console. For some reason it can not read the "metadata.format.duration" in my program, I have checked if ffmpeg is properly installed by running the ffmpeg —version in my console, and I get all the details, along with ffprobe —version as well.

    


    Here is my code :
upload.js

    


    router.post("/thumbnail", (req, res) => {
    let thumbsFilePath ="";
    let fileDuration ="";

    // req.body.filepath
    ffmpeg.ffprobe(req.body.filepath, function(err, metadata){
        console.dir(metadata);
        console.log(metadata.format.duration);

        fileDuration = metadata.format.duration;
    })

    ffmpeg(req.body.filepath) //req.body.filepath
    .on('filenames', function (filenames) {
        console.log('Will generate ' + filenames.join(', '))
        console.log(filenames);
        thumbsFilePath = "./uploads/thumbnails/" + filenames[0];
        
    })
    .on('end', function () {
        console.log('Screenshots taken');
        return res.json({ success: true, thumbsFilePath: thumbsFilePath, fileDuration: fileDuration})
    })
    .screenshots({
        // Will take screens at 20%, 40%, 60% and 80% of the video
        count: 3,
        folder: './uploads/thumbnails',
        size:'320x240',
        // %b input basename ( filename w/o extension )
        filename:'thumbnail-%b.png'
    });
})


    


    FrontEnd drop code :
AddVideo.js

    


    const onDrop = (files) => {&#xA;&#xA;        let formData = new FormData();&#xA;        const config = {&#xA;            header: { &#x27;content-type&#x27;: &#x27;multipart/form-data&#x27; }&#xA;        }&#xA;        console.log(files)&#xA;        formData.append("file", files[0])&#xA;&#xA;        axios.post(&#x27;http://localhost:5000/api/upload/uploadfiles&#x27;, formData, config)&#xA;            .then(response => {&#xA;                if (response.data.success) {&#xA;&#xA;                    let variable = {&#xA;                        filePath: response.data.filePath,&#xA;                        fileName: response.data.fileName&#xA;                    }&#xA;                    setFilePath(response.data.filePath)&#xA;&#xA;                    //gerenate thumbnail with this filepath ! &#xA;&#xA;                    axios.post(&#x27;http://localhost:5000/api/upload/thumbnail&#x27;, variable)&#xA;                        .then(response => {&#xA;                            if (response.data.success) {&#xA;                                setDuration(response.data.fileDuration)&#xA;                                setThumbnail(response.data.thumbsFilePath)&#xA;                            } else {&#xA;                                alert(&#x27;Failed to make the thumbnails&#x27;);&#xA;                            }&#xA;                        })&#xA;&#xA;&#xA;                } else {&#xA;                    alert(&#x27;failed to save the video in server&#x27;)&#xA;                }&#xA;            })&#xA;&#xA;    }&#xA;&#xA;    return (&#xA;        <div style="{{">&#xA;            <div style="{{">&#xA;                {/*  */}&#xA;            </div>&#xA;&#xA;            <formcontrol>&#xA;            <div style="{{">&#xA;            &#xA;                        {({ getRootProps, getInputProps }) => (&#xA;                            <div style="{{" solid="solid">&#xA;                                <input />&#xA;                                <icon type="plus" style="{{"></icon>&#xA;&#xA;                            </div>&#xA;                        )}&#xA;                    &#xA;            </div>&#xA;            </formcontrol>&#xA;        </div>&#xA;    )&#xA;}&#xA;

    &#xA;

    The video I am trying to upload is a mp4 file. I am using fluent-ffmpeg as a dependency.

    &#xA;

  • Merge video and audio using ffmpeg in Express.js

    4 février 2024, par Muhammad Tahir Ali

    I am using FFmpeg-static in my Express server to merge audio and video coming from Youtube Readable Stream. I have found one code on one Github repo but that code is converting and saving directly to the backend root folder. What I want is to merge and then pipe it directly to the end user.&#xA;The code which I found is below :

    &#xA;

    router.get(&#x27;/try&#x27;, async (req, res)=>{&#xA;let vid = ytdl(ytvideoUrl, {filter: format => format.qualityLabel === &#x27;144p&#x27;})&#xA;let aud = ytdl(ytvideoUrl, { quality: &#x27;lowestaudio&#x27; })&#xA;&#xA;const ffmpegProcess = cp.spawn(ffmpeg, [&#xA;    &#x27;-loglevel&#x27;, &#x27;8&#x27;, &#x27;-hide_banner&#x27;,&#xA;    &#x27;-progress&#x27;, &#x27;pipe:3&#x27;,&#xA;    &#x27;-i&#x27;, &#x27;pipe:4&#x27;,&#xA;    &#x27;-i&#x27;, &#x27;pipe:5&#x27;,&#xA;    &#x27;-map&#x27;, &#x27;0:a&#x27;,&#xA;    &#x27;-map&#x27;, &#x27;1:v&#x27;,&#xA;    &#x27;-c:v&#x27;, &#x27;copy&#x27;,&#xA;    `videoTitle.mp4`,&#xA;  ], {&#xA;    windowsHide: true,&#xA;    stdio: [&#xA;      &#x27;inherit&#x27;, &#x27;inherit&#x27;, &#x27;inherit&#x27;,&#xA;      &#x27;pipe&#x27;, &#x27;pipe&#x27;, &#x27;pipe&#x27;,&#xA;    ],&#xA;  })&#xA;ffmpegProcess.on(&#x27;close&#x27;, () => {&#xA;console.log("Merging Completed");&#xA;})&#xA;  &#xA;aud.pipe(ffmpegProcess.stdio[4]);&#xA;vid.pipe(ffmpegProcess.stdio[5]);&#xA;})&#xA;

    &#xA;

    Dependencies are :

    &#xA;

    const cp = require(&#x27;child_process&#x27;);&#xA;const ytdl = require(&#x27;ytdl-core&#x27;)&#xA;const ffmpeg = require(&#x27;ffmpeg-static&#x27;);&#xA;

    &#xA;