Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (29)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

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

Sur d’autres sites (3751)

  • how to prevent the hls video player dont refresh when m3u8 changes

    6 juin 2024, par Leo

    here i am using ffmpeg to use camera and audio to make a hls stream on server as the stream continious old m3u8 components deletes and new ones gets added to main.m3u8. but as we insert the url of hls stream file main.m3u8. the player refreshes as soon as the file gets rewritten because of new and old ones. so

    


    i have tried to change the players like hls.js or videojs etc none were to solve this. how to solve this and make sure the stream runs smoothly.

    


    Server.js

    


    const startStreaming = (viddev,auddev) => {
    if (ffmpegProcess) {
        ffmpegProcess.kill();
    }
    const segmentDuration = 10;
    const outputFilename = './video/output.m3u8';
    const ffmpegCommand = `ffmpeg -f dshow -i video="${viddev}" -f dshow -i audio="${auddev}" -codec:v libx264 -preset ultrafast -tune zerolatency -codec:a aac -b:a 128k -hls_time ${segmentDuration} -hls_list_size 3 -hls_flags delete_segments -start_number 0 -hls_segment_type mpegts ${outputFilename}`;

    ffmpegProcess = exec(ffmpegCommand);

    ffmpegProcess.stderr.on('data', (data) => {
        console.error(`ffmpeg stderr: ${data}`);
    });

    ffmpegProcess.on('close', (code) => {
        console.log(`ffmpeg process exited with code ${code}`);
    });
};

app.use('/video', express.static(path.join(__dirname, 'video')));

