Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (82)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

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

  • Seam carving

    13 février 2008, par Mikko Koppanen — Imagick, PHP stuff

    Today I was reading trough the ImageMagick ChangeLog and noticed an interesting entry. “Add support for liquid rescaling”. I rushed to check the MagickWand API docs and there it was : MagickLiquidRescaleImage ! After about ten minutes of hacking the Imagick support was done. Needless to say ; I was excited :)

    For those who don’t know what seam carving is check the demo here. More detailed information about the algorithm can be found here : “Seam Carving for Content-Aware Image Resizing” by Shai Avidan and Ariel Shamir

    To use this functionality you need to install at least ImageMagick 6.3.8-2 and liblqr. Remember to pass –with-lqr to ImageMagick configuration line. You can get liblqr here : http://liblqr.wikidot.com/. The Imagick side of the functionality should appear in the CVS today if everything goes as planned.

    Here is a really simple example just to illustrate the results of the operation. The parameters might be far from optimal (didn’t do much testing yet). The original dimensions of image are 500×375 and the resulting size is 500×200.

    Update : the functionality is pending until license issues are solved.

    1. < ?php
    2.  
    3. /* Create new object */
    4. $im = new Imagick( ’test.jpg’ ) ;
    5.  
    6. /* Scale down */
    7. $im->liquidRescaleImage( 500, 200, 3, 25 ) ;
    8.  
    9. /* Display */
    10. header( ’Content-Type : image/jpg’ ) ;
    11. echo $im ;
    12.  
    13.  ?>

    The original image by flickr/jennconspiracy

    result

    And the result :

    result

    Update. On kenrick’s request here is an image which is scaled down to 300×300

    result2

  • Seam carving

    9 juin 2010, par Mikko Koppanen — Imagick, PHP stuff

    Today I was reading trough the ImageMagick ChangeLog and noticed an interesting entry. “Add support for liquid rescaling”. I rushed to check the MagickWand API docs and there it was : MagickLiquidRescaleImage ! After about ten minutes of hacking the Imagick support was done. Needless to say ; I was excited :)

    For those who don’t know what seam carving is check the demo here. More detailed information about the algorithm can be found here : “Seam Carving for Content-Aware Image Resizing” by Shai Avidan and Ariel Shamir

    To use this functionality you need to install at least ImageMagick 6.3.8-2 and liblqr. Remember to pass –with-lqr to ImageMagick configuration line. You can get liblqr here : http://liblqr.wikidot.com/. The Imagick side of the functionality should appear in the CVS today if everything goes as planned.

    Here is a really simple example just to illustrate the results of the operation. The parameters might be far from optimal (didn’t do much testing yet). The original dimensions of image are 500×375 and the resulting size is 500×200.

    Update : the functionality is pending until license issues are solved.

    1. < ?php
    2.  
    3. /* Create new object */
    4. $im = new Imagick( ’test.jpg’ ) ;
    5.  
    6. /* Scale down */
    7. $im->liquidRescaleImage( 500, 200, 3, 25 ) ;
    8.  
    9. /* Display */
    10. header( ’Content-Type : image/jpg’ ) ;
    11. echo $im ;
    12.  
    13.  ?>

    The original image by flickr/jennconspiracy

    result

    And the result :

    result

    Update. On kenrick’s request here is an image which is scaled down to 300×300

    result2

  • How to broadcast a video stream without reloading the page ?

    16 novembre 2024, par promo 69

    I created a Node.js server to :

    &#xA;

      &#xA;
    1. Receive images in udp and transform them into video and
    2. &#xA;

    3. Display it on a website
    4. &#xA;

    5. I tried but I don't understand how to broadcast the video live without having to reload the page
    6. &#xA;

    &#xA;

    Node.js server code :

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const dgram = require(&#x27;dgram&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;const ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;const path = require(&#x27;path&#x27;);&#xA;const WebSocket = require(&#x27;ws&#x27;);&#xA;&#xA;const app = express();&#xA;const httpPort = 3000;&#xA;&#xA;const imageDir = path.join(__dirname, &#x27;images&#x27;);&#xA;if (!fs.existsSync(imageDir)) {&#xA;    fs.mkdirSync(imageDir);&#xA;}&#xA;&#xA;let imageCount = 0;&#xA;&#xA;const udpPort = 15002;&#xA;const udpHost = &#x27;127.0.0.1&#x27;;&#xA;const server = dgram.createSocket(&#x27;udp4&#x27;);&#xA;&#xA;const wss = new WebSocket.Server({ noServer: true });&#xA;&#xA;&#xA;const createVideo = () => {&#xA;    const outputVideo = path.join(__dirname, &#x27;output_video.mp4&#x27;);&#xA;&#xA;    ffmpeg()&#xA;        .input(path.join(imageDir, &#x27;%d.jpg&#x27;))&#xA;        .inputOptions(&#x27;-framerate 30&#x27;)&#xA;        .output(outputVideo)&#xA;        .outputOptions(&#x27;-c:v libx264&#x27;)&#xA;        .on(&#x27;end&#x27;, () => {&#xA;            console.log(&#x27;Vid&#xE9;o cr&#xE9;&#xE9;e avec succ&#xE8;s !&#x27;);&#xA;&#xA;            wss.clients.forEach(client => {&#xA;                if (client.readyState === WebSocket.OPEN) {&#xA;                    client.send(&#x27;new-video&#x27;);&#xA;                }&#xA;            });&#xA;        })&#xA;        .on(&#x27;error&#x27;, (err) => {&#xA;            console.log(&#x27;Erreur lors de la cr&#xE9;ation de la vid&#xE9;o:&#x27;, err);&#xA;        })&#xA;        .run();&#xA;};&#xA;&#xA;&#xA;app.get(&#x27;/feed-video&#x27;, (req, res) => {&#xA;    const videoPath = path.join(__dirname, &#x27;output_video.mp4&#x27;);&#xA;    res.sendFile(videoPath);&#xA;});&#xA;&#xA;server.on(&#x27;message&#x27;, (msg, rinfo) => {&#xA;    console.log(`Re&#xE7;u message de ${rinfo.address}:${rinfo.port}`);&#xA;&#xA;    const imageFilePath = path.join(imageDir, `${imageCount}.jpg`);&#xA;    fs.writeFileSync(imageFilePath, msg);&#xA;&#xA;    console.log(`Image ${imageCount}.jpg re&#xE7;ue et sauvegard&#xE9;e`);&#xA;&#xA;&#xA;    imageCount&#x2B;&#x2B;;&#xA;&#xA;&#xA;    if (imageCount > 100) {&#xA;        createVideo();&#xA;        imageCount = 0;&#xA;    }&#xA;});&#xA;&#xA;&#xA;server.on(&#x27;listening&#x27;, () => {&#xA;    const address = server.address();&#xA;    console.log(`Serveur UDP en &#xE9;coute sur ${address.address}:${address.port}`);&#xA;});&#xA;&#xA;&#xA;app.server = app.listen(httpPort, () => {&#xA;    console.log(`Serveur HTTP et WebSocket d&#xE9;marr&#xE9; sur http://localhost:${httpPort}`);&#xA;});&#xA;&#xA;app.server.on(&#x27;upgrade&#x27;, (request, socket, head) => {&#xA;    wss.handleUpgrade(request, socket, head, (ws) => {&#xA;        wss.emit(&#x27;connection&#x27;, ws, request);&#xA;    });&#xA;});&#xA;&#xA;&#xA;server.bind(udpPort, udpHost);&#xA;&#xA;

    &#xA;

    The html page :

    &#xA;

    &#xA;&#xA;&#xA;    &#xA;    &#xA;    &#xA;    &#xA;&#xA;&#xA;<h1>Drone Video Feed</h1>&#xA;<video controls="controls" autoplay="autoplay"></video>&#xA;&#xA;<code class="echappe-js">&lt;script&gt;&amp;#xA;    const video = document.getElementById(&amp;#x27;video&amp;#x27;);&amp;#xA;    const ws = new WebSocket(&amp;#x27;ws://localhost:3000&amp;#x27;);&amp;#xA;&amp;#xA;    ws.onmessage = (event) =&gt; {&amp;#xA;        const blob = new Blob([event.data], { type: &amp;#x27;video/mp4&amp;#x27; });&amp;#xA;        video.src = URL.createObjectURL(blob);&amp;#xA;        video.play();&amp;#xA;    };&amp;#xA;&lt;/script&gt;&#xA;&#xA;&#xA;&#xA;

    &#xA;

    I tried with websocket but I didn't succeed.&#xA;The video is correctly created and when I reload the page the new video is played by the player.

    &#xA;

    However I would have been able to see the live stream without having to reload my page all the time.

    &#xA;