FallingSnow / h265ize

A node utility utilizing ffmpeg to encode videos with the hevc codec.
MIT License
527 stars 81 forks source link

--delete causes ENOENT. #92

Open skarekrow opened 7 years ago

skarekrow commented 7 years ago

Passing --delete to the latest GitHub version(h265ize master#6e15704) results in the encode immediately halting due to non-existance of h265/MOVIE, which is expected, as it will be replacing ./MOVIE.

Unhandled rejection Error: ENOENT: no such file or directory, unlink '/mnt/nas/purchased/movies/The Big Lebowski (1998)/h265/The Big Lebowski.mkv'
    at Object.fs.unlinkSync (fs.js:1066:18)
    at /root/n/lib/node_modules/h265ize/lib/classes/video.js:1258:20
    at arrayEach (/root/n/lib/node_modules/h265ize/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/root/n/lib/node_modules/h265ize/node_modules/lodash/lodash.js:9359:14)
    at /root/n/lib/node_modules/h265ize/lib/classes/video.js:1257:15
    at Video.cleanUp (/root/n/lib/node_modules/h265ize/lib/classes/video.js:1256:16)
    at Video.stop (/root/n/lib/node_modules/h265ize/lib/classes/video.js:1251:21)
    at Encoder.removeVideo (/root/n/lib/node_modules/h265ize/lib/classes/encoder.js:176:19)
    at EventEmitter.<anonymous> (/root/n/lib/node_modules/h265ize/lib/classes/encoder.js:147:23)
    at emitOne (events.js:96:13)
    at EventEmitter.emit (events.js:189:7)
    at /root/n/lib/node_modules/h265ize/lib/classes/video.js:1181:26
From previous event:
    at Video.start (/root/n/lib/node_modules/h265ize/lib/classes/video.js:1173:34)
    at Encoder.loop (/root/n/lib/node_modules/h265ize/lib/classes/encoder.js:151:15)
    at Encoder.start (/root/n/lib/node_modules/h265ize/lib/classes/encoder.js:73:18)
    at /root/n/lib/node_modules/h265ize/h265ize:255:25

Complete log here

FallingSnow commented 7 years ago

Complete log here

This suggest an error occurred with ffmpeg, most likely due to an issue similar to the Monsters Inc issue.

It seems like the snippet above is an error from h265ize trying to remove the failed encode, but since the encode never started there is no file. This can be ignored. Also the snippet is not contained in the complete log so I'm having trouble understanding where it occurred.

Lastly, try running

ffmpeg -n 10 /root/bin/ffmpeg -i "The Big Lebowski.mkv" -y -acodec copy -vcodec libx265 -filter:v crop=1920:1040:0:20 -c:s copy -c:d copy -pix_fmt yuv420p -map 0:0 -map 0:1 -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0 -crf 23 -preset medium "/mnt/nas/purchased/movies/The Big Lebowski (1998)/h265/The Big Lebowski.mkv"

to see exactly what went wrong.

skarekrow commented 7 years ago

Yeah it appeared after flushing the log to the disk, but this movie doesn't have a TrueHD track, but a DTS-HD one like most of the other ones that have successfully run. Will run your command and reply back.

skarekrow commented 7 years ago

Interesting:

[NULL @ 0x2c0e6c0] Unable to find a suitable output format for '10'
10: Invalid argument

Log

FallingSnow commented 7 years ago

That might be my fault... try

ffmpeg -i "The Big Lebowski.mkv" -y -acodec copy -vcodec libx265 -filter:v crop=1920:1040:0:20 -c:s copy -c:d copy -pix_fmt yuv420p -map 0:0 -map 0:1 -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0 -crf 23 -preset medium "/mnt/nas/purchased/movies/The Big Lebowski (1998)/h265/The Big Lebowski.mkv"
skarekrow commented 7 years ago

No, your new command has the path to the non-existant file :)

"/mnt/nas/purchased/movies/The Big Lebowski (1998)/h265/The Big Lebowski.mkv" should be "/mnt/nas/purchased/movies/The Big Lebowski (1998)/The Big Lebowski.mkv"

Using h265ize 0.4.3-r2 the movie starts encoding with the same command given.

FallingSnow commented 7 years ago

So... All's well that ends well? :P

skarekrow commented 7 years ago

An image showing that

Hahah if only! Some regression happened, if I knew node, I'd send you a PR :P

skarekrow commented 7 years ago

Perhaps: https://github.com/FallingSnow/h265ize/commit/20e19f0f170d64d9e08ce1f9a223488583a90189#diff-b5aeacf0b0e89c4ad9316070981779a4L58?

EDIT: Hmm perhaps not as you then use that to move. I'm not sure, sorry! I hope you have an idea :D

skarekrow commented 7 years ago

This is very easy to reproduce:

Just make sure no h265 directory exists in that location and it will not continue encoding.