Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (55)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (6402)

  • Libav (ffmpeg) HW decoding problem with frames at the end of file - missing or corrupted

    25 mars 2020, par Hitokage

    My goal is to utilize HW accelerated decoding (using vdpau, h265 and Nvidia RTX) getting number of frames from video. Everything works unless the frames get to the end of the video. I am getting less frames than I try to decode usually the last but one is missing (I know strange, the last one is OK just not getting all of them) and sometimes neighboring frames are corrupted. I followed the docs regarding end of file situation. Here is the code :

    //getting first packet
    if (!packet.data)
     av_read_frame(formatContext, & packet);

    AVFrame * frame = av_frame_alloc();
    if (!frame)
     throw std::runtime_error("Cannot allocate packet/frame");

    //now trying to get frames from the video
    for (int i = 0; i < number; i++) {
     int err = 0;
     //feeding the codec
     while (err == 0) {
       if (packet.stream_index == videoStreamId)
         if ((err = avcodec_send_packet(codecContext, & packet)) != 0)
           break;

       av_packet_unref( & packet);
       err = av_read_frame(formatContext, & packet);
       //sending null packet to flush the buffers
       if (err == AVERROR_EOF) {
         packet.data = NULL;
         packet.size = 0;
       }
     }

     bool waitForFrame = true;
     while (waitForFrame) {
       int err = avcodec_receive_frame(codecContext, frame);
       if (err == AVERROR_EOF)
         waitForFrame = false;

       else if (err < 0)
         throw std::runtime_error("Cannot receive frame");

       if (frame -> format == pixFmt)
       //I get here only number-1 times

    Please note that the problem is happening only when I request the same number of frames as is the length of the video. Seems like the end of file situation is not handled properly. The frames get decoded ok if I try to get for example length-1 frames.

    I also tried to log the events and everything looks OK, just one frame is not there. This is a case where 64 frames long video is being decoded asking for 64 frames :

    Send packet 0 == 0
    Read frame status: Success
    Send packet 1 == 0
    Read frame status: Success
    Send packet 2 == 0
    Read frame status: Success
    Send packet 3 == 0
    Read frame status: Success
    Send packet 4 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:0
    Send packet 4 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:1
    Send packet 4 == 0
    Read frame status: Success
    Send packet 5 == 0
    Read frame status: Success
    Send packet 6 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:2
    Send packet 6 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:3

    ...
    Processing frame:56
    Send packet 60 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:57
    Send packet 60 == 0
    Read frame status: Success
    Send packet 61 == 0
    Read frame status: Success
    Send packet 62 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:58
    Send packet 62 !=0
    Send packet status: Resource temporarily unavailable
    Processing frame:59
    Send packet 62 == 0
    Read frame status: Success
    Send packet 63 == 0
    Read frame status: End of file
    Set null packet
    Processing frame:60
    Send packet 64 == 0
    Read frame status: End of file
    Set null packet
    Processing frame:61
    Send packet 65 !=0
    Send packet status: End of file
    Processing frame:62
    Send packet 65 !=0
    Send packet status: End of file
    End of file at receive frame
  • avcodec/jpeg2000dec : error check when processing tlm marker

    26 mars 2020, par Gautam Ramakrishnan
    avcodec/jpeg2000dec : error check when processing tlm marker
    

    Validate the value of ST field in the TLM marker of JPEG2000.
    Throw an error when ST takes value of 0b11.

    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/jpeg2000dec.c
  • Writing an MPEG video to S3 using the Lambda FFmpeg Layer

    12 avril 2020, par Gracie

    I am using AWS Lambda with the FFmpeg layer to try and convert an existing local MP4 file (beach.mp4) - that is within my upload deployment zip to S3 - into to MPEG video and then write that file to S3.

    &#xA;&#xA;

    I have used ffprobe, which works, so the FFmpeg layer is setup correctly.

    &#xA;&#xA;

    I am writing a file to S3, but it is blank, only 15 bytes. So doesn't contain the MPEG file created by FFmpeg.

    &#xA;&#xA;

    I think this has something to do with sync or streaming the video file so it can be written, but not sure.

    &#xA;&#xA;

    Here is my code, if anyone could help figure this out :

    &#xA;&#xA;

    const util = require(&#x27;util&#x27;);&#xA;const AWS = require(&#x27;aws-sdk&#x27;);&#xA;const s3 = new AWS.S3();&#xA;const { readFileSync, writeFileSync, unlinkSync, writeFile, readdir } = require(&#x27;fs&#x27;);&#xA;//const fs = require(&#x27;fs&#x27;);&#xA;const path = require(&#x27;path&#x27;);&#xA;const { spawnSync } = require(&#x27;child_process&#x27;);&#xA;&#xA;exports.handler = async (event, context, callback) => {&#xA;&#xA;    const outputBucket = &#x27;mys3bucket&#x27;;&#xA;&#xA;    const mpegcreate = await spawnSync(&#xA;        &#x27;/opt/bin/ffmpeg&#x27;,&#xA;        [&#xA;            &#x27;-i&#x27;,&#xA;            &#x27;beach.mp4&#x27;,&#xA;            &#x27;beach.mpeg&#x27;&#xA;        ]&#xA;    );&#xA;&#xA;    // Write ffmpeg output to a file in /tmp/&#xA;    const writeMPEGFile = util.promisify(writeFile);&#xA;    await writeMPEGFile(&#x27;/tmp/beach.mpeg&#x27;, mpegcreate, &#x27;binary&#x27;);&#xA;    console.log(&#x27;MPEG content written to /tmp/&#x27;);&#xA;&#xA;    // Copy MPEG data to a variable to enable write to S3 Bucket&#xA;    let result = mpegcreate;&#xA;    console.log(&#x27;MPEG Result contents &#x27;, result);&#xA;&#xA;    const vidFile = readFileSync(&#x27;/tmp/beach.mpeg&#x27;);&#xA;&#xA;    // Set S3 bucket details and put MPEG file into S3 bucket from /tmp/&#xA;    const s3 = new AWS.S3();&#xA;    const params = {&#xA;        Bucket: outputBucket,&#xA;        Key: &#x27;beach.mpeg&#x27;,&#xA;        ACL: &#x27;private&#x27;,&#xA;        Body: vidFile&#xA;    };&#xA;&#xA;    // Put MPEG file from AWS Lambda function /tmp/ to an S3 bucket&#xA;    const s3Response = await s3.putObject(params).promise();&#xA;    callback(null, s3Response);&#xA;&#xA;};&#xA;

    &#xA;