
Recherche avancée
Autres articles (60)
-
Le profil des utilisateurs
12 avril 2011, parChaque 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, parAccé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 (...) -
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 (7141)
-
FFMPEG, player plays jerky video after encoding
9 septembre 2020, par AKLI've been using FFMPEG on Windows 10 for a while. To help me do my job, I have got several DOS batch files which take parameters and perform tasks like cut from beginning, blur area, mute audio etc.


I usually take big videos, extract the parts that I like using Avidemux, cut / apply filter on some parts using FFMPEG, join them using FFMPEG and then encode again to get rid of any errors (or jerkiness, etc) on my target player, which is Kodi 18.xx running on an Android TV (TCL brand).


I have done a similar process for a video that I have been doing for several years and this video seems to be out of my control. I have chopped up the video using Avidemux 2.7.2. The video has been cut at key frames. If I take a single un-encoded file, it runs perfectly on my Android TV. If I encode it using FFMPEG, it starts to jerk when played on my Android TV.


The videos always plays fine on VLC player running on my PC.


Some information that may be helpful. I can attach detailed frame information if desired.


ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9.3.1 (GCC) 20200621
 configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100



Showing info for the source file. Codec is hevc, I think FFMPEG does not have default support for ?


ffmpeg -i _p007_cut_start.mp4 -hide_banner
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_p007_cut_start.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf58.20.100
 Duration: 00:00:08.51, start: 0.006000, bitrate: 5501 kb/s
 Stream #0:0(und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt709), 1920x816 [SAR 1:1 DAR 40:17], 5091 kb/s, 23.98 fps, 23.98 tbr, 24390 tbn, 23.98 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 401 kb/s (default)
 Metadata:
 handler_name : SoundHandler



Showing info for the file that was encoded :


ffmpeg -i p007_done2.mp4 -hide_banner
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'p007_done2.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.45.100
 Duration: 00:00:08.53, start: 0.000000, bitrate: 3092 kb/s
 Stream #0:0(und): Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le, 1920x816 [SAR 1:1 DAR 40:17], 2743 kb/s, 23.98 fps, 23.98 tbr, 24390 tbn, 47.95 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 345 kb/s (default)
 Metadata:
 handler_name : SoundHandler



I would appreciate if someone can point to me where I am going wrong.


The command used to perform the encoding is as follows (only the library was swapped between libx264 and lib265) :


ffmpeg -i in.mp4 -map 0:v -c:v libx264 -video_track_timescale 24390 -crf 23 -map 0:a -c:a aac -copyts -vsync 0 -async 0 -movflags +faststart out.mp4



P.S. My knowledge is more based on trial-and-error and I don't understand video formats (and concepts) much except for what got me to this point.


Regards,
AK


-
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


-
Why after rendering with ffmpeg, file size did not decrease ?
15 avril 2021, par ptrraPROBLEM : After rendering a certain video with
ffmpeg
file size increased from 4GB to 6GB.

ORIGINAL VIDEO : EE1.mkv

FFMPEG COMMAND :ffmpeg -i EE1.mkv -c:a copy -c:v libx264 -crf 23 -preset medium -profile:v high out.mp4

QUESTIONS : Why did the file size increase ? What am I doing wrong ?

!DETAILS !

After a few years I made about 30 gaming videos (130GB) and with the current covid-19 situation I started recording my online classes (about 40 videos or 150GB). Now because I'm lacking space on my 1TB external HDD I started getting intoffmpeg
. Before I was only usingobs-studio
and not good parameters for recording.

I was using
CBR
mode for recording, either 5000KB or 15000KB bit rate with varying x264 presets and profiles because I was also experimenting with them. Usually superfast preset with high profile. So I wanted to convert all those videos withffmpeg
usingCRF 23
, medium preset and high profile. A note that when I'm recording withobs-studio
it's set to record in matroska format (.mkv
).

When I was rendering my online classes videos with these settings I managed to achieve 10x better compression with the same quality. And when rendering my gaming videos I managed to achieve up to 3x better compression with the same quality. However there is this one video that when rendered with the same parameters the file size increases.


The EE1.mkv should be recorded with
CBR
15000KB bit rate, with superfast preset and high profile. Also the game that is recorded in this video isEmpire Earth
which needs around 8000KB for it to look good. Everything more than 8000KB is not needed.

Thank you all for your help.