madebyhiro / codem-transcode

Offline video transcoder written in node.js
Other
153 stars 68 forks source link

Transcoder fails on a cross-file system "mv" operation #8

Closed tieleman closed 11 years ago

tieleman commented 12 years ago

Should catch this error (EXDEV) and use a copy/unlink in that case.

jverelst commented 11 years ago

I've run into this problem too now. Here's a solution:

http://stackoverflow.com/questions/4568689/how-do-i-move-file-a-to-a-different-partition-in-node-js

Could this be fixed, maybe as a fallback (try a rename first, a copy-move otherwise). Or as an extra configuration-option. I'm trying to use the same codem instance to transcode files from different remotely mounted sources, but this now fails because scratch-dir needs to be on the same mounted resource as the destination dir. But with different destination dirs, this is not possible.

tieleman commented 11 years ago

It will be fixed in a future release, but for now there is a workaround that you can use: the use_scratch_dir option in the config file. If you set this to false the tmp files will be created directly in the destination directory and renamed to their final name once transcoding is complete. That way there will be no cross-file system issues. See:

https://github.com/madebyhiro/codem-transcode#configuration