Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (58)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6783)

  • "Critical error detected c0000374" when running av_packet_unref or av_frame_unref

    15 mai 2021, par Shivang Sharma

    I am trying to read and decode frames which is happening nicely but when its reaching part of un-referencing frame or packet using av_packet_unref and av_frame_unref it is giving error during second frame or third frame sometimes .

    


    Error (Copied from visual studio output window) :

    


    Critical error detected c0000374
Libav.exe has triggered a breakpoint


    


    Here is some code of reading and decoding which is giving error :

    


    void Decoder::streamNextFrame(int type = 0)
{
    while (av_read_frame(this->fileFormatCtx, this->latestpacket) >= 0) {
        if (this->audioDecoder->activeAudioStream != nullptr) {
            if (this->latestpacket->stream_index == this->audioDecoder->activeAudioStream->index) {
                avcodec_send_packet(this->audioDecoder->activeStreamDecoder, this->latestpacket);
                err = avcodec_receive_frame(this->audioDecoder->activeStreamDecoder, this->decodedFrame);
                if (err == AVERROR(EAGAIN)) {
                    av_frame_unref(this->decodedFrame);
                    av_packet_unref(this->latestpacket);
                    continue;
                }

                {
                    int currentIndex = (int)this->audioFrames->size();
                    this->audioFrames->resize((int)this->audioFrames->size() + 1);
                    int nb = 0;
                    this->audioFrames->at(currentIndex).pts = (int)this->decodedFrame->pts;
                    if (this->audioDecoder->activeStreamDecoder->sample_fmt != AV_SAMPLE_FMT_S16) {
                        nb = 2048 * this->audioDecoder->activeStreamDecoder->channels;
                        printf("%i\n", nb);
                        this->audioFrames->at(currentIndex).data.resize(nb);
                        if (!swr_is_initialized(swr)) {

                            swr_alloc_set_opts(swr, this->audioDecoder->activeStreamDecoder->channel_layout, AV_SAMPLE_FMT_S16, this->audioDecoder->activeStreamDecoder->sample_rate, this->audioDecoder->activeStreamDecoder->channel_layout, this->audioDecoder->activeStreamDecoder->sample_fmt, this->audioDecoder->activeStreamDecoder->sample_rate, 0, nullptr);
                            swr_init(swr);
                        }

                        uint8_t* buffer = this->audioFrames->at(currentIndex).data.data();
                        swr_convert(swr, &buffer, nb, (const uint8_t**)this->decodedFrame->extended_data, this->decodedFrame->nb_samples);
                    }
                    else {
                        nb = this->decodedFrame->nb_samples * this->audioDecoder->activeStreamDecoder->channels;
                        this->audioFrames->at(currentIndex).data = std::vector(*this->decodedFrame->extended_data, *this->decodedFrame->extended_data + (uint8_t)nb);
                    }

                    this->audioFrames->at(currentIndex).buffersize = nb;
                }

                if (err == AVERROR_EOF) {
                    this->audioDecoder->streamEnded = true;
                    av_frame_unref(this->decodedFrame);
                    av_packet_unref(this->latestpacket);
                    break;
                }
                else if (err >= 0) {
                    this->audioDecoder->streamEnded = false;
                }

                if (type != 0) {
                    av_packet_unref(this->latestpacket);
                    av_frame_unref(this->decodedFrame);
                    break;
                }
                av_packet_unref(this->latestpacket);
                av_frame_unref(this->decodedFrame);
            }
        }
        else {
            printf("No active audio stream is set\n");
            if(type!=0)
            break;
        }
    }

}


    


    I have removed some of code which was concerning the video and was not giving problem I think.

    


    Some Information about above code :

    


    this->audioFrames is a pointer to vector with following type.&#xA;std::vector<audioframeformat>* "AudioFrameFormat" is struct defined as following&#xA;&#xA;struct AudioFrameFormat {&#xA;        std::vector data = {};&#xA;        int pts = 0;&#xA;        int buffersize = 0;&#xA;    };&#xA;&#xA;&#xA;swr is a private class member allocated in constructor&#xA;</audioframeformat>

    &#xA;

    Call Stack looks like :

    &#xA;

    enter image description here

    &#xA;

    I am getting from call stack is that I am not taking care of my heap memory.

    &#xA;

    Can someone please explain where problem is and, why some times it run till third frame and some time till second frame of the audio stream ?

    &#xA;

    And please tell how can I improve this code.

    &#xA;

  • FFmpeg giving a wierd "Permission denied" error (Digitalocean VPS Ubuntu 18.04)

    10 mai 2021, par DJ Danny

    I've set up a VPS server on Digitalocean. Installed Ubuntu 18.04, LAMP, etc.&#xA;Finally, I installed ffmpeg. It is working fine from terminal but when I try to execute it through php it gives a weird "Permission denied" error :

    &#xA;

    Here is some information :

    &#xA;root@vl :/# whereis ffmpeg
    &#xA;ffmpeg : /usr/local/bin/ffmpeg
    &#xA;root@vl :/# whereis ffprobe
    &#xA;ffprobe : /usr/local/bin/ffprobe

    &#xA;

    root@vl :/# ffmpeg -version
    &#xA;ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers&#xA;built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04)&#xA;configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree&#xA;libavutil 57. 0.100 / 57. 0.100&#xA;libavcodec 59. 1.100 / 59. 1.100&#xA;libavformat 59. 0.101 / 59. 0.101&#xA;libavdevice 59. 0.100 / 59. 0.100&#xA;libavfilter 8. 0.101 / 8. 0.101&#xA;libswscale 6. 0.100 / 6. 0.100&#xA;libswresample 4. 0.100 / 4. 0.100&#xA;libpostproc 56. 0.100 / 56. 0.100&#xA;

    &#xA;

    My php file :

    &#xA;&#xA;echo shell_exec("ffmpeg -i mj.gif -profile:v baseline -pix_fmt yuv420p -vf scale=600 :-2 output.mp4 2>&1")
    &#xA; ?>

    &#xA;

    The ERROR ! :
    &#xA;ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04) configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree libavutil 57. 0.100 / 57. 0.100 libavcodec 59. 1.100 / 59. 1.100 libavformat 59. 0.101 / 59. 0.101 libavdevice 59. 0.100 / 59. 0.100 libavfilter 8. 0.101 / 8. 0.101 libswscale 6. 0.100 / 6. 0.100 libswresample 4. 0.100 / 4. 0.100 libpostproc 56. 0.100 / 56. 0.100 Input #0, gif, from 'mj.gif' : Duration : 00:00:01.60, start : 0.000000, bitrate : 22863 kb/s Stream #0:0 : Video : gif, bgra, 1400x1050, 10 fps, 10 tbr, 100 tbn output.mp4 : Permission denied&#xA;

    &#xA;From the past 24 hours I've tried installing ffmpeg in different ways (compiling & apt install), I've also tried changing the permission but still I'm stuck with this error.
    &#xA;Any help would be highly appreciated !
    &#xA;Thanks

    &#xA;

  • Getting error "WebAssembly.Memory() : could not allocate memory" when running ffmpeg.wasm on android chrome browser

    27 juin 2022, par Ravi Kundu

    Error in detail :

    &#xA;

    WebAssembly.Memory(): could not allocate memory&#xA;at https://*******/ffmpeg-core.js:22:82&#xA;at https://*******/ffmpeg.min.js:1:6506&#xA;at f (https://*******/ffmpeg.min.js:1:11322)&#xA;at Generator._invoke (https://*******/ffmpeg.min.js:1:11110)&#xA;at Generator.next (https://*******/ffmpeg.min.js:1:11747)&#xA;at i (https://*******/ffmpeg.min.js:1:4295)&#xA;at c (https://*******/ffmpeg.min.js:1:4498)&#xA;

    &#xA;

    Code for ffmpeg :

    &#xA;

    const downloadWithFFMPEG = async () =>{&#xA;  const sourceBuffer = await fetch(recordingURL).then(r => r.arrayBuffer());&#xA;  await ffmpeg.load();&#xA;  await ffmpeg.FS(&#xA;    "writeFile",&#xA;    "input.webm",&#xA;    new Uint8Array(sourceBuffer, 0, sourceBuffer.byteLength)&#xA;  );&#xA;  await ffmpeg.run("-i", "input.webm", "-c", "copy", "output.mp4")&#xA;  const output = ffmpeg.FS("readFile", "output.mp4");&#xA;  var link = document.createElement(&#x27;a&#x27;)&#xA;  link.href = URL.createObjectURL(new Blob([output.buffer], { type: &#x27;video/mp4;codecs=H264&#x27; }));&#xA;  link.download = this.data;&#xA;  link.click();&#xA;  recording = false;&#xA;}&#xA;

    &#xA;

    Brief about problem :&#xA;The error only comes for android chrome browser. The same code works fine on pc/laptop chrome.&#xA;Have also enabled Webassembly-thread on chrome ://flags for android browser as someone suggested me to do it but still same error. Can someone help me ?

    &#xA;