
Recherche avancée
Autres articles (40)
-
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site -
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 (...)
Sur d’autres sites (2694)
-
Nodejs couldn't find the ffmpeg module for some reason
29 décembre 2020, par ChawchawchawI need to display the live streaming vidoe(rtsp) on a website(http, vue framework) with nodejs and vue framework.


I've looked it up a lot and got the basic logic of what they are and how it works.
So I'm planning on to convert rtsp to hls with nodejs using socket.io and display it on a web.(let me know if there's more efficient way way to do it)


The thing is, for some reason, when I try to develop it in my backend(nodejs), node just keep sends me an error that FFMpeg module wasn't found. It's been over a week.. please help.


Btw, all works with ffmpeg cmd(window powerShell).


How I set up(ffmpeg) :


- 

-
downloaded ffmpeg from https://ffmpeg.org/


-
added to system path : C :\Users\Marie\Desktop\ffmpeg-4.3.1-2020-11-19-full_build\bin


-
tested with window powerShell and converted rstp to m3u8 :


ffmpeg -i 'rtsp ://ip.ip.ip/media/video1' -hls_time 3 -hls_wrap 10 'C :\Users\Marie\Desktop\tmp\hls/streaming.m3u8'










below is a screen shot of no. 3 result




how I set up(nodejs)


- 

- npm i ffmpeg fluent-ffmpeg rtsp-ffmpeg
- I've just copied and pasted the example working code and changed rtsp link to mine. e.g : (https://www.npmjs.com/package/rtsp-ffmpeg)






=> didn't work out, error says can't find ffmpeg module


- 

- set up path manually e.g.) ffmpeg.setFfmpegPath(path)




=> didn't work out. error says can't find ffmpeg module


...
I've seriously tried almost everything like delete, re-install ffmpeg, changed path, added path manyally, .. Please help....


Edited :
package.json


{
 "name": "streaming",
 "version": "1.0.0",
 "description": "",
 "main": "index.js",
 "scripts": {
 "start": "node app.js"
 },
 "author": "",
 "license": "ISC",
 "dependencies": {
 "express": "^4.17.1",
 "ffmpeg": "0.0.4",
 "fluent-ffmpeg": "^2.1.2",
 "jsmpeg": "^1.0.0",
 "node-media-server": "^2.2.4",
 "node-onvif": "^0.1.7",
 "node-rtsp-stream": "0.0.9",
 "rtsp-ffmpeg": "0.0.15",
 "socket.io": "^3.0.4",
 "ws": "^7.4.1"
 }
}



app.js


const Stream = require('node-rtsp-stream')

// let path = 'C:/Users/Marie/Desktop/ffmpeg-4.3.1-2020-11-19-full_build/bin/ffmpeg.exe'
// let path = 'C:/Users/Marie/Desktop/ffmpeg-4.3.1-2020-11-19-full_build/bin/'
let path = 'C:/Users/Marie/Desktop/ffmpeg-4.3.1-2020-11-19-full_build/bin'
const ffmpeg = require('fluent-ffmpeg')

ffmpeg.setFfmpegPath(path)

stream = new Stream({
 name: 'name',
 streamUrl: 'rtsp://ip.ip.ip.ip/media/video1',
 wsPort: 9999,
 ffmpegOptions: { // options ffmpeg flags
 '-stats': '', // an option with no neccessary value uses a blank string
 '-r': 30 // options with required values specify the value after the key
 }
})



Error : spawn ffmpeg ENOENT


app.js (for another test)


const app = require( 'express' )(),
 server = require( 'http' ).Server( app ),
 io = require( 'socket.io' )( server ),
 rtsp = require( 'rtsp-ffmpeg' )

process.env.FFMPEG_PATH = 'C:/Users/Marie/Desktop/ffmpeg-4.3.1-2020-11-19-full_build/bin/ffmpeg.exe'
// console.log( rtsp.FFMpeg )

server.listen( 6147 )
var uri = 'rtsp://ip.ip.ip.ip/media/video1',
 stream = new rtsp.FFMpeg( { input: uri } )
io.on( 'connection', function ( socket )
{
 var pipeStream = function ( data )
 {
 socket.emit( 'data', data.toString( 'base64' ) )
 }
 stream.on( 'data', pipeStream )
 socket.on( 'disconnect', function ()
 {
 stream.removeListener( 'data', pipeStream )
 } )
} )
app.get( '/', function ( req, res )
{
 res.sendFile( __dirname + '/index.html' )
} )



error :
FMpeg executable wasn't found. Install this package and check FFMpeg.cmd property


nodejs version = 10.16.3


-
-
Can't install the ffmpeg module
24 février 2021, par CursedI'm trying to install ffmpeg-binaries it works perfectly local but when I go to hiroku it starts to say that he can't find the modules.



