lisamelton / other_video_transcoding

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

Batch failing #98

Closed platonium closed 3 years ago

platonium commented 3 years ago

Hi, at some point in the last month or so, my batch file no longer works. Just get a blank line back or occasionally a media scan failed message. Using a command with all the options manually seems to work fine. Thank you for your help in advance.

other-transcode --nvenc-spatial-aq --nvenc-lookahead 32 --hevc --add-audio eng --add-audio zho --add-audio kor --add-audio jpn --add-subtitle eng --add-subtitle zho

The batch file just seems to halt. Not sure if this matters, but substituting *ARGV for *options in the second-to-last line, as in the Wiki, allows other-transcode to proceed, but there are no options included for the transcode when I do that.

#!/usr/bin/env ruby
#
# batch.rb
# base NV HEVC temporal AQ
#

QUEUE_PATH = 'queue.txt'

while true
  content = File.read(QUEUE_PATH)
  input = content.match(/^.*\R/).to_s.chomp

  break if input.empty?

  queue = File.new(QUEUE_PATH, 'wb')
  queue.print content.sub(/^.*\R/, '')
  queue.close

  options = [
    '--nvenc-spatial-aq',
    '--nvenc-lookahead', '32',
    '--hevc',
    '--add-audio', 'eng',
    '--add-audio', 'zho',
    '--add-audio', 'kor',
    '--add-audio', 'jpn',
    '--add-subtitle', 'eng',
    '--add-subtitle', 'zho',
  ] + ARGV

  break unless system('other-transcode', *options, input)
end
lisamelton commented 3 years ago

@platonium I'm sorry you're having this problem. The only thing that I can see that might be wrong in your batch.rb file is this line:

    '--add-subtitle', 'zho',

You should remove the comma at the end since that's the last item in the array that you're defining. So it should look like this:

    '--add-subtitle', 'zho'

Does that fix it?

platonium commented 3 years ago

Hi, Don, am not sure because I just updated to your most recent version, and it's working fine again without any changes although I have removed the last . for future. Thank you, and Happy Lunar New Year to you and the Hive Mind!