Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how to re-encode a folder of videos and put them in a new folder (CLI) #341

Open
walksanatora opened this issue Nov 30, 2022 · 4 comments
Assignees

Comments

@walksanatora
Copy link

So i have this folder of videos on my headless server
I want to re-encode them en-masse but when i try the naieve approach it ended up erroring with code 3 ([15:07:50] libhb: work result = 3)
so I am asking how to re-encode a entire folder

@lisamelton lisamelton self-assigned this Nov 30, 2022
@lisamelton
Copy link
Owner

@walksanatora The transcode-video tool doesn't accept a directory of multiple videos as an input. You have to pass each video file as a separate argument on the command line after specifying any options. Or you can write a batch processing script that simply calls transcode-video once for each video within the directory.

I hope that helps.

@shuckster
Copy link

shuckster commented Dec 1, 2022

You can use the find command to process multiple files for commands that only accept one file as input:

find . -iname '*.mov' -exec echo {} \;

Explained.

The above example will print all *.mov filenames to the console, ignoring case.

Here's a variant that uses the cp copy command to copy files from one folder to another, keeping the folder-structure:

mkdir destination
find ./source -iname '*.mov' -exec cp --parents {} ./destination \;

Explained.

After copying, you can then run other commands using find to separately convert your movies, then delete the old ones.

@lisamelton
Copy link
Owner

Thanks, @shuckster! 👍

@Gattung
Copy link

Gattung commented Jul 15, 2023

I was able to do this using the 'for' command.

for /R "\PATH\TO\VIDEOS\FOLDER\" %I in (*.mkv) do @transcode-video "%I"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants