
Recherche avancée
Autres articles (37)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa 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 (11876)
-
live stream RTSP to html all browsers
30 juin 2020, par jimmyI have a situation and cant find an answer online maybe you could help me.



I am trying to stream an rtsp stream to HTML basically,
I converted the stream to his/m3u8 local dir using ffmpeg, 
my problem is displaying the hls to my web page and get it to work on the main browsers like chrome ,Firefox etc.



the only way i got it to work is by using python command "python -m http.server" to my local dir(where the hls stream was saved) and it works on I.E browser.



and all i did needs to be done on the back end (asp.net app).



i did not write lot of code, i am currently trying to make it work on a simple HTML page once it will work i will make the asp page. that is what i have so far.
ffmpeg command ffmpeg -i rtsp ://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -y -c:a aac -b:a 160000 -ac 2 -s 854x480 -c:v libx264 -b:v 800000 -hls_time 10 -hls_list_size 10 -start_number 1 Stream/video.m3u8.



python command : python -m http.server,
to transport my converted stream "Stream/video.m3u8" to http server local host:8000 for testing)



sample HTML page (it a sample from hls.js posted on GitHub https://github.com/video-dev/hls.js/blob/master/demo/basic-usage.html )



Just edited the video html tag to http://localhost:8000/stream/video.m3u8 as a source.



thank you.


-
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 LecozI'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


-
Linux based mp3 to wmv converter
30 octobre 2012, par algorithmicCoderIs there some software library that can i can interact with via command line (no GUI business) exist that can take an mp3 and output wmv or a similar format ?
Can ffmpeg do this ?
I found this product—> http://www.3herosoft.com/how-to-convert-mp3-to-wmv.html ...ideally i would want to find a library that was able to carry out the same basic functionality via command line.
Thanks !