-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug?] Cannot deal with local files when run from command line via node #1042
Comments
Did you preload or embed the files you need? |
@kripken interesting! i missed that out and have studied now. i will try to set up directories with 'preRun' ... |
@kripken okay here is my first problem: i cannot read the images. hope you can help? i have added now when I run you see the error that it cannot read the images.
the images are in a subfolder of that js file: what can i do to make these images readable? when i open line 9750 in vim to inspect |
You should be able to load the file normally from that path. Try to build a smaller case first. For example see test_files in |
A smaller case? I cannot break down avconv in smaller pieces. And 1. QuestionI have this in Module.preRun: FS.createPath('/', 'tmp/images/', true, false);
FS.createPath('/', 'tmp/video/', false, true); Tell me, how can I verify in a kind of debug mode if emcc really has set them up? 2. Question:Does |
You can do But createPath just creates the path. It doesn't know where to get contents for it. See |
Thanks for not giving up on me. I really want to solve this. I tried
weird. then i tried using how should i call this function properly? then i tried something else with
then i see these warnings:
what do these tell you? |
|
@kripken ok will check out |
Contents should be empty until you place data in it with wget or another method. No blob constructor means the browser lacks a crucial feature. Which browser and version are you on? |
forget the browser for now. i want to call it from command line. i found a way to fill contents with var fs = require('fs')
, path = require('path');
var source = 'tmp/images/'
, destination = 'tmp/video/';
var Module = {
'preRun': function() {
var sourcePath = FS.createPath('/', source, true, false)
, destinationPath = FS.createPath('/', destination, false, true);
var files = fs.readdirSync(source);
files.forEach(function(filename) {
var file = path.join(source, filename);
if (path.extname(filename) == '.jpg') {
var data = fs.readFileSync(file);
FS.createDataFile(sourcePath, filename, data, true, false);
}
});
},
'arguments': [
'-f', 'image2',
'-r', 15,
'-i', source + '%d.jpg',
'-an', // disable sound
'-b:v', '512k',
'-loglevel', 'info',
'-c:v', 'libvpx',
'-r', '25',
'-y', destination + 'test.webm'
]
}; now unfortunately, the big problem remains: avconv still says it cannot find any images in the folder: hmmm .... why? |
Code looks ok. Make sure the program is looking at the exact same path you added the files in. Relative/absolute paths might be an issue. |
Absolute paths do not work either. When I prepend Do you want me to post the 3.3MB large avconv.js file for analysis? I have no idea what to do at this stage and need your help. |
I suggest adding some debug printouts in the FS code - when it reaches analyzePath, print what it looks for and what does actually exist. It should call analyzePath from your C/C++ code that tries to read stuff. |
ok, i added a not very helpful since i am expecting something with i am preloading the images with is there a way to compile the js file without having strings as memory references so that i can debug the code easier? and do you know anyone else who could help me, really? |
Compile with I recommend trying a smaller testcase. Try writing a standalone C file and load a file there, then read it from C. |
Code is less garbled with I do not know C well and can't do a smaller test case. I really want to port ffpmeg/avconv to JavaScript very badly.I'm sure others want it too. Can you recommend anyone else who could support me? |
I don't know, but you can ask on the mailing list or irc perhaps. In general, ports like these do require a lot of C knowledge, enough to build and modify the original project. It's rare things work 100% out of the box. |
I see. Then I'm wiling to give an emscripten + C experienced person that job. @kripken Can you count me some names you know have been successful with emscripten and I'll ping them myself. I already tried with the mailing list but noone replied. I really need help and want this to be solved. Thanks! |
All I know are people that read the mailing list anyhow, so I doubt it would help (basically the same people you see on commits). |
Ok, will look at commits. Tell me, did you develop emscripten alone? |
I did most of the work originally, but it's gotten more balanced over time. On Thu, May 2, 2013 at 6:39 PM, Michael Heuberger
|
Respect for what you did here! Alright, I have asked emscripten-discuss@googlegroups.com for help. Again. Wait see if anybody responds. ... |
Still no response ... can anyone help me? |
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Hello again
I'm not so sure if emcc generated javascript is able to act with local files.
For example I have this:
you see it does not want to read files from the directory tmp/images within that folder. I opened the file avconv.js and tried to debug. But it's huge, 3.5 MB and full with heaps.
So I'm really unable to judge if it's a bug or not. Or maybe I have to change the location of the images or something? Any advice is very welcome.
Thanks,
Michael
The text was updated successfully, but these errors were encountered: