
Recherche avancée
Autres articles (46)
-
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 -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...)
Sur d’autres sites (7927)
-
Fluent-FFMPEG redirects to home page when recording is finished
25 mai 2022, par Myles JeffersonI am using fluent-FFmpeg with my node.js and express server to record videos from an RTSP stream. The issue I am encountering is that once the command to record the video is finished, my React client-side always redirects to the home page of my application, even though this is not the behavior I want. I want the user to remain on the page with the RTSP stream and just receive a toast notification indicating that the recording is finished. With this issue, the page redirects before the notification has a chance to display. Is this an issue with my server-side or client-side code ?


Node.js


export const startRecording = async (req, res) => {
 const camera = req.params;
 if (camera.id in runningCommands) { return res.json({ "status": "failure", "error": "Recording already in progress" }) }
 const { recordTime, uid } = req.body;
 let conn = createConnection(config);
 conn.connect();
 let query = 'SELECT * FROM cameras WHERE id = ?';
 conn.query(query, [camera.id], (error, rows) => {
 if (error) { return res.json({ "status": "failure", "error": error }) }
 const camera = rows[0];
 const { ip, fname } = camera;
 const currentDate = new Date().toLocaleString().replace(/[:/\s]/g, '-').replace(',', '');
 const filename = `${fname}-${currentDate}`;

 try {
 // FFmpeg command to start recording
 const command = ffmpeg(`rtsp://${ip}/axis-media/media.amp`)
 .videoCodec('libx264')
 .size('1280x720')
 .duration(recordTime)
 .on('start', commandLine => {
 runningCommands[camera.id] = command
 console.log(`Spawned Ffmpeg with command: ${commandLine}`)
 })
 .on('error', err => console.error(err))
 .on('end', () => {
 delete runningCommands[camera.id]
 console.log('Recording Complete')
 takeScreenshot(filename, `./public/recordings/mp4/${filename}.mp4`)
 conn.query('INSERT INTO recordings (uid, cid, filename) VALUES (?, ?, ?)', [uid, camera.id, filename], () => conn.end())
 res.json({ "status": "success", "message": "Recording ended" })
 })
 .save(`./public/recordings/mp4/${filename}.mp4`);
 } catch (error) { console.error(error)}
 })
}



React :


const handleRecording = async () => {
 try {
 setIsRecording(true)
 const futureTime = new Date().getTime() + recordTime * 1000
 const finishedTime = new Date(futureTime).toLocaleTimeString()
 setTimeRemaining(finishedTime)
 const { data } = await publicRequest.post(`record/startRecording/${id}`, { recordTime, uid: user.id })
 window.location.reload(false)
 if (data.status === 'success') {
 setIsRecording(false)
 toast('Recording finished!', { type: 'success' })
 } else {
 setIsRecording(true)
 toast('Recording already in progress!', { type: 'error' })
 }
 } catch (error) {
 console.error(error)
 }
 }



-
Build OpenCv using static ffmpeg library
24 juillet 2020, par gaurav agarwalI am trying to build opencv for one of the commercial product. That commercial product already contains a static build of ffmpeg executable. While building OpenCv I am seeing bunch of failure most probably due to linking issues with ffmpeg.


Is it possible to build OpenCv using static ffmpeg library ? In OpenCv installation doc I can see mentioned prerequisite is :




ffmpeg or libav development packages : libavcodec-dev, libavformat-dev,
libswscale-dev




I guess this means OpenCv needs these lib to be present as shared libs. Any expert opinion will be helpful !!!


-
List Directory of files to text file sorted by creation date but don't show creation creation date in file
25 mars 2019, par Oli ShingfieldI’ve been doing some research on this problem but I can’t get my head around it to suit my particular issue.
I would like to create a text file of a list of files in a directory, sorted by date but I don’t want the date to be shown in the file.
The code I have so far is :#create list of clips to merge
save_path = 'downloads/'
ignored = 'test.bat','mergeclips.bat','draw.bat'
onlyfiles = [f for f in listdir('downloads/') if isfile(join('downloads/', f)) if f not in ignored]
with open('downloads/clipstomerge.txt', 'w') as f:
for item in onlyfiles:
f.write("file '%s'\n" % item )This code ignores the bat files but lists everything else out to a text file in a format ready for ffmpeg to merge the clips. The format of the text file looks like this :
file 'ARandomClipName.mov'
file 'Butterflies.mov'
file 'Chickens.mov'At the moment the files are sorted alphabetically but I would like it to be sorted by creation date.
Does anyone have any ideas how I could modify my code to fix my problem ?