
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (103)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)
Sur d’autres sites (11604)
-
IBM Watson Speech to Text Audio Conversion on Node.js Web Application
25 avril 2016, par Raquel HoseinThe gist of the issue is that IBM Watson Speech to Text only allows for FLAC, WAV, and OGG file formats to be uploaded and used with the API.
My solution to that would be that if the user uploads an mp3, BEFORE sending the file to Watson, a data conversion would take place. Essentially, the user uploads an mp3, then using ffmpeg or sox the audio would be converted to an OGG, after which the audio would then be uploaded to Watson.
What I am unsure about is : What exactly do I have to modify in the Node.js Watson code to allow for the audio conversion to happen ? Linked below is the Watson repo which is what I am working through. I am sure that the file that will have to be changes is fileupload.js, which I have linked, but where the changes go is what I am uncertain about ?
I have looked through both SO and developerWorks, the IBM SO for answers to this issue, but I have not seen any which is why I am posting here. I would be happy to clarify my question if that is necessary.
-
how to use ffmpeg with node.js
11 février 2024, par Jes SHiiii. I would like to use ffmpeg for this project (click to check out). I tried to use wasm but it was too slow. So i'm making a back app with nestjs and nodejs for this. I want to question : What is the better to do ? Should i use bindings ? or what should i use ?. (Please, i already look up this topic and i know that there is a library called "ffmpeg" in npm, if you don't know about how to work correctly please, just don't reply)


I tried with ffmpeg.wasm, but it was too slow. So i'm making a back.


-
How to estimate in Node audio bitrate, bytes, duration without ffmpeg
6 mai 2016, par loretoparisiSupposed to not have access to
ffmpeg
I need a simple way to calculate thebitrate
of an audio (or video) file given media length (bytes) and duration (seconds), i.e. the functionbitrate = MediaInfo.bitrate(bytes, duration);
Also I need to do the opposite, so that given approximate media
bitrate
andlength
I need calculate theduration
:duration = MediaInfo.duration(bytes, bitrate);
So, this is my attempt, inspired by bitrate node module :
var console = {
log: function(s) {
document.getElementById("console").innerHTML += s + "<br />"
}
}
/**
* Get media file info
* @see https://www.npmjs.com/package/bitrate
* * @author Loreto Parisi (loretoparisi at gmail dot com)
*/
var MediaInfo = {
/** unit divisors */
DIVISORS : {
bps: 0.125,
kbps: 125,
mbps: 125000,
Bps: 1,
KBps: 1000,
MBps: 1000000
},
/**
* Calcuate approximate bitrate
* @param bytes integer media length in bytes
* @param seconds float media duration
* @param format string: bps|kbps|Bps|KBps|MBps
* @param pos integer decimal approximation
*/
bitrate : function(bytes, seconds, format, pos) {
if (typeof format !== 'string') throw new TypeError('Expected \'format\' to be a string')
format = format.replace('/', 'p')
var divisor = this.DIVISORS[format];
if (!divisor) throw new Error('\'format\' is an invalid string')
var bitrate = bytes / seconds / divisor;
pos=pos||4;
return (Math.round(bitrate * Math.pow(10,pos)) / Math.pow(10,pos) );
},
/**
* Calcuate media bytes
* @param bitrate float media bitrate per seconds
* @param seconds float media duration
* @param format string: bps|kbps|Bps|KBps|MBps
* @param pos integer decimal approximation
*/
bytes : function(bitrate, seconds, format) {
if (typeof format !== 'string') throw new TypeError('Expected \'format\' to be a string')
format = format.replace('/', 'p')
var divisor = this.DIVISORS[format];
if (!divisor) throw new Error('\'format\' is an invalid string')
var bytes = bitrate * seconds * divisor;
return ( Math.round(bytes) );
}, //bytes
/**
* Calcuate approximate duration
* @param bytes integer media length in bytes
* @param bitrate float media bitrate per seconds
* @param format string: bps|kbps|Bps|KBps|MBps
* @param pos integer decimal approximation
*/
duration : function(bytes, bitrate, format, pos) {
if (typeof format !== 'string') throw new TypeError('Expected \'format\' to be a string')
format = format.replace('/', 'p')
var divisor = this.DIVISORS[format];
if (!divisor) throw new Error('\'format\' is an invalid string')
var seconds = bytes / bitrate / divisor;
pos=pos||4;
return (Math.round(seconds * Math.pow(10,pos)) / Math.pow(10,pos) );
}
} //MediaInfo
// example of usage
var bytes = 57511; // media file size in bytes
var seconds = 20.35 // media file duration in seconds
// calculate media bitrate given media length and duration
var kilobitsPerSecond = MediaInfo.bitrate(bytes, seconds, 'kbps', 3) // => 326.3
var bitsPerSecond = MediaInfo.bitrate(bytes, seconds, 'bps', 3) // => 326279
var BytesPerSecond = MediaInfo.bitrate(bytes, seconds, 'Bps', 3) // => 40785
// inverse: calculate media duration given media length and bitrate
var duration = MediaInfo.duration(bytes, kilobitsPerSecond, 'kbps', 3);
// estimated bytes length given bitrate and duration
var estimatedBytes = MediaInfo.bytes(kilobitsPerSecond, duration, 'kbps', 3);
var data = {
bytes : bytes,
seconds : seconds,
kilobitsPerSecond : kilobitsPerSecond + " kb/s",
bitsPerSecond : bitsPerSecond + " b/s",
BytesPerSecond : BytesPerSecond + " B/s",
duration : duration,
estimatedBytes : estimatedBytes
}
console.log( JSON.stringify(data, null, 2) );<div></div>
The result media info are
{
"bytes": 57511,
"seconds": 20.35,
"kilobitsPerSecond": "22.609 kb/s",
"bitsPerSecond": "22608.747 b/s",
"BytesPerSecond": "2826.093 B/s",
"duration": 20.35,
"estimatedBytes": 57512
}while
ffmpeg
givesDuration: 00:00:20.35, start: 0.000000, bitrate: 22 kb/s
Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 16 kb/s (default)Of course, the problem here is the assumption that I have a fixed bitrate when calculating the
duration
. But, is there any other way without having ffprobe or lame in node ?Note. A good options, where the media file has ID3 tagging, is to use the JSMediaTags node module that supports
ID3
andMP4
tagging for media files and works both in the browser that in node :var jsmediatags = require("jsmediatags");
jsmediatags.read("./music-file.mp3", {
onSuccess: function(tag) {
console.log(tag);
},
onError: function(error) {
console.log(':(', error.type, error.info);
}
});This will not work for streaming media files or for files coming from direct audio sources of course.