
Recherche avancée
Autres articles (111)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (12994)
-
Passing stream of getUserMedia output to ffmpeg,How would i do that ?
29 décembre 2016, par A SahraI am using getUserMedia to get access to camera.while playing the captured video with getUserMedia i want to stream and broadcast it to all user in my page as Live stream using ffmpeg and ffserver,
How would i post that stream to server(ffserver) for streaming it Live ?
Here is the code for getUserMedia part
window.addEventListener('DOMContentLoaded', function() {
var v = document.getElementById('vlive');
navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
if (navigator.getUserMedia)
{
navigator.getUserMedia( { video:true, audio:true, },
function(stream) {
var url = window.URL || window.webkitURL;
v.src = url ? url.createObjectURL(stream) : stream;
v.play();
},
function(error) { console.log('Good Job');
alert('Something went wrong. (error code ' + error.code + ')');
return;
});
}
else {
alert('Sorry, the browser you are using doesn\'t support getUserMedia');
return;
} }); -
getting a `InValid URL` when I send a voice message
9 septembre 2023, par AmmadWhen I try to send voice messages I always get invalid url error with. I am using whisper to convert the audio to text but for some reason I cannot seem to pass the file to the whisper. It worked when I used this in java script but not in typescript for some reason


async function createFile(path: string): Promise<file> {
 const response = await fetch(path);
 const data = await response.blob();
 
 // Extract file name from the path
 const fileName = path.split('/').pop() || 'unknown';
 
 // Extract file extension and determine MIME type
 const fileExtension = fileName.split('.').pop()?.toLowerCase() || '';
 const mimeTypes: Record = {
 'mp3': 'audio/mpeg',
 // Add more mappings as needed
 };
 const fileType = mimeTypes[fileExtension] || 'application/octet-stream';
 
 const metadata = {
 type: fileType
 };
 
 return new File([data], fileName, metadata);
}

async function sendAudioForTranscription(file_path:string) {
 try {
 
 // const audioData = fs.createReadStream(file_path);
 const audioFile = await createFile(file_path)

 const response = await openai.createTranscription(audioFile, "whisper-1");
 const transcribed = response.data.text;

 return transcribed;
 } catch (error) {
 console.error("Error transcribing the audio:", error);
 return null;
 }
}
</file>


I am new to this so any help would be appreciated. This is the error


Error transcribing the audio: TypeError: Failed to parse URL from src\audio_files\false_xxxxxxxxx8@c.us_B161BC6FA04DB01B8B31F5E0F83EDAD5.mp3
 at Object.fetch (node:internal/deps/undici/undici:11576:11)
 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
 at new NodeError (node:internal/errors:405:5)
 at new URL (node:internal/url:778:13)
 at new Request (node:internal/deps/undici/undici:7132:25)
 at fetch2 (node:internal/deps/undici/undici:10715:25)
 at Object.fetch (node:internal/deps/undici/undici:11574:18)
 at fetch (node:internal/process/pre_execution:270:25)
 at C:\Users\Ammad Ali\Documents\Documents\alex-whatsapp-bot\build\openai\transcript.js:28:32
 at C:\Users\Ammad Ali\Documents\Documents\alex-whatsapp-bot\build\openai\transcript.js:8:71
 at new Promise (<anonymous>)
 at __awaiter (C:\Users\Ammad Ali\Documents\Documents\alex-whatsapp-bot\build\openai\transcript.js:4:12)
 at createFile (C:\Users\Ammad Ali\Documents\Documents\alex-whatsapp-bot\build\openai\transcript.js:27:12)
 at Object.<anonymous> (C:\Users\Ammad Ali\Documents\Documents\alex-whatsapp-bot\build\openai\transcript.js:49:37)
 at Generator.next (<anonymous>)
 at C:\Users\Ammad Ali\Documents\Documents\alex-whatsapp-bot\build\openai\transcript.js:8:71
 at new Promise (<anonymous>) {
 input: 'src\\audio_files\\false_xxxxxxxxx8@c.us_B161BC6FA04DB01B8B31F5E0F83EDAD5.mp3',
 code: 'ERR_INVALID_URL'
 }
}
</anonymous></anonymous></anonymous></anonymous>


To get a response back in voice message


-
Can ffmpeg resume reading from a pipe after interruption ?
30 juin 2017, par T KilneyI couldn’t decide whether this was superuser, SO or video production so my apologies if you think I got it wrong.
I’ve got a number of different video streams from various inputs on the computer (some are via WiFi, some RTMP etc) and I have got them all transcoded into raw h264 frames.
Now I want to output them to an RTMP stream. For example, I will set camera1 to output to a named pipe called CAM01. I can get ffmpeg to read from the pipe, but the problem comes when I want to switch cameras. I was hoping that killing the camera1 output to the pipe, and then starting a new process that output camera2 to the same CAM01 pipe would let ffmpeg pick up the stream, however it hangs on the last frame it received before I killed the first camera.
However, if camera1’s output is interrupted for some reason (say, the wireless connection to it drops out) then FFmpeg has no problem picking up the stream when the picture comes back.
Basically, is there a way to get ffmpeg to keep reading from the pipe even when it’s temporarily interrupted, or is what I’m trying to do simply not possible this way ?
I’m a bit of a noob with named pipes, so please excuse my potential ignorance.
The command I’m currently using (note that for now it generates audio because I haven’t got audio sorted yet)ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i CAM01 -vcodec copy -acodec aac -ab 128k -g 120 -strict experimental -f flv "my_rtmp_URL"
If it matters, the CAM01 pipe basically just contains raw h264 frames (like you get out of raspivid)
TIA !
EDIT : Forgot to say, I’m on Linux Mint