Skip to content

Batch script #368

@briangoodman

Description

@briangoodman

I believe it was you who posted a batch script many years ago to enable the processing of multiple files based on a list of mkv files contained in a separate text file. That script made video_transcoding much easier to use, especially for newcomers to your scripts (as I was almost a decade ago). I'm hoping you can post it with instructions and pin it so it could be useful to others.

THE BATCH.RB SCRIPT:
#!/usr/bin/env ruby

batch.rb

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

break unless system('transcode-video.rb', *ARGV, input)
end

THE QUEUE.TXT FILE:
The file is empty until a user drags and drops a list of files into the opened queue.txt file, which inserts the file names including their paths (especially useful!).

Regards,

Brian

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions