Recherche avancée

Médias (1)

Mot : - Tags -/publishing

Autres articles (45)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (7201)

  • How to save srt file with a video to be part of the video ?

    14 septembre 2023, par abdallah mostafa

    I've an application that generate srt file for a video with AI but I want to save the video to user's storage with the srt subtitle burned on the video not just embedded.

    


    this is the response form the API

    


    "fotmated_subtitle": [
        {
            "display_text": "You know those cat are memes that everybody uses in their videos and the TV movie clips that people use.",
            "interval": [
                "0:00:00.000",
                "0:00:04.000"
            ]
        },
        {
            "display_text": "Well, who are the four best free websites to find a move?",
            "interval": [
                "0:00:04.000",
                "0:00:06.240"
            ]
        }
    ]


    


    I could add this as a widget over the video that would change accourding to intervals.
I want to know How to save that video with the subtitle

    


     Future<void> saveSubtitle() async {&#xA;    emit(ExportSubtitleLoading());&#xA;    String subtitleFilter = "";&#xA;    for (var subtitle in subtitles!.fotmatedSubtitle!) {&#xA;      String startTime = subtitle.interval![0];&#xA;      String endTime = subtitle.interval![1];&#xA;      String text = subtitle.displayText!;&#xA;      subtitleFilter &#x2B;=&#xA;          "drawtext=text=&#x27;$text&#x27;:enable=&#x27;between(t,$startTime,$endTime)&#x27;:x=(w-text_w)/2:y=h-30:fontsize=24:fontcolor=white,";&#xA;    }&#xA;&#xA;    final dir = await getTemporaryDirectory();&#xA;    String outputPath = &#x27;${dir.path}/ex_vid.mp4&#x27;;&#xA;    final arguments = [&#xA;      &#x27;-i&#x27;,&#xA;      inputFile,&#xA;      &#x27;-vf&#x27;,&#xA;      subtitleFilter,&#xA;      &#x27;-c:v&#x27;,&#xA;      &#x27;libx264&#x27;,&#xA;      &#x27;-c:a&#x27;,&#xA;      &#x27;copy&#x27;,&#xA;      outputPath&#xA;    ];&#xA;    (arguments.join(&#x27; &#x27;)).logger;&#xA;    &#x27;==============&#x27;.logger;&#xA;    await FFmpegKit.execute(arguments.join(&#x27; &#x27;)).then((session) async {&#xA;      final returnCode = await session.getReturnCode();&#xA;&#xA;      if (ReturnCode.isSuccess(returnCode)) {&#xA;        (&#x27;The Converstion is Success&#x27;).logger;&#xA;        emit(ExportSubtitleSuccess());&#xA;      } else if (ReturnCode.isCancel(returnCode)) {&#xA;        // CANCEL&#xA;        (&#x27;The Converstion is Cancelled&#x27;).logger;&#xA;      } else {&#xA;        emit(ExportSubtitleerror());&#xA;        (&#x27;The Converstion Have an Error&#x27;).logger;&#xA;      }&#xA;    });&#xA;  }&#xA;</void>

    &#xA;

    I've tested this method but still does not worked

    &#xA;

    here is the full command

    &#xA;

        String command =&#xA;        "-y -i /data/user/0/com.amaa.aistudio/cache/file_picker/Blink-96bdc94a-17df-4f64-b560-90811a44c4f8-Original.mp4 -vf \"drawtext=text=&#x27;You know those cat are memes that everybody uses in their videos and the TV movie clips that people use.&#x27;:enable=&#x27;between(t,0,4.000)&#x27;:x=(w-text_w)/2:y=h-30:fontsize=24:fontcolor=white,drawtext=text=&#x27;Well, who are the four best free websites to find a move?&#x27;:enable=&#x27;between(t,4.000,6.240)&#x27;:x=(w-text_w)/2:y=h-30:fontsize=24:fontcolor=white\" -c:v libx264 -c:a copy /data/user/0/com.amaa.aistudio/cache/ex_vid.mp4";&#xA;

    &#xA;

    also here is the logs

    &#xA;

     FFmpegKit log message: isom&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     minor_version   :&#xA;[log] FFmpegKit log message: 512&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     compatible_brands:&#xA;[log] FFmpegKit log message: isomiso2avc1mp41&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     comment         :&#xA;[log] FFmpegKit log message: vid:v0f044gc0000cj6mnmrc77u1oq5pn100&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     aigc_info       :&#xA;[log] FFmpegKit log message: {"aigc_label_type": 0}&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     encoder         :&#xA;[log] FFmpegKit log message: Lavf58.76.100&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:   Duration:&#xA;[log] FFmpegKit log message: 00:00:35.66&#xA;[log] FFmpegKit log message: , start:&#xA;[log] FFmpegKit log message: 0.000000&#xA;[log] FFmpegKit log message: , bitrate:&#xA;[log] FFmpegKit log message: 1239 kb/s&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:   Stream #0:0&#xA;[log] FFmpegKit log message: [0x1]&#xA;[log] FFmpegKit log message: (und)&#xA;[log] FFmpegKit log message: : Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 576x1024 [SAR 1:1 DAR 9:16], 1102 kb/s&#xA;[log] FFmpegKit log message: ,&#xA;[log] FFmpegKit log message: 47.78 fps,&#xA;[log] FFmpegKit log message: 50 tbr,&#xA;[log] FFmpegKit log message: 12800 tbn&#xA;[log] FFmpegKit log message:  (default)&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     Metadata:&#xA;[log] FFmpegKit log message:       handler_name    :&#xA;[log] FFmpegKit log message: VideoHandler&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:       vendor_id       :&#xA;[log] FFmpegKit log message: [0][0][0][0]&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:   Stream #0:1&#xA;[log] FFmpegKit log message: [0x2]&#xA;[log] FFmpegKit log message: (und)&#xA;[log] FFmpegKit log message: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s&#xA;[log] FFmpegKit log message:  (default)&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:     Metadata:&#xA;[log] FFmpegKit log message:       handler_name    :&#xA;[log] FFmpegKit log message: SoundHandler&#xA;[log] FFmpegKit log message:&#xA;[log] FFmpegKit log message:       vendor_id       :&#xA;[log] FFmpegKit log message: [0][0][0][0]&#xA;[log] FFmpegKit log message:&#xA;FFmpegKit log message: [Parsed_drawtext_0 @ 0xb4000077140d5380] Cannot find a valid font for the family Sans&#xA;[log] FFmpegKit log message: [AVFilterGraph @ 0xb4000077a5e0afe0] Error initializing filters&#xA;[log] FFmpegKit log message: Error reinitializing filters!&#xA;[log] FFmpegKit log message: Failed to inject frame into filter network: No such file or directory&#xA;[log] FFmpegKit log message: Error while processing the decoded data for stream #0:0&#xA;[log] FFmpegKit log message: Conversion failed!&#xA;

    &#xA;

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

  • 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