
Recherche avancée
Autres articles (57)
-
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 (...) -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (7736)
-
How do I prevent Quality loss in the beginning of a video ?
25 mars 2012, par Adam IngmanssonMy company transcodes videos sent in by users (recorder by our own screenrecording software)
I use FFMpeg to do the work using this command :
/ffmpeg/ffmpeg -i in.mov -vcodec libx264 -fpre /ffmpeg/ffpresets/libx264-slower.ffpreset -y out.flv
The purpose is to prepare the video for viewing in browser.
The problem is that the first 10, or so, seconds the quality is really poor.
What can cause this ? and how can i fix it ?
Preset settings :
coder=1
flags=+loop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
me_method=umh
subq=8
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=2
qcomp=0.6
qmin=0
qmax=69
qdiff=4
bf=3
refs=5
directpred=3
trellis=1
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
wpredp=2
rc_lookahead=50Exampel of an input video
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '84f42bcb67ac616635ef6f99057bbbc46d418295.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2012-03-07 13:45:16
Duration: 00:15:56.00, start: 0.000000, bitrate: 4108 kb/s
Stream #0.0(eng): Video: qtrle, rgb24, 1680x945, 3401 kb/s, 13.61 fps, 1k tbr, 1k tbn, 1k tbc
Metadata:
creation_time : 2012-03-07 13:45:16
Stream #0.1(eng): Audio: pcm_s16be, 44100 Hz, 1 channels, s16, 705 kb/s
Metadata:
creation_time : 2012-03-07 13:45:16 -
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


-
Still on Piwik 2 ? Update now to Piwik 3, the most efficient and secure Piwik version
5 avril 2017, par Piwik Core Team — CommunityIt has been almost four months since we released Piwik 3. The major new release came with a new UI, performance and security improvements. If you are still on Piwik 2, the security improvements alone should be worth updating your Piwik now to Piwik 3. We cannot recommend this enough.
Since the Piwik 3.0 release we have released three new versions that fix over 250 issues including more performance and security issues. And new features : the Life Time Revenue, or the Cross Domain linking feature to track visitors across different domains accurately. Also, most plugins from the Piwik Marketplace are now compatible with Piwik 3 so there is no reason to wait anymore.
The update to Piwik 3 should be smooth, but may take a while depending on the amount of data you have. If you have any problem with the update, feel free to get in touch with us. At Piwik and at InnoCraft, the company of the makers of Piwik, we have successfully updated many Piwik installations.
Wondering what’s changed ?