batch-transcode-video
batch-transcode-video copied to clipboard
How to run on specified range of inputs?
I apologize if this is a dumb question, but I'm an old dog trying to learn some new tricks. If I have a directory of video files that I need to transcode, but only want to use batch-transcode-video on a specified range of files, how would instruct the utility to do that? In other words, if I have files Movie1.mkv through Movie100.mkv in the directory, how could I batch process only Movie11.mkv through Movie20.mkv, then have the utility stop? I'd like to batch process just a few files at night so I'm not tying up our family computer during the day.
I've been trying to research this issue on my own, but haven't found an answer. Thanks for any help that can be provided.
Try adding a custom mask
. Here is one that would only match Movie11.mkv
through Movie20.mkv
:
--mask 'Movie(1[1-9]|20).mkv'
If the files are in subfolders of your input
directory, change it to this:
--mask '**/Movie(1[1-9]|20).mkv'
Here are the rules for specifying a mask
pattern and here is how I made sure this pattern was correct.
Thanks, @nwronski. I think I was too generic in my question and should have given more specifics on my specific input directory.
I used MakeMKV to rip video files from my dvds and it put each .mkv file into a separate folder. I then renamed each .mkv file to meet the file-naming requirements for the Plex Media Server. I want to transcode the files so they are in mp4 format and a smaller file size. A screenshot of how the input directory is organized is attached as a .png file.
I read the mask pattern rules and also did some testing using regex101.com, but couldn't find a way to run a batch transcode on a specified series or range of my files. I'd think you could just indicate the beginning and end of a consecutive range. Of course, I'm new to this stuff and it's like learning a new language.
Thanks again for all of your help and patience with my questions.
Still haven't been able to figure out how to transcode a specified range of files from an input directory. My workaround has been to create a separate directory, drop the folders/files I want to transcode into it, then run the batch file on that directory.
approaching your question from another angle, if you want to run the program overnight and only have it process files that have not been transcoded yet, you can use the --diff
option to skip over files that have already been processed. in the morning, you can terminate the program immediately (CTRL
+ C
) and the video that was being transcoded at the time will be deleted. any videos that were successfully transcoded prior to you terminating the program will not be deleted. you can also use the --keep
option to prevent the program from deleting any partially-processed files.
I would highly recommend upgrading to the latest version before running either of the commands below:
npm i -g batch-transcode-video@2
based on the screenshot you posted, and the information from previous comments, here are some example commands you could use:
-
Run overnight and cancel (
CTRL
+C
) in the morning, automatically removing the partially-encoded file that was being processed at the time you cancelled:batch-transcode-video --input "Video" --output "Transcoded" --mask "**/*.mkv" --diff -- --mp4
-
Run overnight and cancel (
CTRL
+C
) in the morning, leaving the partially-encoded file that was being processed at the time you cancelled (you would need to manually delete that file from theTranscoded
folder before running the command again):batch-transcode-video --input "Video" --output "Transcoded" --mask "**/*.mkv" --diff --keep -- --mp4
Eventually, after running one of the commands above every night, you'd reach a point where there were no new files to process, and the command would exit (shortly after you started it) with a summary indicating that all of the input files were skipped.
Thanks, Nick. I appreciate the suggestions and the work you've put into the program. Those are great ideas and I'll give them a try! Jeff On Sunday, October 27, 2019, 03:49:56 PM PDT, Nick Wronski [email protected] wrote:
approaching your question from another angle, if you want to run the program overnight and only have it process files that have not been transcoded yet, you can use the --diff option to skip over files that have already been processed. in the morning, you can terminate the program immediately (CTRL + C) and the video that was being transcoded at the time will be deleted. any videos that were successfully transcoded prior to you terminating the program will not be deleted. you can also use the --keep option to prevent the program from deleting any partially-processed files.
I would highly recommend upgrading to the latest version before running either of the commands below: npm i -g batch-transcode-video@2
based on the screenshot you posted, and the information from previous comments, here are some example commands you could use:
Run overnight and cancel (CTRL + C) in the morning, automatically removing the partially-encoded file that was being processed at the time you cancelled: batch-transcode-video --input "Video" --output "Transcoded" --mask "**/*.mkv" --diff -- --mp4
Run overnight and cancel (CTRL + C) in the morning, leaving the partially-encoded file that was being processed at the time you cancelled (you would need to manually delete that file from the Transcoded folder before running the command again): batch-transcode-video --input "Video" --output "Transcoded" --mask "**/*.mkv" --diff --keep -- --mp4
Eventually, after running one of the commands above every night, you'd reach a point where there were no new files to process, and the command would exit (shortly after you started it) with a summary indicating that all of the input files were skipped.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Nick, Thanks again for the tips and the upgraded version. Everything is working great and there are no more error messages with completed files. Jeff On Sunday, October 27, 2019, 03:49:56 PM PDT, Nick Wronski [email protected] wrote:
approaching your question from another angle, if you want to run the program overnight and only have it process files that have not been transcoded yet, you can use the --diff option to skip over files that have already been processed. in the morning, you can terminate the program immediately (CTRL + C) and the video that was being transcoded at the time will be deleted. any videos that were successfully transcoded prior to you terminating the program will not be deleted. you can also use the --keep option to prevent the program from deleting any partially-processed files.
I would highly recommend upgrading to the latest version before running either of the commands below: npm i -g batch-transcode-video@2
based on the screenshot you posted, and the information from previous comments, here are some example commands you could use:
Run overnight and cancel (CTRL + C) in the morning, automatically removing the partially-encoded file that was being processed at the time you cancelled: batch-transcode-video --input "Video" --output "Transcoded" --mask "**/*.mkv" --diff -- --mp4
Run overnight and cancel (CTRL + C) in the morning, leaving the partially-encoded file that was being processed at the time you cancelled (you would need to manually delete that file from the Transcoded folder before running the command again): batch-transcode-video --input "Video" --output "Transcoded" --mask "**/*.mkv" --diff --keep -- --mp4
Eventually, after running one of the commands above every night, you'd reach a point where there were no new files to process, and the command would exit (shortly after you started it) with a summary indicating that all of the input files were skipped.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.