I used to have a batch file that would take an input file, and take all the tracks from it and put it into an mkv container. At some point I lost that batch file but I am looking for something that could be used in it's place with mkvtoolnix on windows.
Trying to move all audio/video/subtitle/chapters etc tracks into mkv container basically
*.avi -> mkv
*.mp4 -> mkv
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 18 of 18
Thread
-
-
Why not re-create that batch? Would it be much more complex than this direct console command?
Code:for %a in (*.avi *.mp4) do mkvmerge -o "%~na.mkv" "%a"
Last edited by LigH.de; 2nd May 2017 at 09:46.
-
the original batch file i had was a lot more complicated, i didnt create it myself though so im a bit unfamiliar with how to recreate it. of memory serves it could check all subdirectories as well. It looks like I can add file types with that command though, ill try it out
-
I forgot: If any of your files contain spaces in their filenames, you will have to wrap them in double quotes... And I am not sure which options are generally useful. It's just a very basic template.
-
good to know thanks, ill replace all spaces with underscores or something
-
The above edit should be fine. Also I forgot that the output should be one of the first parameters, starting with -o.
-
Fair enough. Quick question about box4, my end goal aside from getting all my files to one standard format is to reencode all audio tracks from dts/ac3 into as lossless aac as possible, but box4 gives a maximum of 224 kbps. Do you know of anything I can use to batch reencode only the audio track of each file in as high quality as possible?
Currently what I am doing is extracting the audio using mkvextract, converting it manually to aac using panzera getting the bitrate and channels as close as i can to the original, and then remuxing it all together again with mkvtoolnix -
Converting to a lossless audio format or to a lossy format with excess bitrate will not give you better audio quality than the original. You would probably be able to preserve the input quality without noticable loss already with a lower bitrate than expected... Furthermore, a bitrate which is "tight" for discrete multichannel audio would be a waste if you have only stereo or even mono.
Just in case you still insist in "lossless AAC" (or ALAC), which is similar to FLAC: I don't know any batch converters to ALAC which can handle audio streams inside movie containers. You would have to extract the audio stream, possibly decode it, encode it to ALAC (e.g. using the QAAC encoder pack which requires Apple CoreAudio DLLs), and then hope that it is recognized as valid audio by mkvmerge to multiplex it back (I know it can handle LC-AAC, but I don't know of ALAC). I would not recommend that, it will probably fail. And did I mention it being a waste of space, compared to high-quality but lossy LC-AAC? -
what settings would you recommend from a 1400kbps 5.1 channel dts to aac? would prefer to keep all the channels, but if lc-aac doesn't significantly degrade the audio would definitely be open to using that
-
If QAAC is the AAC encoder of your choice, I'd recommend its TVBR mode with a quality level of 82 or even 91; it will use the bitrate it needs to ensure a quality loss below a certain limit. The challenge will be decoding the dts, though; QAAC on its own will not decode dts. But MeGUI may be able to help you.
And eac3to can cooperate with NeroAacEnc, which you could use with a quality parameter of 0.7 for very high quality without insane bitrates.
Unfortunately, all that won't fit easily in a batch processing of many most different source formats... -
I've got another question you might have the answer for.
ive got a UHD 4k h265 file
Is there a tool like eac3to just for video reencodes?
The way I understand eac3to works is that you just specify the input file and it converts it to the destination format with as close stats as possible
idealy would like to go from h265 to h264 with as little data loss as possible. Handbrake seems to have a lossless h264 option, but lots of other things that would also need configuring -
ffmpeg -i "input_h265.mkv" -map 0 -c:v libx264 -preset medium -crf 18 -level 4.0 -maxrate 20M -bufsize 20M -c:a copy -c:s copy "output_h264.mkv"
Preset controls encoding speed, crf controls quality.
https://trac.ffmpeg.org/wiki/Encode/H.264
Or including audio conversion to aac:
ffmpeg -i "input_h265.mkv" -map 0 -c:v libx264 -preset medium -crf 18 -level 4.0 -maxrate 20M -bufsize 20M -c:a aac -c:s copy "output_h264.mkv" -
Thank you
Just so I know what to look for, the file I want to reencode is the video stream in this mkv. I currently have it extracted using mkvextract. Using -crf 18, what kind of data loss would I be looking at when reencoding from the source? Will the bitrate be drastically different or does that matter much when going from h265 to h264 -
Most people consider crf 18 "transparent under normal viewing conditions", i.e. you wouldn't see a difference to the source when viewing the moving picture at normal viewing distance. Note that crf is just an attempt at constant quality but is not 100% absolute and the quality you want/need is subjective. You have to do your own tests. Consider crf 18 a starting point.
-
Just used the command recommended, looks like I get a file half the size of what I had despite going away from h265. I understand that it's probably a placebo, but I am looking to retain all or as much as possible of the quality in the original file. Do you have a command I can run for that instead of just "transparent under normal viewing conditions"
-
-
What "specs of the input file" do you want to preserve? "Same bitrate" doesn't make sense in case of "different codecs". "Same quality" doesn't make sense as quality is no objective value anyone could measure; you can only measure a "loss of quality" as any kind of difference to the original video. The best way to preserve the quality is not to convert the video again; and if you have to convert it, you will have to find your own threshold of loss which is just not noticable, or at least not too annoying to you, personally.
Similar Threads
-
Remux .mov into .mkv (with ffmpeg - or something else)
By HoraceMcMahon in forum Video ConversionReplies: 5Last Post: 29th Feb 2016, 07:19 -
How to remux both video and audio from another source into MKV?
By Gerff in forum Newbie / General discussionsReplies: 4Last Post: 27th Sep 2014, 12:47 -
Remux dvr-ms (or WTV) to MKV
By Ramias in forum Video ConversionReplies: 9Last Post: 6th Oct 2013, 15:48 -
[Help] Remux multiple mkv with ssa
By remuxler in forum EditingReplies: 3Last Post: 10th Jun 2013, 17:51 -
Bluray remux to .ts or .mkv?
By Mr_X2012 in forum Blu-ray RippingReplies: 7Last Post: 4th Jan 2013, 13:46