Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (35)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

Sur d’autres sites (7233)

  • avcodec/movtextdec : Skip empty styles

    17 octobre 2020, par Andreas Rheinhardt
    avcodec/movtextdec : Skip empty styles
    

    They would either lead to unnecessary ASS tags being emitted (namely
    tags that are reset immediately thereafter) or would lead to problems
    when parsing : e.g. if a zero-length style immediately follows another
    style, the current code will end the preceding style and set the
    zero-length style as the next potentially active style, but it is only
    tested for activation when the next character is parsed at which point
    the current offset is already greater than both the starting as well
    as the end offset of the empty style. It will therefore neither be
    opened nor closed and all subsequent styles will be ignored.

    Reviewed-by : Philip Langdale <philipl@overt.org>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/movtextdec.c
  • C# File.Move creates an empty file and IO exception

    30 novembre 2020, par Maddie

    My code processes a video file (using ffmpeg) and creates different qualities (360p, 480p, etc) and formats (mp4 and HLS) of that. After creating these files, I move all of them to another drive (a network location).

    &#xA;

    my code looks Like this :

    &#xA;

    var files = Directory.GetFiles(srcFolder);&#xA;string filename, destFile = string.Empty, srcFile = string.Empty;&#xA;try&#xA;{&#xA;    for (int i = 0; i &lt; files.Length; i&#x2B;&#x2B;)&#xA;    {&#xA;        srcFile = files[i];&#xA;        filename = Path.GetFileName(srcFile);&#xA;        destFile = Path.Combine(destFolder, filename);&#xA;        File.Move(srcFile, destFile);&#xA;    }&#xA;}&#xA;catch&#xA;{&#xA;    _logger.LogError("Error in moving file. srcFile: {0}, destFile: {1}", destFile, srcFile);&#xA;    throw;&#xA;}&#xA;

    &#xA;

    This process works fine most of the time, but for some files, I get an IO exception every time I run this process.

    &#xA;

    &#xA;

    System.IO.IOException : The file exists. at System.IO.FileSystem.MoveFile(String sourceFullPath, String destFullPath, Boolean overwrite)

    &#xA;

    &#xA;

    I made sure that destFolder does not exist before, nor did the destFile.

    &#xA;

    After logging the error and finding the path of source and target files, I downloaded both of them. The source file is a .ts file with a size of 1,048 KB, and the target file is an empty file with the same name (0KB).

    &#xA;

    This error happened multiple times with the same video, so I assume that it has something to do with the file itself. But I cannot figure it out.

    &#xA;

  • ffmpeg how to ignore initial empty audio frames when decoding to loop a sound

    1er décembre 2020, par cs guy

    I am trying to loop a ogg sound file. The goal is to make a loopable audio interface for my mobile app.

    &#xA;

    I decode the given ogg file into a buffer and that buffer is sent to audio card for playing. All good until it the audio finishes (end of file). When it finishes I use av_seek_frame(avFormatContext, streamInfoIndex, 0, AVSEEK_FLAG_FRAME); to basically loop back to beginning. And continue decoding into writing to the same buffer. At first sight I thought this would give me perfect loops. One problem I had was, the decoder in the end gives me extra empty frames. So I ignored them by keeping track of how many samples are decoded :

    &#xA;

    durationInMillis = avFormatContext->duration * 1000;&#xA;numOfTotalSamples =&#xA;                (uint64_t) avFormatContext->duration *&#xA;                (uint64_t) pLocalCodecParameters->sample_rate *&#xA;                (uint64_t) pLocalCodecParameters->channels /&#xA;                (uint64_t) AV_TIME_BASE;&#xA;

    &#xA;

    When the threshold is reached I ignore the frames sent by the codec. I thought this was it and ran some test. I recorded 5 minutes of my app and in the end I compared the results in FL studio by customly adding the same sound clip several times to match the length of my audio recording :

    &#xA;

    Here it is after 5 minutes :

    &#xA;

    enter image description here

    &#xA;

    In the first loops the difference is very low I thought it was working and I used this for several days until I tested this on 5 minute recording. As the looping approached to 5 minutes mark the difference got very huge. My code is not looping the audio correctly. I suspect that the codec is adding 1 or 2 empty frames at the very beginning in each loop caused by av_seek_frame knowing that a frame can contain up several audio samples. These probably accumulate and cause the mismatch.

    &#xA;

    My question is : how can I drop the empty frames that is sent by codec while decoding so that I can create a perfect loop of the audio ?

    &#xA;

    My code is below here. Please be aware that I deleted lots of if checks that was inteded for safety to make it more readable in the code below, these removed checks are always false so it doesnt matter for the reader.

    &#xA;

    helper.cpp

    &#xA;

    int32_t&#xA;outputAudioFrame(AVCodecContext *avCodecContext, AVFrame *avResampledDecFrame, int32_t &amp;ret,&#xA;                 LockFreeQueue<float> *&amp;buffer, int8_t *&amp;mediaLoadPointer,&#xA;                 AVFrame *avDecoderFrame, SwrContext *swrContext,&#xA;                 std::atomic_bool *&amp;signalExitFuture,&#xA;                 uint64_t &amp;currentNumSamples, uint64_t &amp;numOfTotalSamples) {&#xA;    // resampling is done here but its boiler code so I removed it.&#xA;    auto *floatArrPtr = (float *) (avResampledDecFrame->data[0]);&#xA;&#xA;    int32_t numOfSamples = avResampledDecFrame->nb_samples * avResampledDecFrame->channels;&#xA;&#xA;    for (int32_t i = 0; i &lt; numOfSamples; i&#x2B;&#x2B;) {&#xA;        if (currentNumSamples == numOfTotalSamples) {&#xA;            break;&#xA;        }&#xA;&#xA;        buffer->push(*floatArrPtr);&#xA;        currentNumSamples&#x2B;&#x2B;;&#xA;        floatArrPtr&#x2B;&#x2B;;&#xA;    }&#xA;&#xA;    return 0;&#xA;}&#xA;&#xA;&#xA;&#xA;int32_t decode(int32_t &amp;ret, AVCodecContext *avCodecContext, AVPacket *avPacket,&#xA;               LockFreeQueue<float> *&amp;buffer,&#xA;               AVFrame *avDecoderFrame,&#xA;               AVFrame *avResampledDecFrame,&#xA;               std::atomic_bool *&amp;signalExitFuture,&#xA;               int8_t *&amp;mediaLoadPointer, SwrContext *swrContext,&#xA;               uint64_t &amp;currentNumSamples, uint64_t &amp;numOfTotalSamples) {&#xA;   &#xA;    ret = avcodec_send_packet(avCodecContext, avPacket);&#xA;    if (ret &lt; 0) {&#xA;        LOGE("decode: Error submitting a packet for decoding %s", av_err2str(ret));&#xA;        return ret;&#xA;    }&#xA;&#xA;    // get all the available frames from the decoder&#xA;    while (ret >= 0) {&#xA;&#xA;        // submit the packet to the decoder&#xA;        ret = avcodec_receive_frame(avCodecContext, avDecoderFrame);&#xA;        if (ret &lt; 0) {&#xA;            // those two return values are special and mean there is no output&#xA;            // frame available, but there were no errors during decoding&#xA;            if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) {&#xA;                //LOGD("avcodec_receive_frame returned special %s", av_err2str(ret));&#xA;                return 0;&#xA;            }&#xA;&#xA;            LOGE("avcodec_receive_frame Error during decoding %s", av_err2str(ret));&#xA;            return ret;&#xA;        }&#xA;&#xA;        ret = outputAudioFrame(avCodecContext, avResampledDecFrame, ret, buffer,&#xA;                               mediaLoadPointer, avDecoderFrame, swrContext, signalExitFuture,&#xA;                               currentNumSamples, numOfTotalSamples);&#xA;&#xA;        av_frame_unref(avDecoderFrame);&#xA;        av_frame_unref(avResampledDecFrame);&#xA;&#xA;        if (ret &lt; 0)&#xA;            return ret;&#xA;    }&#xA;&#xA;    return 0;&#xA;}&#xA;</float></float>

    &#xA;

    Main.cpp

    &#xA;

    while (!*signalExitFuture) {&#xA;            while ((ret = av_read_frame(avFormatContext, avPacket)) >= 0) {&#xA;&#xA;                ret = decode(ret, avCodecContext, avPacket, buffer, avDecoderFrame,&#xA;                             avResampledDecFrame, signalExitFuture,&#xA;                             mediaLoadPointer, swrContext,&#xA;                             currentNumSamples, numOfTotalSamples);&#xA;&#xA;                // The packet must be freed with av_packet_unref() when it is no longer needed.&#xA;                av_packet_unref(avPacket);&#xA;&#xA;                if (ret &lt; 0) {&#xA;                    LOGE("Error! %s", av_err2str(ret));&#xA;&#xA;                    goto cleanup;&#xA;                }&#xA;            }&#xA;&#xA;            if (ret == AVERROR_EOF) {&#xA;&#xA;                ret = av_seek_frame(avFormatContext, streamInfoIndex, 0, AVSEEK_FLAG_FRAME);&#xA;&#xA;                currentNumSamples = 0;&#xA;                avcodec_flush_buffers(avCodecContext);&#xA;            }&#xA;        }&#xA;

    &#xA;