// Endpoint to list audio and video devices
app.get('/devices', async (req, res) => {
    const data=await parseDevices()
    // console.log(data.cameras[0].name)
    startStreaming(data.cameras[0].name,data.microphones[0].name);
    res.json(data)
});


    


    index.html

    


    &#xA;&#xA;&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;&#xA;&#xA;&#xA;    &#xA;        <source src="https://localhost:3000/video/output.m3u8" type="application/x-mpegURL">&#xA;    &#xA;&#xA;    <code class="echappe-js">&lt;script src=&quot;https://vjs.zencdn.net/8.10.0/video.min.js&quot;&gt;&lt;/script&gt;&#xA;    &lt;script&gt;&amp;#xA;        // Initialize Video.js player&amp;#xA;        var player = videojs(&amp;#x27;video&amp;#x27;, {&amp;#xA;            autoplay: &amp;#x27;play&amp;#x27;,&amp;#xA;            liveui: true  // Enable the live UI for live streams&amp;#xA;        });&amp;#xA;&amp;#xA;        // Seek to live when the player is ready&amp;#xA;        player.ready(function() {&amp;#xA;            player.liveTracker.on(&amp;#x27;liveedgechange&amp;#x27;, function() {&amp;#xA;                player.currentTime(player.liveTracker.liveCurrentTime());&amp;#xA;            });&amp;#xA;        });&amp;#xA;&amp;#xA;        // Handle any errors encountered by Video.js&amp;#xA;        player.on(&amp;#x27;error&amp;#x27;, function() {&amp;#xA;            console.error(&amp;#x27;Video.js encountered an error:&amp;#x27;, player.error());&amp;#xA;        });&amp;#xA;    &lt;/script&gt;&#xA;&#xA;&#xA;&#xA;&#xA;

    &#xA;

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

    &#xA;

    Here is my code :&#xA;upload.js

    &#xA;

    router.post("/thumbnail", (req, res) => {&#xA;    let thumbsFilePath ="";&#xA;    let fileDuration ="";&#xA;&#xA;    // req.body.filepath&#xA;    ffmpeg.ffprobe(req.body.filepath, function(err, metadata){&#xA;        console.dir(metadata);&#xA;        console.log(metadata.format.duration);&#xA;&#xA;        fileDuration = metadata.format.duration;&#xA;    })&#xA;&#xA;    ffmpeg(req.body.filepath) //req.body.filepath&#xA;    .on(&#x27;filenames&#x27;, function (filenames) {&#xA;        console.log(&#x27;Will generate &#x27; &#x2B; filenames.join(&#x27;, &#x27;))&#xA;        console.log(filenames);&#xA;        thumbsFilePath = "./uploads/thumbnails/" &#x2B; filenames[0];&#xA;        &#xA;    })&#xA;    .on(&#x27;end&#x27;, function () {&#xA;        console.log(&#x27;Screenshots taken&#x27;);&#xA;        return res.json({ success: true, thumbsFilePath: thumbsFilePath, fileDuration: fileDuration})&#xA;    })&#xA;    .screenshots({&#xA;        // Will take screens at 20%, 40%, 60% and 80% of the video&#xA;        count: 3,&#xA;        folder: &#x27;./uploads/thumbnails&#x27;,&#xA;        size:&#x27;320x240&#x27;,&#xA;        // %b input basename ( filename w/o extension )&#xA;        filename:&#x27;thumbnail-%b.png&#x27;&#xA;    });&#xA;})&#xA;

    &#xA;

    FrontEnd drop code :&#xA;AddVideo.js

    &#xA;

    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;

  • Saving Video From URL as MP3 in Firebase Storage

    4 janvier 2024, par Christopher Frydryck

    I am working on a problem I have been stumped on the past couple days. I am using Node.js with Express (v4.18.2) to eventually create a Firebase deployment that can take in a video URL and output an audio mp3 to the Firebase Firestore. I have made some progress, but am still unsuccessful in some areas.

    &#xA;

    I cannot save the file locally using fs, but for this example I have shown that it works with FS. I am successfully saving a local .mp3 file.

    &#xA;

    First a few functions I have :

    &#xA;

    async function downloadVideo(videoUrl) {&#xA;    try {&#xA;      const response = await axios.get(videoUrl, {&#xA;        responseType: &#x27;stream&#x27;,&#xA;      });&#xA;  &#xA;      if (response.status === 200) {&#xA;        return response.data;&#xA;      } else {&#xA;        throw new Error(&#x27;Failed to fetch the video&#x27;);&#xA;      }&#xA;    } catch (error) {&#xA;      throw new Error(&#x27;Error fetching the video: &#x27; &#x2B; error.message);&#xA;    }&#xA;  }&#xA;

    &#xA;

    async function extractAudioFromVideo(videoUrl) {&#xA;    try {&#xA;      const videoStream = await downloadVideo(videoUrl);&#xA;  &#xA;      // Create a PassThrough stream to pipe the video data&#xA;      const passThrough = new PassThrough();&#xA;      videoStream.pipe(passThrough);&#xA;&#xA;      const outputFile = &#x27;output.mp3&#x27;;&#xA;      const outputStream = fs.createWriteStream(outputFile);&#xA;  &#xA;        return new Promise((resolve, reject) => {&#xA;            const audioBuffers = [];&#xA;&#xA;            passThrough.on(&#x27;data&#x27;, chunk => {&#xA;                audioBuffers.push(chunk)&#xA;                outputStream.write(chunk); // Write chunks to a local file&#xA;              });&#xA;        &#xA;              passThrough.on(&#x27;error&#x27;, err => {&#xA;                reject(err);&#xA;              });&#xA;        &#xA;&#xA;            ffmpeg()&#xA;            .input(passThrough)&#xA;            .output(&#x27;/dev/null&#x27;) // Null output as a placeholder&#xA;            .outputOptions(&#x27;-vn&#x27;) // Extract audio only&#xA;            .noVideo()&#xA;            .audioQuality(0)&#xA;            .audioCodec(&#x27;libmp3lame&#x27;) // Set audio codec&#xA;            .format(&#x27;mp3&#x27;)&#xA;            .on(&#x27;end&#x27;, () => {&#xA;                const audioBuffer = Buffer.concat(audioBuffers)&#xA;                if (audioBuffer.length > 0) {&#xA;                    resolve(audioBuffer);&#xA;                  } else {&#xA;                    reject(new Error(&#x27;Empty audio buffer&#x27;));&#xA;                  }&#xA;              })&#xA;            .on(&#x27;error&#x27;, err => reject(err))&#xA;            .run();&#xA;        })&#xA;    } catch (error) {&#xA;      throw new Error(&#x27;Error extracting audio: &#x27; &#x2B; error.message);&#xA;    }&#xA;  }&#xA;

    &#xA;

     async function saveAudioToFirebase(audioBuffer, fileName) {&#xA;    try {&#xA;        let storage = admin.storage()&#xA;    let storageRef = storage.bucket(serviceAccount.storage_bucket_content)&#xA;      const file = storageRef.file(fileName) // Specify the desired file name here&#xA;&#xA;      const renamedFileName = fileName.replace(/\.[^/.]&#x2B;$/, &#x27;.mp3&#x27;); // Change the file extension to .mp3&#xA;  &#xA;      await file.save(audioBuffer, {&#xA;        metadata: {&#xA;          contentType: &#x27;audio/mpeg&#x27;, // Adjust the content type as needed&#xA;        },&#xA;      });&#xA;&#xA;      await file.setMetadata({&#xA;        contentType: &#x27;audio/mpeg&#x27;&#xA;      })&#xA;&#xA;      await file.move(renamedFileName); // Rename the file with the .mp3 extension&#xA;  &#xA;      console.log(&#x27;Audio saved to Firebase Storage.&#x27;);&#xA;    } catch (error) {&#xA;      console.error(&#x27;Error saving audio to Firebase Storage:&#x27;, error);&#xA;    }&#xA;  }&#xA;&#xA;

    &#xA;

    What works :

    &#xA;

      &#xA;
    • Downloading the video via Axios
    • &#xA;

    • Saving to Firebase storage (no intializing or pointer issues to Firebase)
    • &#xA;

    • Outputting a local .mp3 file called "output.mp3"
    • &#xA;

    • I am able to log the result of extractAudioFromVideo and get a buffer logged in my terminal
    • &#xA;

    &#xA;

    What doesn't work :

    &#xA;

      &#xA;
    • Saving a file to Firebase Storage that is an .mp3. It says ".mp3" in the url and it has a content type of 'audio/mpeg' but it is in fact an .mp4. Still has video and plays video in the browser window.
    • &#xA;

    &#xA;

    I am willing to use other libraries like tmp if suggested and the solution works.

    &#xA;