
Recherche avancée
Autres articles (39)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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 (8033)
-
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`))
 });
 })



-