lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
555 stars 26 forks source link

Crash - undefined method `each' for nil:NilClass #165

Closed hjk321 closed 2 years ago

hjk321 commented 2 years ago

Please note that no mkv.log file was generated as the tool does not seem to have reached that far before crash.

I am running the latest gem on 64-bit Windows and using hardware NVIDIA encode on a 3080 Ti. I have successfully transcoded mkvs with this tool before, but a particular batch from a dvd series box set seems to be unsupported by the transcoder. Due to the large file size and copyrighted nature of the mkvs I have only provided a mediainfo dump for now, but I can privately send a drive link to an actual test file if requested. I'm fairly confident the input mkvs are good dumps because they play fine in VLC and Window's default video player as well.

Command ran: other-transcode {inputpath} --add-subtitle all --nvenc-recommended --nvenc-multipass fullres --copy-track-names (Same error when running command with no options.)

other-transcode output:

Verifying "ffprobe" availability...
Verifying "ffmpeg" availability...
Verifying "mkvpropedit" availability...
Finding encoders...
Scanning media...
C:/Ruby31-x64/bin/other-transcode: undefined method `each' for nil:NilClass

      media_info['streams'].each do |stream|
                           ^^^^^

mkv information: MediaInfo.txt

Thanks.

lisamelton commented 2 years ago

@hjk321 I'm sorry that you had this problem. And thanks for the dump from MediaInfo! The crash occurred before any transcoding took place which is why there's no .log file being generated.

And it appears that crash occurred during the scanning of the input media.

Which versions of ffmpeg and ffprobe do you have installed?

hjk321 commented 2 years ago

ffmpeg version 5.1-essentials_build-www.gyan.dev ffprobe version 5.1-essentials_build-www.gyan.dev

lisamelton commented 2 years ago

@hjk321 Thanks. I'm sure that's where you got it. But can you please execute ffprobe -version within PowerShell to confirm that. Thanks.

hjk321 commented 2 years ago

Yes, that is the version string as displayed in powershell. It has the website appended for whatever reason. To my knowledge, this is an official site for ffmpeg builds.

lisamelton commented 2 years ago

@hjk321 Thanks! Just trying to be methodical. :)

OK, next I need you to execute ffprobe directly on one of your problem input files to simulate what other-transcode is doing internally. Please try this within PowerShell:

ffprobe -loglevel quiet -show_streams -show_format -print_format json input.mkv

...and copy the output of that here. Thanks.

hjk321 commented 2 years ago

Github does not support upload of .json so I'll have to upload it as .txt. Thanks for your help. ffprobe.json.txt

lisamelton commented 2 years ago

@hjk321 Thanks! OK, now it looks unlikely that ffprobe itself failed or provided the incorrect data. Let's confirm that by forcing other-transcode to scan only without transcoding. Please try this with PowerShell:

other-transcode --scan input.mkv

...and, again, copy the output of that here. Thanks.

hjk321 commented 2 years ago

I found out what the issue was - I was running the tool from a script and did not put the input path in quotes. This batch happened to have a space in the folder names. Quoting the path makes everything work fine.

I suppose the only fix here would be a more explicit "file not found" message (as the current message gives the impression of an internal error when it is not). Sorry to waste your time.

lisamelton commented 2 years ago

@hjk321 No problem, I'm glad your problem is solved.

And, unfortunately, I can't fix the problem that way because the failure occurs within the Ruby runtime before I would know the file is not found.