This is for a Discord bot, running node.js I tried to install with npm other ffmpeg's but only that works without implementing the ffmpeg itself



Installing node modules (package.json + package-lock)



> lzma-native@3.0.8 install /tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native
 > node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build

 node-pre-gyp ERR! Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v3.0.8-node-v67-linux-x64.tar.gz 
 node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.8 and node@11.6.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp) 
 node-pre-gyp ERR! Tried to download(undefined): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v3.0.8-node-v67-linux-x64.tar.gz 
 node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.8 and node@11.6.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp) 
 gyp: Call to 'sh liblzma-config.sh "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/build" "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/deps/xz-5.2.3.tar.bz2"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
 gyp ERR! configure error 
 gyp ERR! stack Error: `gyp` failed with exit code: 1
 gyp ERR! stack at ChildProcess.onCpExit (/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
 gyp ERR! stack at ChildProcess.emit (events.js:188:13)
 gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
 gyp ERR! System Linux 4.4.0-1031-aws
 gyp ERR! command "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/bin/node" "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64"
 gyp ERR! cwd /tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native
 gyp ERR! node -v v11.6.0
 gyp ERR! node-gyp -v v3.8.0
 gyp ERR! not ok 
 node-pre-gyp ERR! build error 
 node-pre-gyp ERR! stack Error: Failed to execute '/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/bin/node /tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64/lzma_native.node --module_name=lzma_native --module_path=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64' (1)
 node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
 node-pre-gyp ERR! stack at ChildProcess.emit (events.js:188:13)
 node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
 node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
 node-pre-gyp ERR! System Linux 4.4.0-1031-aws
 node-pre-gyp ERR! command "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/bin/node" "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
 node-pre-gyp ERR! cwd /tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native
 node-pre-gyp ERR! node -v v11.6.0
 node-pre-gyp ERR! node-pre-gyp -v v0.6.39
 node-pre-gyp ERR! not ok 
 Failed to execute '/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/bin/node /tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64/lzma_native.node --module_name=lzma_native --module_path=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64' (1)
 gyp: Call to 'sh liblzma-config.sh "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/build" "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/deps/xz-5.2.3.tar.bz2"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
 gyp ERR! configure error 
 gyp ERR! stack Error: `gyp` failed with exit code: 1
 gyp ERR! stack at ChildProcess.onCpExit (/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
 gyp ERR! stack at ChildProcess.emit (events.js:188:13)
 gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
 gyp ERR! System Linux 4.4.0-1031-aws
 gyp ERR! command "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/bin/node" "/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native/binding-v3.0.8-node-v67-linux-x64"
 gyp ERR! cwd /tmp/build_681c54b9c6315cfb1c9672e8da7d4803/node_modules/decompress-tarxz/node_modules/lzma-native
 gyp ERR! node -v v11.6.0
 gyp ERR! node-gyp -v v3.8.0
 gyp ERR! not ok 
 npm ERR! code ELIFECYCLE
 npm ERR! errno 1
 npm ERR! lzma-native@3.0.8 install: `node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the lzma-native@3.0.8 install script.
 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 npm ERR! A complete log of this run can be found in:
 npm ERR! /tmp/npmcache.85YKx/_logs/2019-01-13T20_55_48_321Z-debug.log
</anonymous>


-
How do I receive buffered files or streams from the fluent-ffmpeg module ?
26 février 2021, par yahoo2344Logic was created to replace gif files with mp4 files. However, after saving the gif file to the server, the file is imported and converted to an mp4 file, the mp4 file is saved to the server and the file is read to return the buffer.


Here's a question.


- 

-
When I recall files from the fmpeg module, can I receive them in a buffer or stream instead of a path ?


-
Is there a way to receive the converted file as a buffer or stream without saving it ?








return new Promise((resolve, reject) => {
 fs.writeFile(path.join(__dirname, `input.gif`), file, (err) => {
 if (err) {
 reject(null)
 }
 ffmpegg(path.join(__dirname, `input.gif`))
 .size(`500x500`)
 .format('mp4')
 .outputOptions([
 '-movflags faststart',
 '-pix_fmt yuv420p',
 //'-vf scale=trunc(iw/2)*2:trunc(ih/2)*2'
 ]).on('end', () => {
 fs.readFile(path.join(__dirname, `output.mp4`), (err, mp4Buffer) => {
 fs.unlink(path.join(__dirname, `input.gif`), (e) => { if (e) console.log('error delete!') })
 fs.unlink(path.join(__dirname, `output.mp4`), (e) => { if (e) console.log('error delete!') })
 if (err) {
 reject(null)
 }
 resolve(mp4Buffer)
 });
 }).save(path.join(__dirname, `output.mp4`))
 });
 })



-