
Recherche avancée
Autres articles (105)
-
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 (...) -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (5361)
-
HTML Video Exporting Using MediaRecorder vs ffmpeg.js
3 octobre 2020, par Owen OvadozTLDR


Imagine I have one video and one image. I want to create another video that overlays the image (e.g. watermark) at the center for 2 seconds in the beginning of the video and export it as the final video. I need to do this on the client-side only. Is it possible to use MediaRecorder + Canvas or should I resort to using ffmpeg.js ?


Context


I am making a browser-based video editor where the user can upload videos and images and combine them. So far, I implemented this by embedding the video and images inside a canvas element appropriately. The data representation looks somewhat like this :


video: {
 url: 'https://archive.com/video.mp4',
 duration: 34,
},
images: [{
 url: 'https://archive.com/img1.jpg',
 start_time: 0,
 end_time: 2,
 top: 30,
 left: 20,
 width: 50,
 height: 50,
}]



Attempts


- 

- I play the video and show/hide images in the canvas. Then, I can use the
MediaRecorder
to capture the canvas' stream and export it as a data blob at the end. The final output is as expected, but the problem with this approach is I need to play the video from the beginning to the end for me to capture the stream from the canvas. If the video is 60 seconds, exporting it also takes 60 seconds.






function record(canvas) {
 return new Promise(function (res, rej) {
 const stream = canvas.captureStream();
 const mediaRecorder = new MediaRecorder(stream);
 const recordedData = [];

 // Register recorder events
 mediaRecorder.ondataavailable = function (event) {
 recordedData.push(event.data);
 };
 mediaRecorder.onstop = function (event) {
 var blob = new Blob(recordedData, {
 type: "video/webm",
 });
 var url = URL.createObjectURL(blob);
 res(url);
 };

 // Start the video and start recording
 videoRef.current.currentTime = 0;
 videoRef.current.addEventListener(
 "play",
 (e) => {
 mediaRecorder.start();
 },
 {
 once: true,
 }
 );
 videoRef.current.addEventListener(
 "ended",
 (e) => {
 mediaRecorder.stop();
 },
 {
 once: true,
 }
 );
 videoRef.current.play();
 });
}







- 

- I can use ffmpeg.js to encode the video. I haven't tried this method yet as I will have to convert my image representation into ffmpeg args (I wonder how much work that is).




- I play the video and show/hide images in the canvas. Then, I can use the
-
When I use Fluent-Ffmpeg to access Ffmpeg, there are two different threads but I dont want it
25 mars 2019, par Ahmet Hakan BillurI try to broadcast with rtsp live stream from IP camera on web app that is improved with node.js-jsmpeg([a link]https://www.npmjs.com/package/fluent-ffmpeg !), web socket, html5(canvas).Everything ok that live streaming works but missing frame and high CPU usaged by streaming on web app and I try to reduce so I can intervene ffmpeg with fluent-ffmpeg but when I monitor CPU usaged I can see there 2 different threads following as and look at screenshot of CPU ;
ffmpeg -rtsp_trasport tcp -i rtsp ://10.6.0.225 -f mpeg1video - is worked by jsmpeg and canvas/html5
index.html
<div><canvas width="640" height="360"></canvas></div>
div><canvas width="640" height="360"></canvas>
<code class="echappe-js"><script type="text/javascript" src='http://stackoverflow.com/feeds/tag/jsLib/jsmpeg.js'></script><script type="text/javascript" src='http://stackoverflow.com/feeds/tag/jsLib/ffmpegUtil.js'></script>
<script type="text/javascript"><br />
var canvas = document.getElementById('videoCanvas');<br />
var ws = new WebSocket("ws://10.6.0.206:9999")<br />
var player = new jsmpeg(ws, {canvas:canvas, autoplay:true,audio:false,loop: true});<br />
</script>other one /usr/bin/ffmpeg -i rtsp ://10.6.0.225 -y out.ts is work by following piece of code in app.js
Stream = require('node-rtsp-stream');
stream = new Stream({
name: 'name',
streamUrl: 'rtsp://10.6.0.225',
wsPort: 9999
});
var ffmpeg = require('fluent-ffmpeg');
var proc = new ffmpeg();
proc
.addInput('rtsp://10.6.0.225')
.on('start', function(ffmpegCommand) {
/// log something maybe
console.log('start-->'+ffmpegCommand)
})
.on('progress', function(data) {
/// do stuff with progress data if you want
console.log('progress-->'+data)
})
.on('end', function() {
/// encoding is complete, so callback or move on at this point
console.log('end-->')
})
.on('error', function(error) {
/// error handling
console.log('error-->'+error)
})
.output('out.ts')
.run();and then I don’t want to get two different ffmpeg command threads in there.
Does anyone have an idea ?
Thanks in advice. -
Explicitly set soundManager.preferFlash = true for some demo/API/docs cases
31 juillet 2011m demo/360-player/canvas-visualization-basic.html m demo/360-player/canvas-visualization.html m demo/animation-1/script/animation.js m demo/animation-2a/index.html m demo/animation-2b/script/animation.js m demo/api/index.html m demo/christmas-lights/christmaslights.js m (...)