
Recherche avancée
Autres articles (68)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (12262)
-
Save frame as image during video stream using ffmpeg, in C
30 avril 2017, par George T.I’m using the Parrot SDK3 to retrieve the video stream from a Bebop2 drone. From it I need to "extract" a frame and save it as an image.
The whole code can be found here, but I shall try to include the (what I understand as) important parts here.
Where the video is sent to mplayer. I assume from this that the video format is h624.
if (videoOut != NULL)
{
if (codec.type == ARCONTROLLER_STREAM_CODEC_TYPE_H264)
{
if (DISPLAY_WITH_MPLAYER)
{
fwrite(codec.parameters.h264parameters.spsBuffer, codec.parameters.h264parameters.spsSize, 1, videoOut);
fwrite(codec.parameters.h264parameters.ppsBuffer, codec.parameters.h264parameters.ppsSize, 1, videoOut);
fflush (videoOut);
}
}
}Where the frame is received and written to videoOut, to be displayed
eARCONTROLLER_ERROR didReceiveFrameCallback (ARCONTROLLER_Frame_t *frame, void *customData)
{
if (videoOut != NULL)
{
if (frame != NULL)
{
if (DISPLAY_WITH_MPLAYER)
{
fwrite(frame->data, frame->used, 1, videoOut);
fflush (videoOut);
}
}
}
return ARCONTROLLER_OK;
}The idea I had in mind is to
fwrite(frame->data, frame->used, 1, videoOut);
to a different file but that just creates a corrupted file, probably because of encoding. In what way can I get this frame and store it to a separate image ? The preferable image filetype .png, .jpg or .gifAny help will be greatly appreciated ! Thanks in advance !
-
Slicing an AVI file
7 novembre 2014, par Peter LurI am trying to upload only a certain part of an AVI file on the server without having to upload the whole file first.
If I set the slice to the beginning (byte : 0), I can read the resulting file no problem even if I slice it in any size. However if the slice start anywhere but not at byte 0, the file become unreadable. I guess this has something to do with the avi header/index being messed up. I was wondering maybe I could use ffmpeg to move the header or something ?
HTML Source
<code class="echappe-js"><script type="text/javascript"><br />
<br />
window.BlobBuilder = window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder;<br />
<br />
function sendRequest() {<br />
var blob = document.getElementById('fileToUpload').files[0];<br />
<br />
<br />
//Slicing parameters<br />
<br />
<br />
//#1: Starting at byte:0 = WORKING WELL<br />
var start = 0;<br />
var end = 1048576; // 1MB chunk sizes.<br />
<br />
<br />
//#2: Slicing the video file somewhere else (FAIL)<br />
<br />
/*<br />
var start = 1048576*3;<br />
var end = 1048576*4;<br />
*/<br />
<br />
<br />
var chunk = blob.slice(start, end, 'video/avi');<br />
uploadFile(chunk);<br />
<br />
}<br />
<br />
function fileSelected() {<br />
var file = document.getElementById('fileToUpload').files[0];<br />
if (file) {<br />
var fileSize = 0;<br />
if (file.size > 1024 * 1024)<br />
fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';<br />
else<br />
fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';<br />
<br />
document.getElementById('fileName').innerHTML = 'Name: ' + file.name;<br />
document.getElementById('fileSize').innerHTML = 'Size: ' + fileSize;<br />
document.getElementById('fileType').innerHTML = 'Type: ' + file.type;<br />
}<br />
}<br />
<br />
function uploadFile(blobFile) {<br />
//var file = document.getElementById('fileToUpload').files[0]; <br />
var fd = new FormData();<br />
fd.append("fileToUpload", blobFile);<br />
<br />
var xhr = new XMLHttpRequest();<br />
xhr.upload.addEventListener("progress", uploadProgress, false);<br />
xhr.addEventListener("load", uploadComplete, false);<br />
xhr.addEventListener("error", uploadFailed, false);<br />
xhr.addEventListener("abort", uploadCanceled, false);<br />
xhr.open("POST", "upload.php");<br />
xhr.onload = function(e) {<br />
//alert("loaded!");<br />
};<br />
<br />
xhr.send(fd);<br />
//alert("oen over");<br />
}<br />
<br />
function uploadProgress(evt) {<br />
if (evt.lengthComputable) {<br />
var percentComplete = Math.round(evt.loaded * 100 / evt.total);<br />
document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';<br />
}<br />
else {<br />
document.getElementById('progressNumber').innerHTML = 'unable to compute';<br />
}<br />
}<br />
<br />
function uploadComplete(evt) {<br />
/* This event is raised when the server send back a response */<br />
//alert(evt.target.responseText);<br />
}<br />
<br />
function uploadFailed(evt) {<br />
alert("There was an error attempting to upload the file.");<br />
}<br />
<br />
function uploadCanceled(evt) {<br />
xhr.abort();<br />
xhr = null;<br />
//alert("The upload has been canceled by the user or the browser dropped the connection.");<br />
}<br />
</script>PHP Source (upload.php)
<?php
$tmp_name = $_FILES['fileToUpload']['tmp_name'];
$size = $_FILES['fileToUpload']['size'];
$name = $_FILES['fileToUpload']['name'];
$target_file = basename($name);
$complete = "complete.avi";
$com = fopen($complete, "ab");
// Open temp file
$out = fopen($target_file, "wb");
if ( $out ) {
// Read binary input stream and append it to temp file
$in = fopen($tmp_name, "rb");
if ( $in ) {
while ( $buff = fread( $in, 1048576 ) ) {
fwrite($out, $buff);
fwrite($com, $buff);
}
}
fclose($in);
fclose($out);
}
fclose($com);
?> -
Sending 2 streams to FFmpeg from nodejs
18 août 2019, par SylensI am trying to send 2 ReadableStreams to FFmpeg from nodejs. I have tried using fluent-ffmpeg library to do this, but it only supports sending one stream for processing. Check here
My problem is :
I have 2 incoming mono audio streams, I want to send them to ffmpeg to create a stereo stream, which I will then send to google’s speech to text service, to generate a transcription.I am successfully receiving both the mono streams to the nodejs server.
How to utilize FFmpeg to merge them in realtime is still unclear, I could spawn a FFmpeg child process, but I’m not sure how to give 2 ReadableStreams as inputs and get the output as another stream ? FFmpeg supports multiple input streams.I can merge the 2 mono streams if they are in two separate files with this code.
const { spawn } = childProcess;
const ffmpeg = spawn('ffmpeg', [
'-i', this.phoneAudioFile,
'-i', this.micAudioFile,
'-filter_complex', '[0:a][1:a]amerge=inputs=2[a]',
'-map', '[a]',
this.outputLosslessFile,
]);How can I acheive the same using 2 streams instead of 2 files ?
EDIT
- The incoming streams both have PCM audio data.
- This entire process runs on a linux Ubuntu server.
- The final output must be a wav file.