VideoHelp Forum
+ Reply to Thread
Results 1 to 18 of 18
Thread
  1. 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
    Quote Quote  
  2. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    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"
    But well, if you prefer to avoid mkvtoolnix (despite being the most recommendable software), there is still a selection of tools (based on e.g. ffmpeg) which can be used for batch remultiplexing, like BOX4 or TEncoder.
    Last edited by LigH.de; 2nd May 2017 at 09:46.
    Quote Quote  
  3. 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
    Quote Quote  
  4. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    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.
    Quote Quote  
  5. good to know thanks, ill replace all spaces with underscores or something
    Quote Quote  
  6. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    The above edit should be fine. Also I forgot that the output should be one of the first parameters, starting with -o.
    Quote Quote  
  7. 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
    Quote Quote  
  8. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    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?
    Quote Quote  
  9. 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
    Quote Quote  
  10. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    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...
    Quote Quote  
  11. 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
    Quote Quote  
  12. 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"
    Quote Quote  
  13. 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
    Image Attached Thumbnails Click image for larger version

Name:	png.PNG
Views:	228
Size:	16.9 KB
ID:	41493  

    Quote Quote  
  14. 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.
    Quote Quote  
  15. 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"
    Quote Quote  
  16. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Originally Posted by sneaker View Post
    You have to do your own tests. Consider crf 18 a starting point.
    Thus: Try smaller values for CRF than 18, e.g. 15 or even 12.
    Quote Quote  
  17. So there just isn't a tool at all that will reencode based solely on the specs of the input file like what I can get with audio in eac3to? Seems a little bit odd, but I'll keep messing with the crf values when I have time I guess.
    Quote Quote  
  18. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!