
Recherche avancée
Autres articles (70)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...)
Sur d’autres sites (12368)
-
Firebase function to convert YouTube to mp3
9 octobre 2023, par satchelI want to deploy to Firebase cloud functions.


However, I get a vague error : “Cannot analyze code” after it goes through the initial pre deploy checks successfully.


But I cannot figure out the problem given the vagueness of the error.


It looks right with these requirements :


- 

- receive a POST with JSON body of YouTube videoID as a string
- Download locally using the YouTube download package
- Pipe to the ffmpeg package and save mp3 to the local temp
- Store in default bucket on firestore storage
- Apply make public method to make public












const functions = require('firebase-functions');
const admin = require('firebase-admin');
const ytdl = require('ytdl-core');
const ffmpeg = require('fluent-ffmpeg');
const fs = require('fs');
const path = require('path');
const os = require('os');

admin.initializeApp();

// Set the path to the FFmpeg binary
const ffmpegPath = path.join(__dirname, 'bin', 'ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);

exports.audioUrl = functions.https.onRequest(async (req, res) => {
 if (req.method !== 'POST') {
 res.status(405).send('Method Not Allowed');
 return;
 }

 const videoId = req.body.videoID;
 const videoUrl = `https://www.youtube.com/watch?v=${videoId}`;
 const audioPath = path.join(os.tmpdir(), `${videoId}.mp3`);

 try {
 await new Promise((resolve, reject) => {
 ytdl(videoUrl, { filter: format => format.container === 'mp4' })
 .pipe(ffmpeg())
 .audioCodec('libmp3lame')
 .save(audioPath)
 .on('end', resolve)
 .on('error', reject);
 });

 const bucket = admin.storage().bucket();
 const file = bucket.file(`${videoId}.mp3`);
 await bucket.upload(audioPath, {
 destination: file.name,
 metadata: {
 contentType: 'audio/mp3',
 },
 });

 // Make the file publicly accessible
 await file.makePublic();

 const publicUrl = file.publicUrl();
 res.status(200).send({ url: publicUrl });
 } catch (error) {
 console.error('Error processing video:', error);
 res.status(500).send('Internal Server Error');
 }
});



The following is the
package.json
file which is used to reference the dependencies for the function, as well as the entry point, which I believe just needs to be the name of the filename with the code :

{
 "name": "firebase-functions",
 "description": "Firebase Cloud Functions",
 "main": "audioUrl.js", 
 "dependencies": {
 "firebase-admin": "^10.0.0",
 "firebase-functions": "^4.0.0",
 "ytdl-core": "^4.9.1",
 "fluent-ffmpeg": "^2.1.2"
 },
 "engines": {
 "node": "18"
 },
 "private": true
}



(Edit) Here is the error :


deploying functions
✔ functions: Finished running predeploy script.
i functions: preparing codebase default for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8171

shutdown requested via /__/quitquitquit


Error: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error



Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error



I get the same error when running the following :


firebase deploy --only functions:audioUrl



And I thought I might get more detailed errors using the emulator :


firebase emulators:start



Under the emulator I had this additional error initially :


Your requested "node" version "18" doesn't match your global version "16". Using node@16 from host.



-
libavfilter/dnn : Add scale and mean preprocess to openvino backend
21 septembre 2023, par Wenbin Chenlibavfilter/dnn : Add scale and mean preprocess to openvino backend
Dnn models has different data preprocess requirements. Scale and mean
parameters are added to preprocess input data.Signed-off-by : Wenbin Chen <wenbin.chen@intel.com>
-
Implementing Live Streaming Webinar Architecture - Need Guidance
21 septembre 2023, par vishnugplQuestion : I'm working on a project to implement a live streaming webinar platform, and I'm looking for guidance on the architecture and technologies to use. I have some specific requirements and constraints, and I'd appreciate any advice or pointers on how to get started.


Context :
I'm tasked with building a live streaming webinar platform from scratch for our organization. Here are some key requirements and constraints :


- 

-
Live Video Streaming : We need to support live video streaming for
webinars, workshops, and conferences. Low latency is crucial for
real-time interaction between presenters and attendees.


-
Scalability : The platform should be able to handle a large number of concurrent attendees, potentially thousands or more,
without compromising performance.


-
Security : Security is a top priority. We need to ensure that only authorized users can access the webinars, and we must protect
against unauthorized recording or distribution of the content.


-
User Interaction : Attendees should be able to ask questions, participate in polls, and interact with presenters in real-time.


-
Recording and Playback : We also want to provide recorded versions of past webinars for on-demand viewing (HLS).














Current Tech Stack :


- 

- Frontend : React
- Backend : Node.js with Express
- Database : MongoDB
- Cloud Hosting : AWS










Questions :


- 

-
What technologies or services are best suited for handling live video streaming with low latency ?


-
How can I ensure scalability in terms of both video streaming and handling a large number of users ?


-
What security measures should I consider to protect the content and user data ?


-
Are there any recommended frameworks or libraries for building interactive features like real-time chat and polling ?


-
What's the best approach for recording and serving on-demand webinar content ?














Additional Information :


- 

-
Budget is a consideration, so cost-effective solutions are preferred.


-
Any open-source or third-party tools that can simplify development are welcome.


-
I have experience with AWS, but I'm open to other cloud providers if they offer advantages for this project.










-