Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (30)

  • 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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (3923)

  • what is the faster way to load a local image using javascript and / or nodejs and faster way to getImageData ?

    4 octobre 2020, par Tom Lecoz

    I'm working on a video-editing-tool online for a large audience.
Users can create some "scenes" with multiple images, videos, text and sound , add a transition between 2 scenes, add some special effects, etc...

    


    When the users are happy with what they made, they can download the result as a mp4 file with a desired resolution and framerate. Let's say full-hd-60fps for example (it can be bigger).

    


    I'm using nodejs & ffmpeg to build the mp4 from HtmlCanvasElement.
Because it's impossible to seek perfectly frame-by-frame with a HtmlVideoElement, I start to convert the videos from each "scene" in a sequence of png using ffmpeg.
Then, I read my scene frame by frame and , if there are some videos, I replace the videoElements by an image containing the right frame. Once every images are loaded, I launch the capture and go to the next frame.

    


    Everythings works as expected but it's too slow !
Even with a powerfull computer (ryzen 3900X, rtx 2080 super, 32 gb of ram , nvme 970 evo plus) , in the best case, I can capture basic full-hd movie (if it contains videos inside) at 40 FPS.

    


    It may sounds good enought but it's not.
Our company produce thousands of mp4 every day.
A slow encoding process means more servers at works so it will be more expensive for us.

    


    Until now, my company used (and is still using) a tool based on Adobe Flash because the whole video-editing-tool was made with Flash. I was (and am) in charge to translate the whole thing into HTML. I reproduced every feature one by one during 4 years (it's by far my biggest project) and this is the very last step but even if the html-version of our player works very well, the encoding process is much slower than the flash version - able to encode full-hd at 90-100FPS - )

    


    I put console.log everywhere in order to find what makes the encoding so slow and there are 2 bottlenecks :

    


    As I said before, for each frame, if there are videos on the current scene, I replace video-elements by images representing the right frame at the right time. Since I'm using local files, I expected a loading time almost synchronous. It's not the case at all, it required more than 10 ms in most cases.

    


    So my first question is "what is the fastest way to handle local image loading with javascript used as final output ?".

    


    I don't care about the technology involved, I have no preference, I just want to be able to load my local image faster than what I get for now.

    


    The second bottleneck is weird and to be honest I don't understand what's happening here.

    


    When the current frame is ready to be captured, I need to get it's data using CanvasRenderingContext2D.getImageData in order to send it to ffmpeg and this particular step is very slow.

    


    This single line

    


    let imageData = canvas.getContext("2d").getImageData(0,0,1920,1080);  


    


    takes something like 12-13 ms.
It's very slow !

    


    So I'm also searching another way to extract the pixels-data from my canvas.

    


    Few days ago, I found an alternative to getImageData using the new class called VideoFrame that has been created to be used with the classes VideoEncoder & VideoDecoder that will come in Chrome 86.
You can do something like that

    


    let buffers:Uint8Array[] = [];
createImageBitmap(canvas).then((bmp)=>{
   let videoFrame = new VideoFrame(bmp);
   for(let i = 0;i<3;i++){
      buffers[i] = new Uint8Array(videoFrame.planes[id].length);
      videoFrame.planes[id].readInto(buffers[i])
   }
})


    


    It allow me to grab the pixel data around 25% quickly than getImageData but as you can see, I don't get a single RGBA buffer but 3 weirds buffers matching with I420 format.

    


    In an ideal way, I would like to send it directly to ffmpeg but I don't know how to deals with these 3 buffers (i have no experience with I420 format) .

    


    I'm not sure at all the solution that involve VideoFrame is a good one. If you know a faster way to transfer the data from a canvas to ffmpeg, please tell me.

    


    Thanks for reading this very long post.
Any help would be very appreciated

    


  • Error trying to load ffmpeg library in dart

    24 juillet 2021, par Vinícius Pereira

    I'm a new programmer in de Dart world and I'm trying some stuff to learn more.
I'm trying to create a application that outputs audio from a file. I checked pub and I haven't found anything that suits my needs. So I found about dart:ffi and about ffmpeg capabilities.

    


    For the past few days I'm trying to load the ffmpeg libraries (avcodec, avformat, etc.) into my code but I haven't succeded.

    


    This is my code.

    


    var libraryPath = path.join(Directory.current.path, 'bin', 'avcodec.dll');
final dylib = ffi.DynamicLibrary.open(libraryPath);


    


    This is the error I got :

    


    Exception has occurred.
ArgumentError (Invalid argument(s): Failed to load dynamic library 'C:\Users\[MYUSER]\Documents\Code\Dart\ffmpeg\bin\avcodec.dll': 126)


    


    What I've tried so far :

    


      

    • Checked the path, it's right ;
    • 


    • Tried to import another library (sqlite3) with success ;
    • 


    • Tried to compile the DLLs myself and also tried prebuilt ones (from the links on ffmpeg site)
    • 


    


    My dart version Dart SDK version: 2.13.4 (stable) on "windows_x64"

    


    Whats the procedure to properly use the ffmpeg library with dart ?

    


  • aarch64 : me_cmp : Avoid redundant loads in ff_pix_abs16_y2_neon

    28 septembre 2022, par Martin Storsjö
    aarch64 : me_cmp : Avoid redundant loads in ff_pix_abs16_y2_neon
    

    This avoids one redundant load per row ; pix3 from the previous
    iteration can be used as pix2 in the next one.

    Before : Cortex A53 A72 A73
    pix_abs_0_2_neon : 138.0 59.7 48.0
    After :
    pix_abs_0_2_neon : 109.7 50.2 39.5

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavcodec/aarch64/me_cmp_neon.S