HydrogenAudio

Digital Audio/Video => General A/V => Topic started by: sanskrit44 on 2018-05-01 20:16:07

Title: Batchconvert to .mkv
Post by: sanskrit44 on 2018-05-01 20:16:07
can you recommend me a linux tool similar to mkvtoolnix-gui (script is also welcome), which allows lossless batchconversions to *.mkv while keeping the folderstructure intact?

unfortunately, with mkvtoolnix-gui, this does not seem to be possible.
Title: Re: Batchconvert to .mkv
Post by: magicgoose on 2018-05-01 21:32:46
mkvtoolnix (without GUI) or ffmpeg (use `-c copy`).
You'll need to write a simple script to batch it, but it's easy. Maybe it's possible to take a shortcut by using it together with the find utility: https://en.wikipedia.org/wiki/Find_(Unix)
Title: Re: Batchconvert to .mkv
Post by: sanskrit44 on 2018-05-02 06:32:21
You'll need to write a simple script to batch it, but it's easy.
hello magicgoose,

thank you for your input. i am quite certain this is peanuts for skilled people (like you?) ;)

on the other hand, i would not have asked for a software recommendation, if i could write a script like this on my own, don't you think so?

i guess this script turns out to be a bit more complex than a short one-liner...

-search for video formats in one specific folder
-check for mkv support
-batchconvert all possible matches (mkvmerge) while retaining the folderstructure of the source path
-list all non processed files

would be interresting to know, if anyone has done something similar already?
Title: Re: Batchconvert to .mkv
Post by: sanskrit44 on 2018-05-04 11:46:44
meanwhile, i got this (very) basic command that batchconverts to *.mkv: for file in *.mp4; do mkvmerge $file -o $file.mkv; done

actually, it does not work for filenames containing 'white spaces' though. i tried to modify but it fails.

can you help me improving it, so it will accept unix nonconform filename conventions, as well?

thank you!
Title: Re: Batchconvert to .mkv
Post by: probedb on 2018-05-04 15:37:13
for file in *.mp4; do mkvmerge "$file" -o "$file.mkv"; done

Maybe? Sorry realised it's not Windows but pretty sure you need to do it in bash as well.
Title: Re: Batchconvert to .mkv
Post by: sanskrit44 on 2018-05-04 18:06:22
works like charm, thank you so much.

in fact, i already tried this exact command, but used ' instead of ". not sure why it worked before?