
Recherche avancée
Autres articles (86)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
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 (...) -
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)
Sur d’autres sites (9450)
-
How to maximize ffmpeg crop and overlay thousand block in same time ?
22 juin 2022, par yuno sagaI try to encrypt a frame of video to random of 16x16 block. so the result will be like artifact video. but exactly it can be decode back. only the creation that know the decode algorithm. but my problem is ffmpeg encode so slow. 3 minutes video, 854x480 (480p) https://www.youtube.com/watch?v=dyRsYk0LyA8. this example result frame that have been filter https://i.ibb.co/0nvLzkK/output-9.jpg. each frame have 1589 block. how to speed up this things ? 3 minutes only 24 frame done. the vido have 5000 thousand frame, so for 3 minutes video it takes 10 hours. i dont know why ffmpeg only take my cpu usage 25%.


const { spawn } = require('child_process');
const fs = require('fs');

function shuffle(array) {
 let currentIndex = array.length, randomIndex;
 
 // While there remain elements to shuffle.
 while (currentIndex != 0) {
 
 // Pick a remaining element.
 randomIndex = Math.floor(Math.random() * currentIndex);
 currentIndex--;
 
 // And swap it with the current element.
 [array[currentIndex], array[randomIndex]] = [
 array[randomIndex], array[currentIndex]];
 }
 
 return array;
 }

function filter(width, height) {
 const sizeBlock = 16;
 let filterCommands = '';
 let totalBlock = 0;
 const widthLengthBlock = Math.floor(width / sizeBlock);
 const heightLengthBlock = Math.floor(height / sizeBlock);
 let info = [];

 for (let i=0; i < widthLengthBlock; i++) {
 for (let j=0; j < heightLengthBlock; j++) {
 const xPos = i*sizeBlock;
 const yPos = j*sizeBlock;
 filterCommands += `[0]crop=${sizeBlock}:${sizeBlock}:${(xPos)}:${(yPos)}[c${totalBlock}];`;

 info.push({
 id: totalBlock,
 x: xPos,
 y: yPos
 });

 totalBlock += 1;
 } 
 }

 info = shuffle(info);

 for (let i=0; i < info.length; i++) {
 if (i == 0) filterCommands += '[0]';
 if (i != 0) filterCommands += `[o${i}]`;

 filterCommands += `[c${i}]overlay=x=${info[i].x}:y=${info[i].y}`;

 if (i != (info.length - 1)) filterCommands += `[o${i+1}];`; 
 }

 return filterCommands;
}

const query = filter(854, 480);

fs.writeFileSync('filter.txt', query);

const task = spawn('ffmpeg', [
 '-i',
 'C:\\Software Development\\ffmpeg\\blackpink.mp4',
 '-filter_complex_script',
 'C:\\Software Development\\project\\filter.txt',
 '-c:v',
 'libx264',
 '-preset',
 'ultrafast',
 '-pix_fmt',
 'yuv420p',
 '-c:a',
 'libopus',
 '-progress',
 '-',
 'output.mp4',
 '-y'
], {
 cwd: 'C:\\Software Development\\ffmpeg'
});

task.stdout.on('data', data => { 
 console.log(data.toString())
})



-
Batch interval screenshot with timestamps
7 juin 2019, par dokoI’m trying to make a script to batch screenshot videos per an interval with bash and ffmpeg (e.g. 1 screenshot per second)
But the problem is that ffmpeg doesn’t have an option to output the frames with filenames containing their timestamp within the video (not local computer time).I’ve found some hacky solutions to do this, but they’re all pretty buggy, inaccurate and doesn’t work in all use cases (such as videos with variable framerate)
So are there better solutions or tools to do this kind of task ?
#!/bin/bash
for i in *.$1; do #define video extension
if [ ! -d "$PWD/${i%.*}" ]; then #if directory does not exist yet
mkdir -p "${i%.*}" #create folder based on filename
ffmpeg -i "$i" -vf fps="1/$2" "$PWD/${i%.*}/${i%.*}.%04d.png" #output screenshots
fi
doneEDIT :
I remade my script based on Gyan’s answerIf anyone with more expertise can point out any mistakes, please do so.
#!/bin/bash
#./batch_screenshot.sh [video format] [screenshot interval in seconds]
#given video1.mp4, video2.mp4, etc. within a directory, script will output the video screenshots to folders called video1, video2, etc. with the image filename of video1 - HH-MM-SS.png, video2 - HH-MM-SS.png, etc.
orig="$PWD"
for i in *.$1; do
if [ ! -d "$PWD/${i%.*}" ]; then #if directory does not exist yet
mkdir -p "${i%.*}" #create them
ffmpeg -i "$i" -vf select="floor(t*1/$2)-floor(prev_t*1/$2)" -r 1000 -vsync 0 -frame_pts true "$PWD/${i%.*}/%d.png" #output screenshots
cd "$PWD/${i%.*}"
for r in *.png; do #batch rename all the output files
seconds=$(( "${r%.*}" / 1000 )) #convert miliseconds in filename to seconds
timestamp=$(date -d@"$seconds" -u +%H-%M-%S) #convert seconds to hh:mm:ss format
mv "$r" "${i%.*} - $timestamp.png" #rename
done
cd "$orig"
fi
done -
Revision f069335e8811d8f8250facaf6da284b039a86e10 : SQLite fait une division entiere sur le timestamp, il en resulte une date ...
11 octobre 2010, par Cerdic — LogSQLite fait une division entiere sur le timestamp, il en resulte une date arrondie au jour precedent, malgre le ceil qui suit. On reformule avec un floor qui devrait marcher dans tous les SQL git-svn-id : svn ://trac.rezo.net/spip/branches/spip-2.1@16474 (...)