Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (55)

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

  • mp4 Vj Animation video lagging hi res video

    21 février 2020, par Ryan Stone

    I am trying to get a video to play inside a video tag at the top left hand corner of my page, it loads ok, the resolution is good and it seems to be looping but it is lagging very much, definatly not achieving 60fps it is in mp4 format and the resolution on the original mp4 is 1920x1080 it is a hi resolution vj free loop called GlassVein, you can see it if you search on youtube. On right clicking properties it comes up with the following inforamtion ;

    Bitrate:127kbs
    Data rate:11270kbps
    Total bitrate:11398kbs
    Audio sample rate is : 44khz
    filetype is:VLC media file(.mp4)
    (but i do not want or need the audio)

    & it also says 30fps, but I’m not sure i believe this as it runs smooth as butter on vlc media player no lagging, just smooth loop animation

    I have searched on :https://trac.ffmpeg.org/wiki/Encode/AAC for encoding information but it is complete gobbldygook to me, I don’t understand a word its saying

    My code is so far as follows ;

       <video src="GlassVeinColorful.mp4" autoplay="1" preload="auto" class="Vid" width="640" height="360" loop="1" viewport="" faststart="faststart" mpeg4="mpeg4" 320x240="320x240" 1080="1080" 128k="128k">  
       </video>

    Does anyone know why this is lagging so much, or what I could do about it.
    it is a quality animation and I don’t really want to loose an of its resolution or crispness.. the -s section was originally set to 1920x1080 as this is what the original file is but i have changed it to try and render it quicker...

    Any helpful sites, articles or answers would be great..

    2020 Update

    The Solution to this problem was to convert the Video to WebM, then use Javascript & a Html5 Canvas Element to render the Video to the page instead of using the video tag to embed the video.

    Html

    <section>
           <video src="Imgs/Vid/PurpGlassVein.webm" type="video/webm" width="684" height="auto" muted="muted" loop="loop" autoplay="autoplay">
                  <source>
                  <source>
                  <source>
           </source></source></source></video>
           <canvas style="filter:opacity(0);"></canvas>
    </section>

    Css

    video{
      display:none !important;
      visibility:hidden;
    }

    Javascript

       const Canv = document.querySelector("canvas");
       const Video = document.querySelector("video");
       const Ctx = Canv.getContext("2d");

       Video.addEventListener('play',()=>{
         function step() {
           Ctx.drawImage(Video, 0, 0, Canv.width, Canv.height)
           requestAnimationFrame(step)
         }
         requestAnimationFrame(step);
       })

       Canv.animate({
           filter: ['opacity(0) blur(5.28px)','opacity(1) blur(8.20px)']
       },{
           duration: 7288,
           fill: 'forwards',
           easing: 'ease-in',
           iterations: 1,
           delay: 728
       })

    I’ve Also Used the Vanilla Javascript .animate() API to fade the element into the page when the page loads. But one Caveat is that both the Canvas and the off-screen Video Tag must match the original videos resolution otherwise it starts to lag again, however you can use Css to scale it down via transform:scale(0.5) ; which doesn’t seem to effect performance at all.

    runs smooth as butter, and doesn’t loose any of the high resolution image.
    Added a slight blur 0.34px onto it aswell to smooth it even more.

    Possibly could of still used ffmpeg to get a better[Smaller File Size] WebM Output file but thats something I’ll have to look into at a later date.

  • C pointer casting to and from Go

    26 avril 2018, par nevernew

    I’m writing an app for the windows platform using FFmpeg and it’s golang wrapper goav, but I’m having trouble understanding how to pass the C pointers between C and Go.

    I’ve stripped out all the relevant parts of the C code, the wrapper and my code, shown below :

    C code - libavutil/frame.h

    #include

    typedef struct AVFrame {
    #define AV_NUM_DATA_POINTERS 8
       uint8_t *data[AV_NUM_DATA_POINTERS];
    }

    Go goav wrapper

    package avutil

    /*
       #cgo pkg-config: libavutil
       #include <libavutil></libavutil>frame.h>
       #include

       // C code I added:
       #include

       void SaveFrame(const char* location, uint8_t *data, int width, int height) {
           FILE *pFile;
           int  y;

           // Open file
           pFile=fopen(location, "wb");
           if(pFile==NULL)
               return;

           // Write header
           fprintf(pFile, "P6\n%d %d\n255\n", width, height);

           // Write pixel data
           for(y=0; y/ Close file
           fclose(pFile);
       }
    */
    import "C"
    import (
       "unsafe"
    )

    type Frame C.struct_AVFrame

    func Data(f *Frame) *uint8 {
       // i think this is the function thats not working?
       return (*uint8)(unsafe.Pointer((*C.uint8_t)(unsafe.Pointer(&amp;f.data))))
    }
    func SaveFrame(location string, data *uint8, width int, height int) {
       C.SaveFrame(C.CString(location), unsafe.Pointer(data), C.int(width), C.int(height))
    }

    My Go code

    package main

    import "github.com/giorgisio/goav/avutil"

    func main() {
       var frame *avutil.Frame
       var data *uint8

       //... initialize frame

       data = avutil.Data(frame)
       avutil.SaveFrame("frame0.ppm", data, 1920, 1080)
    }

    When I try to save the frame, the resulting image is garbled because the pointer is wrong, how do i fix this ?

  • Android sws_scale RGB0 Frame taking long time and cause video latency [duplicate]

    17 avril 2018, par AJit

    This question already has an answer here :

    Reading frames from FFMPEG and try to directly draw on a surface window in Native android, If scale the image to exact size what we are getting from the camera and apply YUV420P to RGBA it take 1ms to scale through av_image_fill_arrays but if scale image surface size, then It took 25 to 30ms to scale a same frame.

    Low latency :[ 1ms by sws_scale]

    swsContext = sws_getContext(videoCodecContext->width,
                                       videoCodecContext->height,
                                       videoCodecContext->pix_fmt,
                                       videoCodecContext->width,
                                       videoCodecContext->height,
                                       AV_PIX_FMT_RGB0,
                                       SWS_FAST_BILINEAR, NULL, NULL, NULL);
    av_image_fill_arrays()
    av_read_frame()
    avcodec_decode_video2(
    sws_scale(swsContext,
             (const uint8_t *const *) videoFrame->data,
             videoFrame->linesize,
             0,
             videoCodecContext->height,
             pictureFrame->data,
             pictureFrame->linesize);
    ANativeWindow_lock()
    Write all buffer bytes to window.
    ANativeWindow_unlockAndPost()

    Low latency :[ 30ms by sws_scale]

    [videoContext Width: 848 Height: 608]
    swsContext = sws_getContext(videoCodecContext->width,
                                       videoCodecContext->height,
                                       videoCodecContext->pix_fmt,
                                       1080,
                                       608,
                                       AV_PIX_FMT_RGB0,
                                       SWS_FAST_BILINEAR, NULL, NULL, NULL);

    NOTE : we are getting YUV420P pixel format.

    Whenever we change context width and height other than videoContext it will take more than 30ms so result is video delaying.

    TRY 1 : Pass the buffer from JNI to Java and create bitmap there to scale later on but createBitmap itself take ~500ms which is not good enough.

    TRY 2 : Direct YUV420P to RGB conversion, but still sws_scale is greater.

    TRY 3 : Direct writes YUV to window bites, but it shows without color (If anyone has a solution here will might helpful).

    TRY 4 : yuvlib, still not worth it.

    TRY 5 : Different pixel formats and flags in swsContext.

    enter image description here

    Any help would appreciated.