
Recherche avancée
Autres articles (38)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (4184)
-
NodeJS/ffmpeg : Can't create screenshot of stream file
11 septembre 2017, par user3142695I need to create a screenshot via ffmpeg (
node-fluent-ffmpeg
: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg) of a stream, as my data is stored in a gridFS.This is how I’m doing that with a local file - and it works so far
ffmpeg('/Users/Anybody/Downloads/1test.mp4')
.on('error', (error) => {
console.error(error)
})
.on('end', () => {
console.log('Screenshots taken')
})
.screenshots({
folder: '/Users/Anybody/Downloads/',
timestamps: ['00:01.000']
})But if I change the code to use a stream (
gridfs-stream
), no file is created, although the output gives me a successful message :import Grid from 'gridfs-stream'
const gfs = Grid(
MongoInternals.defaultRemoteCollectionDriver().mongo.db,
MongoInternals.NpmModule
)
ffmpeg(gfs.createReadStream({ _id: sourceId }))
.on('filenames', (filenames) => {
console.log('Will generate ' + filenames.join(', '))
})
.on('codecData', (data) => {
console.log('Input is ' + data.audio + ' audio ' + 'with ' + data.video + ' video')
})
.on('error', (error) => {
console.error(error)
})
.on('end', () => {
console.log('Screenshots taken')
})
.screenshots({
folder: '/Users/Anybody/Downloads/',
timestamps: ['00:01.000']
})Output
Will generate tn.png
Input is aac (mp4a / 0x6134706D) audio with h264 (avc1 / 0x31637661) video
Screenshots taken -
Reading file metadata in nodejs with ffmetadata and fs returns undefined
10 novembre 2020, par CitanafI cant seem to get this right. I am attempting to read a file's metadata (title) with ffmetadata via a loop on the folder using fs. I would then like to push those properties into an object array called files. If I place the push method inside the ffmetadata, it throws a "push is not a function" error. If I place the push method outside ffmetadata, but inside readdirSync, the object gets created, but the titles are undefined.


I think I'm running into a asynchronous issue or a variable scope issue ? I've place several Console.logs over this and the return from the metadata returns after code that comes well after this section.


Any help is appreciated.


var path = './AudioFiles/'
var files = [];
var fTitle

//Read list of files
fs.readdirSync(path).forEach((file) => {
 ffmetadata.read(path + file, function(err, data){
 if (err) console.error("Error reading metadata", err);
 else {
 fTitle = data.title
 }
 })
 files.push({name:file.replace('.mp3',''),title:fTitle})
})



This is what I am receiving :


files = [{name:"myFile1",title:undefined},{name:"myFile2",title:undefined}...]



I am expecting the below results :


files = [{name:"myFile1",title:"myFile1Title"},{name:"myFile2",title:"myFile2Title"}...]



-
Save a partial video file locally using NodeJS
25 octobre 2017, par SamiI have a serverless web application that is deployed on
AWS
and I have to take a screenshot from an uploaded video toS3
. I am usingffmpeg
to extract the screenshot but the only drawback is that I have to download the video file first in order to letffmpeg
work with it.
Knowing the fact I am usingAWS Lambda
and I don’t have limits for video length users might upload large files which makesAWS Lambda
to hit the storage limit.
To overcome this I thought of downloading a small chunk of the video and use it withffmpeg
to extract the thumbnail so using theS3.getOjbect
method with range params I was able to download a chunk of the file butffmpeg
couldn’t understand it.
Here is my code :s3.getObject({
Bucket: bucketName,
Key: key,
Range: 'bytes=0-1048576'
}, (err, data) => {
fs.writeFile(fileName, data.Body, error => {
if (error)
console.log(error)
else
console.log('File saved');
})
})And the code to extract the thumbnail :
const ffmpeg = require('fluent-ffmpeg');
new ffmpeg(fileName).screenshots({
timestamps: [0],
filename: 'thumb.png',
folder: '.'
})And I am getting this error from
ffmpeg
Error: ffmpeg exited with code 1: ./test.mp4: Invalid data found when processing input
I know there is a problem in saving the file like this but I couldn’t find any solution that solves my problem. If anybody has one that would be much appreciated.
UPDATE :
It turns out thatffmpeg
does this for me, I just gave it theurl
and it downloaded what it needs to render the screenshot without the need to download the file locally and the code looks like this :const ffmpeg = require('fluent-ffmpeg');
new ffmpeg(url).screenshots({
timestamps: [0],
filename: 'thumb.png',
folder: '.'
})