Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (68)

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

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6734)

  • Anomalie #4623 : Styles des fieldset dans l’espace privé

    17 avril 2021

    Un peu d’archéologie :

    La classe ".editer_type_fieldset" est Introduite là, là https://git-mirror.spip.net/spip/spip/-/commit/31ff8a5d58c4 avec un message de commit peu explicite (il y a les changements de en h3.legend aussi) donc ça doit concerner les facilités de stylages.

    Sur ce commit, "editer_type_fieldset" est conservé (le seul, pour compat ie6 et 7), alors que tous les autres ".editer_type_input" "editer_type_select" et autres ont été supprimés.
    https://git-mirror.spip.net/spip/spip/-/commit/f60b051a98

    Remplacé ensuite de .editer.editer_type_fieldset+ fieldset en .editer.fieldet + fieldset qui sert a priori a enlever le padding du .editer
    https://git-mirror.spip.net/spip/spip/-/commit/e78936ec8

  • Anomalie #4623 : Styles des fieldset dans l’espace privé

    16 avril 2021, par RastaPopoulos ♥

    Je mets ici un essai fait un peu à l’arrache hier dans le navigateur que j’ai peaufiné un peu ce matin.

    Les arguments qui vont avec :

    • Je pense que c’est plus léger visuellement à la fois que le master et que dans la branche de cette PR, y compris pour les groupes racines, car il n’y a pas de coupure horizontale. Quand l’œil parcourt de haut en bas, il n’est pas bloqué par des bordures horizontales qui font que l’esprit s’arrête un instant.
    • Les groupes doivent tous être matérialisés par un début et une fin, y compris les groupes racines : il peut y avoir des champs hors groupe après n’importe quel fieldset, et donc on doit savoir où finit un fieldset.
    • Là je matérialise avec une fine ligne de la couleur du thème, que je fais terminer en dégradé vers le transparent afin de ce soit plus doux (ce n’est pas une border mais une background-image gradient de 1px)
    • De cette manière on voit à la fois le début et la fin, sans coupure de lecture, et avec une indication de 1px seulement. Notamment les groupes racines ne sont pas décalés du tout par rapport au reste : l’indication de 1px se superpose à la bordure existante des formulaires. Ainsi comme on le voit, les champs intérieur au premier groupe racine sont pile au même niveau que les champs en dehors du groupe.

    Commentaire supplémentaire : cette légère matérialisation ne se base pas sur la couleur mais sur la luminosité, ainsi ça marche même si on est daltonien. Pour appuyer on peut utiliser spip-color-theme-dark, ou si on veut faire plus neutre, on pourrait aussi virer totalement la couleur et utiliser spip-color-gray-dark aussi bien pour la ligne dégradé que pour le legend. Le principe restant le même.

    Version monochrome avec spip-color-gray-dark (plus foncé que précédemment), on voit quand même pas mal la diff à tous les niveaux.

  • FFmpeg encoding aac audio, encoded file can not be played

    9 décembre 2020, par cs guy

    I am trying to encodea aac audio. Example of MP2 here. I followed this documentation. I encode the audio with the code below by calling startEncoding and after 2 seconds I call stopEncoding. Everything seems to work fine I get an file with some size but the problem is I can not open or play it. I dont know why. I must be doing something wrong in the code.

    


    header :

    


    class MediaEncoder {&#xA;public:&#xA;    MediaEncoder(char *filePath);&#xA;&#xA;    void startEncoding();&#xA;    void stopEncoding();&#xA;&#xA;    void encode(AVFrame *frame);&#xA;    bool isEncoding() const;&#xA;&#xA;    void startEncoderWorker();&#xA;&#xA;    int32_t check_sample_fmt(enum AVSampleFormat sample_fmt);&#xA;    &#xA;    bool signalExitFuture = false;&#xA;    int32_t ret;&#xA;&#xA;private:&#xA;    std::future<void> encodingFuture;&#xA;    AVCodecContext *avCodecContext;&#xA;    AVFrame *avFrame;&#xA;    AVPacket *avPacket;&#xA;    AVCodec *codec;&#xA;    FILE* file;&#xA;};&#xA;</void>

    &#xA;

    cpp :

    &#xA;

    MediaEncoder::MediaEncoder(char *filePath){&#xA;    buffer = std::make_unique>(recorderBufferSize);&#xA;&#xA;    /* find the encoder */&#xA;    codec = avcodec_find_encoder(AV_CODEC_ID_AAC);&#xA;    avCodecContext = avcodec_alloc_context3(codec);&#xA;&#xA;    avCodecContext->bit_rate = 64000;&#xA;&#xA;    /* check that the encoder supports given sample format */&#xA;    avCodecContext->sample_fmt = AVSampleFormat::AV_SAMPLE_FMT_FLTP;&#xA;    &#xA;    /* select other audio parameters supported by the encoder */&#xA;    avCodecContext->sample_rate = defaultSampleRate;&#xA;    avCodecContext->channel_layout = AV_CH_LAYOUT_STEREO;&#xA;    avCodecContext->channels = av_get_channel_layout_nb_channels(avCodecContext->channel_layout);&#xA;&#xA;    /* open it */&#xA;    avcodec_open2(avCodecContext, codec, nullptr)&#xA;    &#xA;    file = fopen(filePath, "wb");&#xA;    &#xA;    /* packet for holding encoded output */&#xA;    avPacket = av_packet_alloc();&#xA;    &#xA;    /* frame containing input raw audio */&#xA;    avFrame = av_frame_alloc();&#xA;    &#xA;    avFrame->nb_samples = avCodecContext->frame_size;&#xA;    avFrame->format = avCodecContext->sample_fmt;&#xA;    avFrame->channel_layout = avCodecContext->channel_layout;&#xA;&#xA;    /* allocate the data buffers */&#xA;    av_frame_get_buffer(avFrame, 0);&#xA;}&#xA;&#xA;&#xA;void MediaEncoder::startEncoding() {&#xA;    // set flags for decoding thread&#xA;    signalExitFuture = false;&#xA;&#xA;    encodingFuture = std::async(std::launch::async, &amp;MediaEncoder::startEncoderWorker, this);&#xA;}&#xA;&#xA;void MediaEncoder::stopEncoding() {&#xA;    signalExitFuture = true;&#xA;}&#xA;&#xA;bool MediaEncoder::isEncoding() const {&#xA;    return !signalExitFuture;&#xA;}&#xA;&#xA;void MediaEncoder::encode(AVFrame *frame) {&#xA;    /* send the frame for encoding */&#xA;    ret = avcodec_send_frame(avCodecContext, frame);&#xA;    if (ret &lt; 0) {&#xA;        LOGE("Error sending the frame to the encoder %s",&#xA;             av_err2str(ret));&#xA;        *recorderStatePointer = MediaEncoderState::RUNTIME_FAIL;&#xA;        return;&#xA;    }&#xA;&#xA;    /* read all the available output packets (in general there may be any&#xA;     * number of them */&#xA;    while (ret >= 0) {&#xA;        ret = avcodec_receive_packet(avCodecContext, avPacket);&#xA;        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;            return;&#xA;        } else if (ret &lt; 0) {&#xA;            LOGE("Error encoding audio frame %s",&#xA;                 av_err2str(ret));&#xA;            *recorderStatePointer = MediaEncoderState::RUNTIME_FAIL;&#xA;            return;&#xA;        }&#xA;       &#xA;        /* Solution begins here&#xA;        int aac_profile = 2;           // AAC LC&#xA;        int frequencey_index = 4;      // 44,100Hz&#xA;        int channel_configuration = 2; // stereo (left, right)&#xA;&#xA;        int frame_length = avPacket->size &#x2B; 7;              // your frame length&#xA;     &#xA;        unsigned char adts_header[7];&#xA;&#xA;        // fill in ADTS data&#xA;        adts_header[0] = (unsigned char) 0xFF;&#xA;        adts_header[1] = (unsigned char) 0xF9;&#xA;        adts_header[2] = (unsigned char) (((aac_profile -1) &lt;&lt; 6 ) &#x2B; (frequencey_index &lt;&lt; 2) &#x2B; (channel_configuration >> 2));&#xA;        adts_header[3] = (unsigned char) (((channel_configuration &amp; 3) &lt;&lt; 6) &#x2B; (frame_length >> 11));&#xA;        adts_header[4] = (unsigned char) ((frame_length &amp; 0x7FF) >> 3);&#xA;        adts_header[5] = (unsigned char) (((frame_length &amp; 7) &lt;&lt; 5) &#x2B; 0x1F);&#xA;        adts_header[6] = (unsigned char) 0xFC;&#xA;&#xA;        fwrite(adts_header, 1, 7, file); &#xA;        Solution ends here */ &#xA;        fwrite(avPacket->data, 1, avPacket->size, file);&#xA;        av_packet_unref(avPacket);&#xA;    }&#xA;}&#xA;&#xA;void MediaEncoder::startEncoderWorker() {&#xA;    try {&#xA;        float *leftChannel;&#xA;        float *rightChannel;&#xA;        float val;&#xA;&#xA;        while (!signalExitFuture) {&#xA;            ret = av_frame_make_writable(avFrame);&#xA;            if (ret &lt; 0) {&#xA;                LOGE("av_frame_make_writable Can not Ensure that the frame data is writable. %s",&#xA;                     av_err2str(ret));&#xA;                *recorderStatePointer = MediaEncoderState::RUNTIME_FAIL;&#xA;                return;&#xA;            }&#xA;&#xA;            leftChannel = (float *) avFrame->data[0];&#xA;            rightChannel = (float *) avFrame->data[1];&#xA;&#xA;            for (int32_t i = 0; i &lt; avCodecContext->frame_size; &#x2B;&#x2B;i) {&#xA;               &#xA;                leftChannel[i] = 0.4;&#xA;                rightChannel[i] = 0.4;&#xA;            }&#xA;&#xA;            encode(avFrame);&#xA;        }&#xA;&#xA;        /* flush the encoder */&#xA;        encode(nullptr);&#xA;&#xA;        fclose(file);&#xA;        LOGE("Encoding finished!");&#xA;&#xA;        av_frame_free(&amp;avFrame);&#xA;        av_packet_free(&amp;avPacket);&#xA;        avcodec_free_context(&amp;avCodecContext);&#xA;    } catch (std::exception &amp;e) {&#xA;        LOGE("startEncoderWorker uncaught exception %s", e.what());&#xA;    }&#xA;&#xA;    LOGE("Deleting Media Encoder!");&#xA;&#xA;}&#xA;

    &#xA;

    Here is an recorded 11 seconds of an aac file recorded with real float pcm data rather than 0.4 as it is in the code I posted. Google Drive Link

    &#xA;

    The code above works. Thanks to the legend @Markus-Schumann

    &#xA;