Recherche avancée

Médias (91)

Autres articles (112)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (12031)

  • Anomalie #4670 : Logo sur la barre typo 3.3

    18 février 2021, par RastaPopoulos ♥

    Je ne reproduis pas non plus, sur Ubuntu et Firefox aussi, même en zoomant à mort avec la molette, même à 400% j’ai aucun recadrage de ce genre.

  • Saving mp3 chunks as a file server-side

    2 août 2022, par Ioannis L.

    I've been working lately on a project which takes a webm file and converts it to mp3 server side. So far I was getting the file, convert it in my server and then send a link to the user from which they could download the file. The user had to wait until the conversion was done.

    


    Recently I came with the idea of streaming the file to the client-side and save it at the same time.

    


    What I want to achieve is this : Stream the file to the client-side (chunk by chunk) and once the file stream has finished which means the conversion on the server has finished as well I can save the file.

    


    I've tried this :

    


    const { PassThrough } = require("stream");
const ffmpeg = require("fluent-ffmpeg");
const { writeFile } = require("fs");

let buffers = [];
const passThrough = new PassThrough();
res.setHeader("Content-Type", "`audio/mpeg");

ffmpeg(stream)
            .noVideo()
            .format("mp3")
            .audioBitrate(256)
            .on("error", (error) => console.log(error))
            .on("end", () => {
              res.end();
              buffers = buffers.join("");
              writeFile(`./files/test.mp3`, buffers, (err) => {
                if (err) console.log(err);
              });
            })
            .writeToStream(passThrough);

          passThrough.on("data", (chunk) => {
            buffers.push(chunk);
            res.write(chunk);
          });


    


    What the issue is ? Let's say I convert a 2.50min webm video.

    


    The file is streamed to the client side successfully and it is being saved as it should. It is also playable and the size of the file is around 5MB.

    


    The file saved on the server though is around 9MB, it is saved as an mp3 file but when I try to listen to it, it gives me this error :

    


    Audacity : "Audacity did not recognize the type of the file. Try installing FFmpeg."

    


    Browser : "No video with supported format and MIME type found."

    


    Windows Media Player : "We cannot open test.mp3. This may be because the file type is unsupported, the file extension is incorrect or the file is corrupt."

    


  • Saving frames from a network camera (RTSP) to a mp4 file

    24 novembre 2015, par Dídac Pérez

    I am quite confused about how to save a video stream into a mp4 file. I am using ffmpeg. Let me explain the problem :

    1. I connect to a network camera via RTSP (H.264 stream) with avformat_open_input(), avformat_find_stream_info(), av_read_play(), and I get frames with av_read_frame().
    2. Each time I get a frame with av_read_frame(), I store the corresponding AVPacket in a circular buffer.
    3. In some points in my application, a range of this circular buffer is selected. I find a key frame used to start from.
    4. Once I have a list of AVPacket’s starting from a key frame, I write header, frames, and tail, as I described below in the code.

    The problem is that the resulting mp4 video has artifacts if I try to watch it using VLC, Windows Media Player, or another one.

    I have also realized that the pts of that packets are not continuous, while dts are continuous. I know about B frames, but is this a problem in my case ?

    // Prepare the output
    AVFormatContext* oc = avformat_alloc_context();
    oc->oformat = av_guess_format(NULL, "video.mp4", NULL);

    // Must write header, packets, and trailing
    avio_open2(&oc->pb, "video.mp4", AVIO_FLAG_WRITE, NULL, NULL);

    // Write header
    AVStream* stream = avformat_new_stream(oc, (AVCodec*) context->streams[video_stream_index]->codec->codec);
    avcodec_copy_context(stream->codec, context->streams[video_stream_index]->codec);
    stream->sample_aspect_ratio = context->streams[video_stream_index]->codec->sample_aspect_ratio;
    avformat_write_header(oc, NULL);

    // FOR EACH FRAME...
    ... av_write_frame(oc, circular[k]); ...

    // Write trailer and close the file
    av_write_trailer(oc);
    avcodec_close(stream->codec);
    avio_close(oc->pb);
    avformat_free_context(oc);

    Thank you so much,