mkvextract and batch extraction

Is there a way to extract all attachments in a mkv file via mkvextract with batch?

Otherwise I need to give the name of all attachments one by one.

2 Answers

If you run the following:mkvextract attachments file.mkv 1:1.ttf 2:2.ttf 3:3.ttf 4:4.ttf 5:5.ttf 6:6.ttf ... etcThen mkvextract will extract attachments by id until it can't find an attachment. It will exit when it fails to find an attachment, so the batch will progress. Disadvantage here is that you lost the attachment filenames, but without grepping around some mkvinfo output, this is the only way I know of to extract all the attachments.

3

For Bash you could use mkvextract attachments "$file" $(seq 1 100) to extract attachments 1 to 100, assuming that there are no more than 100 attachments. If you use another shell you'll have to find the equivalent of seq to generate a sequence of numbers, here's one for Powershell.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like