
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (67)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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 (5373)
-
audio file conversion using ffmpeg
15 juillet 2014, par user3789242I’m building a voice recording project.so far I have succeeded in recording the voice as .wav audio file, and I’m using the ffmpeg for the user to be able to convert the audio file into a selected format (mp3, pcm, wma). What I want to do is to allow the user to select the format before recording the voice so that when stop recording the file will be saved in the selected format maybe by using ffmpeg conversion.
I have been searching the net for weeks for any demo using JavaScript and html5 but can’t find any. What I have tried so far is to save the audio file in a folder using Ajax/php and I’m trying to call that file in order to convert it but this method is very complicated and is not working. Any suggestions please. If you can also help me with a demo it would be most appreciated. This is my code so far :
function handleWAV(blob) {
if (currentEditedSoundIndex !== -1) {
$('#inFile2 tr:nth-child(' + (currentEditedSoundIndex + 1) + ')').remove();
}
var url = URL.createObjectURL(blob);
var li = document.createElement('li');
var au = document.createElement('audio');
var hf = document.createElement('a');
au.controls = true;
au.src = url;
hf.href = url;
hf.download = 'audio_recording_' + new Date().getTime() + '.wav';
hf.innerHTML = hf.download;
li.appendChild(au);
li.appendChild(hf);
inFile2.appendChild(li);
fileName=hf.download;
var reader = new FileReader();
reader.onload = function(event){
var fd = new FormData();
var Name = encodeURIComponent('audio_recording_' + new Date().getTime() + '.wav');
console.log("name = " + Name);
fd.append('fname', Name);
fd.append('data', event.target.result);
$.ajax({
type: 'POST',
url: 'upload.php',
data: fd,
processData: false,
contentType: false,
success: function(data){
//console.log(data);
}
});
};
reader.readAsDataURL(blob);
var fileBuffer;
// create ffmpeg worker
function getFFMPEGWorker() {
var ffmpegWorker = new Worker('worker.js');
ffmpegWorker.addEventListener('message', function(event) {
var message = event.data;
console.log(message.type);
if (message.type === "ready" && window.File && window.FileList && window.FileReader) {
// script loaded, hide loader
} else if (message.type == "stdout") {
console.log(message.data);
} else if (message.type == "stderr") {
console.log(message.data);
} else if (message.type == "done") {
var code = message.data.code;
console.log(code);
console.log(message.data);
var outFileNames = Object.keys(message.data.outputFiles);
console.log(outFileNames);
if (code == 0 && outFileNames.length) {
var outFileName = outFileNames[0];
console.log(outFileName);
var outFileBuffer = message.data.outputFiles[outFileName];
console.log(outFileBuffer);
var src = url;
console.log(url);
$("#downloadLink2").attr('href', src);
$("#download2").show();
} else {
$("#error").show();
}
}
}, false);
return ffmpegWorker;
}
// create ffmpeg worker
var ffmpegWorker = getFFMPEGWorker();
var ffmpegRunning = false;
if (ffmpegRunning) {
ffmpegWorker.terminate();
ffmpegWorker = getFFMPEGWorker();
}
ffmpegRunning = true;
// hide download div
$("#download2").hide();
// change download file name
var fileNameExt = fileName.substr(fileName.lastIndexOf('.') + 1);
var outFileName = fileName.substr(0, fileName.lastIndexOf('.')) + "." + getOutFormat();
$("#downloadLink2").attr("download2", outFileName);
$("#downloadLink2").text(outFileName);
var arguments = [];
arguments.push("-i");
arguments.push(fileName);
arguments.push("-b:a");
arguments.push(getBitrate());
switch (getOutFormat()) {
case "mp3":
arguments.push("-acodec");
arguments.push("libmp3lame");
arguments.push("out.mp3");
break;
case "wma":
arguments.push("-acodec");
arguments.push("wmav1");
arguments.push("out.asf");
break;
case "pcm":
arguments.push("-f");
arguments.push("s16le");
arguments.push("-acodec");
arguments.push("pcm_s16le");
arguments.push("out.pcm");
}
ffmpegWorker.postMessage({
type: "command",
arguments: arguments,
files: [
{
"name": fileName,
"buffer": fileBuffer
}
]
});
function getOutFormat() {
return $('input[name=format]:checked').val();
}
function getBitrate() {
return $('input[name=bitrate]:checked').val();
}
function readInputFile(file) {
// load file content
var reader = new FileReader();
reader.onload = function(e) {
fileName = file.name;
console.log(fileName);
fileBuffer = e.target.result;
}
reader.readAsArrayBuffer(file);
}
function handleFileSelect(event) {
var files = event.target.files; // FileList object
console.log(files);
// files is a FileList of File objects. display first file name
file = files[0];
console.log(file);
if (file) {
readInputFile(file);
console.log(file);
}
}
// setup input file listeners
el=document.getElementById('inFile2');
el.addEventListener('change',handleFileSelect, true);
}This code is for the download link where the user will be able to download the audio file also the conversion function happening in it.
As I said earlier the audio files are uploaded in a folder upload using Ajax.
-
Révision 100309 : La constante _DEV_PLUGINS a été remplacée dans le core par _DEV_VERSION_SPIP_COM...
1er novembre 2016, par marcimat@rezo.netS’adapter dans SVP !
-
FFmpeg Executing command error
7 avril 2016, par Sanket990When I conversion mp4 to mp3 using ffmpeg command
FFmpeg command Execution error- Working directory null IOEXception
Executing below code.File path=Environment.getExternalStorageDirectory();
try {
String ffmpegCommand="ffmpeg -i "+path.getAbsolutePath()+"/test/1.mp4 -f avi -acodec mp3 "+path.getAbsolutePath()+"/Songss.avi";
Process ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start();
String line;
BufferedReader reader = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream()));
Log.d("tag", "*******Starting FFMPEG");
while((line = reader.readLine())!=null){
Log.d("tag", "***"+line+"***");
}
Log.d("tag","****ending FFMPEG****");
} catch (IOException e) {
e.printStackTrace(); }LogCat
java.io.IOException: Error running exec(). Command: [/data/data/com.example.ffmpegcommandexecute/ffmpeg -i /mnt/sdcard/Songs.mp4 -vn -s 00:00:10 -acodec libmp3lame output.mp3]
Working Directory: null Environment: [ANDROID_SOCKET_zygote=10, ANDROID_BOOTLOGO=1, EXTERNAL_STORAGE=/mnt/sdcard, ANDROID_ASSETS=/system/app, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ASEC_MOUNTPOINT=/mnt/asec, LOOP_MOUNTPOINT=/mnt/obb, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar, EXTERNAL_STORAGE_SD=/mnt/ext_card, EXTERNAL_STORAGE_ALL=/mnt/sdcard:/mnt/ext_card, WTLE_VERSION=3.2.0.patch6.1, ANDROID_DATA=/data, LD_LIBRARY_PATH=/vendor/lib:/system/lib, ANDROID_ROOT=/system, ANDROID_PROPERTY_WORKSPACE=9,65536]
at java.lang.ProcessManager.exec(ProcessManager.java:211)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:195)
at com.example.ffmpegcommandexecute.MJPEGFFMPEGTest$ProcessVideo.doInBackground(MJPEGFFMPEGTest.java:301)
at com.example.ffmpegcommandexecute.MJPEGFFMPEGTest$ProcessVideo.doInBackground(MJPEGFFMPEGTest.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:264)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.io.IOException: No such file or directory
at java.lang.ProcessManager.exec(Native Method)
at java.lang.ProcessManager.exec(ProcessManager.java:209)