Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (20)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

Sur d’autres sites (5104)

  • the workstation' Image decode and render perform,use same code,worse than laptop

    12 janvier 2024, par karma1995

    i'm working on Image decoding and rendering,trying to develop a software to process and display 4K TIFF and DPX sequence.Developing on my laptop and testing on both laptop and workstation.It's wired that workstaion's performance worse than laptop,my hardware and code information is here :
The information of both machine

    


      

    1. Laptop
platform : windows 11
CPU : Intel I9-13900H 14C 20T
GPU : RTX 4060 Laptop GPU
Mem : 64G
Disk : SSD
    2. 


    3. Workstaton
platform : windows 10
CPU : Intel Xeon 56C 112T
GPU : RTX A6000
Mem : 512
Disk : SSD
IDE
IDE is Qt, version 5.14.0, both on laptop and workstation.
    4. 


    


    For Image decoding, ffmpeg is used

    


    void SeqDecodeTask::run()&#xA;{&#xA;    QElapsedTimer timer;&#xA;    timer.start();&#xA;    SwsContext* swsCtx = nullptr;&#xA;    AVPixelFormat srcFmt = AV_PIX_FMT_NONE;&#xA;    AVPixelFormat dstFmt = AV_PIX_FMT_NONE;&#xA;    AVFormatContext* fmtCtx;&#xA;    const AVCodec* codec;&#xA;    AVCodecContext* codecCtx;&#xA;    AVStream* stream;&#xA;    int index = -1;&#xA;    AVPacket pkt;&#xA;    AVFrame* frame = av_frame_alloc();&#xA;    AVFrame* output = av_frame_alloc();&#xA;    fmtCtx = avformat_alloc_context();&#xA;&#xA;    if(avformat_open_input(&amp;fmtCtx, file_.toUtf8(),&#xA;                           nullptr, nullptr) &lt; 0) {&#xA;        return;&#xA;    }&#xA;    if (avformat_find_stream_info(fmtCtx, nullptr) &lt; 0) {&#xA;        return;&#xA;    }&#xA;    for (unsigned int i = 0; i &lt; fmtCtx->nb_streams; i&#x2B;&#x2B;) {&#xA;        if (fmtCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            index = static_cast<int>(i);&#xA;            continue;&#xA;        }&#xA;    }&#xA;    if (index &lt; 0) {&#xA;        return;&#xA;    }&#xA;    stream = fmtCtx->streams[index];&#xA;    fmtCtx->streams[index]->discard = AVDISCARD_DEFAULT;&#xA;    codecCtx = avcodec_alloc_context3(nullptr);&#xA;    if (avcodec_parameters_to_context(&#xA;                codecCtx,&#xA;                fmtCtx->streams[index]->codecpar) &lt; 0) {&#xA;        return;&#xA;    }&#xA;    codec = avcodec_find_decoder(codecCtx->codec_id);&#xA;    if (codec == nullptr) {&#xA;        return;&#xA;    }&#xA;    if (avcodec_open2(codecCtx, codec, nullptr) &lt; 0) {&#xA;        return;&#xA;    }&#xA;    av_read_frame(fmtCtx, &amp;pkt);&#xA;    avcodec_send_packet(codecCtx, &amp;pkt);&#xA;    avcodec_receive_frame(codecCtx, frame);&#xA;&#xA;    if (srcFmt == AV_PIX_FMT_NONE) {&#xA;        srcFmt = static_cast<avpixelformat>(frame->format);&#xA;    }&#xA;    dstFmt = AV_PIX_FMT_RGBA64LE;&#xA;    cv::Mat mat(cv::Size(frame->width, frame->height), CV_16UC4);&#xA;    if (!(frame->width &lt; 0 || frame->height &lt; 0)) {&#xA;        if (swsCtx == nullptr) {&#xA;            swsCtx = sws_alloc_context();&#xA;            swsCtx = sws_getContext(frame->width,&#xA;                                    frame->height,&#xA;                                    srcFmt,&#xA;                                    frame->width,&#xA;                                    frame->height,&#xA;                                    dstFmt,&#xA;                                    SWS_BICUBIC, nullptr,&#xA;                                    nullptr, nullptr);&#xA;        }&#xA;&#xA;        swsCtx = sws_getContext(frame->width, frame->height,&#xA;                                srcFmt,&#xA;                                frame->width, frame->height,&#xA;                                dstFmt,&#xA;                                SWS_BICUBIC, nullptr, nullptr, nullptr);&#xA;        av_image_fill_arrays(output->data, output->linesize,&#xA;                             static_cast(mat.data),&#xA;                             dstFmt,&#xA;                             frame->width, frame->height, 1);&#xA;        sws_scale(swsCtx, static_cast<const>(frame->data),&#xA;                  frame->linesize, 0, frame->height, output->data, output->linesize);&#xA;    }&#xA;    av_packet_unref(&amp;pkt);&#xA;    av_frame_free(&amp;output);&#xA;    av_frame_free(&amp;frame);&#xA;    sws_freeContext(swsCtx);&#xA;    avcodec_free_context(&amp;codecCtx);&#xA;    avformat_free_context(fmtCtx);&#xA;&#xA;    buffer_->edit(true, item_, index_, file_, mat);&#xA;&#xA;    emit decodeTaskFinished();&#xA;    qDebug() &lt;&lt; "decode time " &lt;&lt; timer.elapsed();&#xA;}&#xA;</const></avpixelformat></int>

    &#xA;

    Simply get the media information, decode, format transform and store in mat.It's a QRunnable class for multithread.

    &#xA;

    For rendering, have tried both QPainter and SceneGraph&#xA;QPainter :

    &#xA;

    void PaintedItemRender::paint(QPainter *painter)&#xA;{&#xA;    QElapsedTimer timer;&#xA;    timer.start();&#xA;    painter->setRenderHint(QPainter::Antialiasing, true);&#xA;    int width = this->width();&#xA;    int height = this->height();&#xA;//    if (defaultWidth_ == NULL || defaultHeight_ == NULL) {&#xA;//        defaultWidth_ = width;&#xA;//        defaultHeight_ = height;&#xA;//    }&#xA;    painter->setBrush(Qt::black);&#xA;    painter->drawRect(0, 0, width, height);&#xA;&#xA;    QImage img = image_.scaled(QSize(width, height), Qt::KeepAspectRatio);&#xA;    /* calculate display position */&#xA;    int x = (this->width() - img.width()) / 2;&#xA;    int y = (this->height() - img.height()) / 2;&#xA;&#xA;    painter->drawImage(QPoint(x, y), img);&#xA;    qDebug() &lt;&lt; "paint time: " &lt;code>

    &#xA;

    SceneGraph

    &#xA;

    QSGNode *SceneGraphRender::updatePaintNode(QSGNode* oldNode,&#xA;                                   QQuickItem::UpdatePaintNodeData* updatePaintNodeData)&#xA;{&#xA;    Q_UNUSED(updatePaintNodeData)&#xA;    QSGSimpleTextureNode* tex = nullptr;&#xA;    QSGTransformNode* trans = nullptr;&#xA;    if(!oldNode) {&#xA;        tex = new QSGSimpleTextureNode;&#xA;        tex->setFlag(QSGNode::OwnsMaterial, true);&#xA;        tex->setFiltering(QSGTexture::Linear);&#xA;        tex->setTexture(window()->createTextureFromImage(image_));&#xA;        tex->setRect(0, 0, width(), height());&#xA;        trans = new QSGTransformNode();&#xA;        if (!image_.isNull()) {&#xA;            float factorW = 1;&#xA;            float factorH = 1;&#xA;            if (image_.width() > width()) {&#xA;                factorH = factorW = width() / image_.width();&#xA;            }&#xA;            else if (image_.height() > height()) {&#xA;                factorW = factorH = height() / image_.height();&#xA;            }&#xA;            else if (image_.width() &lt; width() &amp;&amp; image_.height() &lt; height()) {&#xA;                if (width() - image_.width() &lt; image_.height() - height()) {&#xA;                    factorH = factorW = width() / image_.width();&#xA;                }&#xA;                else {&#xA;                    factorH = factorW = height() / image_.height();&#xA;                }&#xA;            }&#xA;            QMatrix4x4 mat;&#xA;            float scaledW = tex->rect().width() * factorW;&#xA;            float scaledH = tex->rect().height() * factorH;&#xA;            if (width() > scaledW) {&#xA;                mat.translate((width() - tex->rect().width() * factorW) / 2, 0);&#xA;            }&#xA;            if (height() > scaledH) {&#xA;                mat.translate(0, (height() - tex->rect().height() * factorH) / 2);&#xA;            }&#xA;            mat.scale(factorW, factorH);&#xA;            trans->setMatrix(mat);&#xA;            trans->markDirty(QSGNode::DirtyMatrix);&#xA;        }&#xA;        else {&#xA;            scaled_ = true;&#xA;        }&#xA;        trans->appendChildNode(tex);&#xA;    }&#xA;    else {&#xA;        trans = static_cast<qsgtransformnode>(oldNode);&#xA;        tex = static_cast<qsgsimpletexturenode>(trans->childAtIndex(0));&#xA;        QSGTexture* texture = tex->texture();&#xA;        tex->setTexture(window()->createTextureFromImage(image_));&#xA;        tex->setRect(0, 0, image_.width(), image_.height());&#xA;        texture->deleteLater();&#xA;        if(!image_.isNull() &amp;&amp; scaled_) {&#xA;            float factorW = 1;&#xA;            float factorH = 1;&#xA;            if (image_.width() > width()) {&#xA;                factorH = factorW = width() / image_.width();&#xA;            }&#xA;            else if (image_.height() > height()) {&#xA;                factorW = factorH = height() / image_.height();&#xA;            }&#xA;            else if (image_.width() &lt; width() &amp;&amp; image_.height() &lt; height()) {&#xA;                if (width() - image_.width() &lt; image_.height() - height()) {&#xA;                    factorH = factorW = width() / image_.width();&#xA;                }&#xA;                else {&#xA;                    factorH = factorW = height() / image_.height();&#xA;                }&#xA;&#xA;            }&#xA;            QMatrix4x4 mat;&#xA;            float scaledW = tex->rect().width() * factorW;&#xA;            float scaledH = tex->rect().height() * factorH;&#xA;            if (width() > scaledW) {&#xA;                mat.translate((width() - tex->rect().width() * factorW) / 2, 0);&#xA;            }&#xA;            if (height() > scaledH) {&#xA;                mat.translate(0, (height() - tex->rect().height() * factorH) / 2);&#xA;            }&#xA;            mat.scale(factorW, factorH);&#xA;            trans->setMatrix(mat);&#xA;            trans->markDirty(QSGNode::DirtyMatrix);&#xA;            scaled_ = false;&#xA;        }&#xA;    }&#xA;    return trans;&#xA;}&#xA;</qsgsimpletexturenode></qsgtransformnode>

    &#xA;

    Time Usage&#xA;Test image sequence is 4K DPX sequence, 12 bits, RGB.Decode only use one thread ;

    &#xA;

      &#xA;
    1. Laptop&#xA;decoding : around 200ms per frame&#xA;rendering : around 20ms per frame
    2. &#xA;

    3. Workstation&#xA;decoding : over 600ms per frame&#xA;rendering : around 80ms per frame
    4. &#xA;

    &#xA;

    i'm tring to figure out the reason that make performance diffrent and fix it, appreciate for any advice, thank you.

    &#xA;

  • Anomalie #2776 : sélecteur de rubrique

    26 décembre 2017, par jluc -

    En fait c’est le même formulaire que pour déplacer un article d’une rubrique vers une autre, sauf que pour un article, il y a toujours une rubrique (unique) et donc il y a un nom de rubrique dans le cadre grisé (id=’titreparent’). Comme ça c’est clair.

    Mais pour ajouter une rubrique à un admin restreint, comme un admin restreint peut gérer plusieurs rubriques, le squelette choisit de ne rien mettre dans ce cadre grisé. Mais du coup il ne sert à rien, mais donne l’impression de permettre la saisie, et on ne comprend pas.

    Pour le détail, la mise en forme n’est pas la même selon le contexte :
    - pour les admins restreints le texte au dessus "Ajouter une autre rubrique à administrer :" est un simple label
    - pour déplacer un article, le texte au dessus "À l’intérieur de la rubrique" est un h3
    - quand on édite un article, il y a ce même sélecteur de rubrique, et le texte au dessus "À l’intérieur de la rubrique", avec un bouton d’aide, est un simple label aussi, mais stylé en gras.

    Alors je sais pas trop comment proposer qqchose de cohérent pour tous ces contextes et contraintes.

    Basiquement il me semble qu’il serait possible de ne pas afficher le cadre grisé id=’titreparent’ quand il est vide. Ça ne concerne que les admins restreints (pas les articles), et ça éviterait la déception "Ah je ne peux rien saisir ici". Mais comme la loupe est toute seule sur sa ligne, elle devrait aussi remonter sur la même ligne que le label.

    Vu que le label n’est pas dans le formulaire ça semble pas commode.

    Mais pour s’en sortir, on peut, dans le cas administrateur restreint seulement :
    - ne pas avoir le label à l’extérieur mais mettre le texte du label DANS le input #titreparent
    - enlever le grisé de ce input et le décaler un peu à gauche : #titreparentbackground : none ; border : none ; margin-left : 1em ;
    mettre le bouton "loupe" tout à droite : .recherche_rapide_parent float : right ;
    - décaler un peu la zone de résultat : #choix_parent_champ_recherche margin-right : 1em ;

    La capture d’écran montre ce que ça donne avec le sélecteur déployé (mais l’affichage sélecteur replié serait le même pour la partie haute restant affichée).

  • PHP $_FILE Temp Location open_basedir Conflict PHP-FPM/Nginx

    16 septembre 2017, par xendi

    I have a script for uploading files to my site. It works great but now I’m wanting to extract meta data from video files using the ffmpeg/ffprobe library. My code :

    if (!empty($_FILES)) {
               $requestAr = requestCheck(['title', 'description']);
               $assetName = randomString(11);
               $assetSalt = randomString(3);

               $bucket = "videos";
               $fileTmpPath = $_FILES['qqfile']['tmp_name'];
               $filenameOrig = $_FILES['qqfile']['name'];
               $fileExtension = pathinfo($filenameOrig, PATHINFO_EXTENSION);
               $assetFilename = $assetName . "_$assetSalt.$fileExtension";

               $trustedExtensions = ['webm', 'mp4', 'ogg'];
               if(array_search($fileExtension, $trustedExtensions) !== false) {
                   $ffprobe = FFMpeg\FFProbe::create([
                       'ffprobe.binaries' => '/usr/bin/ffprobe'
                   ]);
                   $fileInfo = $ffprobe
                       ->format($fileTmpPath) // extracts file informations
                       ->get('duration');             // returns the duration property
                   print_r($fileInfo);
               }
    }

    I wind up with this error :

    file_exists(): open_basedir restriction in effect. File(/usr/bin/ffprobe) is not within the allowed path(s): <lists all="all" the="the" directories="directories" in="in" variable="variable">
    </lists>

    I have passed the ffmpeg library the absolute path to ffprobe so it knows where it is. I was searching around and some people were saying this is because the lib can’t access the tmp directory with the uploaded file. In either case, I’ve been trying to disable open_basedir or at least add the paths I need to it to get this to work.

    I tried setting open_basedir to none in my php.ini but it didn’t work. When I view phpinfo(), it still lists a bunch of paths for that setting. I tried to grep where open_basedir exists on the server. Indeed, it’s the php.ini files and I shouldn’t need to modify any other than the one reported in phpinfo().