I'm trying to use videoshow to convert multiple images to video, I have tried to change my code multiple times but now as you can see this is basically the same as in the module's description page. Still I am receiving the following error as stated below.
videoshow(images)
.save('video.mp4')
.on('start', function (command) {
console.log('ffmpeg process started:', command)
})
.on('error', function (err) {
console.error('Error:', err)
})
.on('end', function (output) {
console.log('Video created in:', output)
})
Error: Error: ffmpeg exited with code 1: Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #2:0
Conversion failed!
at ChildProcess.<anonymous> (C:\Users\xxxxxx\Documents\Visual Studio 2017\Projects\Frame\Frame\server-side\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Check aspect ratio and resolution of images, if your all images or any one have different resolution and aspect ratio then it will give you error. try with all same resolution images.
Related
I wrote a simple smart contract in Solidity 0.6.6 that I'm trying to deploy to the BSC Testnet.
This is what I have in my truffle-config.js file (privateKeys is an array with a single entry of ['0x + privatekey']:
networks: {
bscTestnet: {
provider: () => new HDWalletProvider(
privateKeys,
'https://data-seed-prebsc-1-s1.binance.org:8545/'
),
network_id: 97,
skipDryRun: true
}
}
When I run the command "truffle migrate --reset --network bscTestnet" I get the following error:
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'bscTestnet'
> Network id: 97
> Block gas limit: 30000000 (0x1c9c380)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- cb is not a function.
at /Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration._deploy (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:70:1)
at Migration._load (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:56:1)
at Migration.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:217:1)
at Object.runMigrations (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:80:1)
at Object.module.exports [as run] (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:44:1)
at Command.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:189:1)
Truffle v5.4.31 (core: 5.4.31)
Node v17.4.0
Opened an Issue a about it: https://github.com/trufflesuite/truffle/issues/4676
I guess its a bug in HardwareWallet2.0.2.
Reverting to HardwareWallet2.0.0 solved the problem for me
npm i #truffle/hdwallet-provider#2.0.0
UPDATE:
Right, workaround: I rolled #HDWalletProvider back to v2.0.1 and was able to migrate.
I assume there must be an issue with the new version for ppl who updated today.
================
Same problem with Polygon Mumbai.
Function "cb" refers to the callback function. The strange part is the error message doesn't reference my own code at all; it references the migrations.js located in:
<.nvm/versions/node/v16.11.1/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at processTicksAndRejections (node:internal/process/task_queues:96:5>
This leads me to believe there's a problem with out 1_initial_migration.js... however that's auto-generated so I can't see any problem... it's strange.
1_initial_migration.js:
const Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
I've spent the whole day trying to get any of the npmpackages related to playing audio from nodejs but couldn't get any to work.
Basically what I need is to play batch audios.
For example:
//files containing the name of the audios
var files = require('./list-of-audios-to-play.json')
var player = require('play-sound')(opts = {})
var counter = 0;
//every 5 seconds, play the referenced audio
setInterval(function(){
counter++;
player.play(files[counter]+'.mp3', function(err){
if (err) throw err
})
},5000)
Tried everything.
When I run the above code, I get this error:
INFORMATION: wasnt possible to locate files for the specified pattern(s)
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn play ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
Can anyone help?
I would like to get the file from this url : https://donnees.roulez-eco.fr/opendata/instantane
As you can see there's no file name in the URL.
My problem is with this simple code :
var file = fs.createWriteStream('./myFile.zip')
http.get(url, function(response) {
response.pipe(file);
}
This code works well if you got an url like https://someurl.com/filename.zip.
The file is downloaded and can be use but this response.pipe(file) line throw me this error:
events.js:163
throw er; // Unhandled 'error' event
^
Error: Parse Error
at TLSSocket.socketOnData (_http_client.js:411:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at TLSSocket.Readable.push (_stream_readable.js:136:10)
at TLSWrap.onread (net.js:559:20)
What should / can i do to fix this?
I am learning Node.js via the book Node.js the Right Way. I am trying to run the following example to watch changes to a file called target.txt that resides in the the same directory as the .js file.
"use strict";
const
fs = require('fs'),
spawn = require('child_process').spawn,
filename = process.argv[2];
if (!filename) {
throw Error("A file to watch must be specified!");
}
fs.watch(filename, function () {
let ls = spawn('ls', ['-lh', filename]);
ls.stdout.pipe(process.stdout);
});
console.log("Now watching " + filename + " for changes...");
I get the following error when I change the text file and save it:
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn ls ENOENT
at exports._errnoException (util.js:1018:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
Node.js version: v6.11.0
IDE: Visual Studio Code 1.13.1
OS: Windows 10 64x
There's no ls on Windows, you should use dir instead.
However, that's not an executable. To run .bat and .cmd files you can:
Spawn cmd.exe and pass those files as arguments:
require('child_process').spawn('cmd', ['/c', 'dir']);
Use spawn with the shell option set to true:
require('child_process').spawn('dir', [], { shell: true });
Use exec instead of spawn:
require('child_process').exec('dir', (err, stdout, stderr) => { ... });
For more on that, take a look at this section in the official docs.
EDIT:
I'm not sure I understood you question in the comment correctly, but if you go for the second option, for example, you code will look like this:
...
fs.watch(filename, function () {
let dir = spawn('dir', [filename], { shell: true });
dir.stdout.pipe(process.stdout);
});
...
Please, keep in mind you may need to adjust this code slightly. I'm writing all this from memory as I don't have access to a Windows machine right now, so I can't test it myself.
The following is my code, It works in windows with out error but when I setup my project in server (linux) it is not working and throws error
var spawn = require('child_process').spawn,
javaCmd= spawn('java', ['-cp',__dirname+'/Java/jdk1.7.0_45/lib/dom4j.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/geronimo-stax-api_1.0_spec-1.0.1.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/gson-2.2.4.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/mysql-connector-java-5.1.6.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/ooxml-schemas-1.0.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/poi-3.9-20121203.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/poi-ooxml-3.9.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/xmlbeans-2.5.0.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/xmlbeans-xmlpublic-2.6.0.jar;'+__dirname+'/Java/jdk1.7.0_45/lib/excelreader.jar', 'astral.excelreader.Main', catid, id,target_path]);
javaCmd.stdout.on('data', function (data) {
console.log(data);
});
javaCmd.stdout.on('close', function(code) {
console.log(code);
});
javaCmd.stderr.on('data', function (data) {
console.log(data);
});
Following is the error
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Anybody know its reason? I did n't set any other path for java. I tried to set using $ vi ~/.bash_profile but I got the following response
-bash: $: command not found
Anybody know how to set path in linux server