Hello, I need to remove audio tracks #1 and #2 from ~200 mkv files (which are in the same folder). I guess mkvtoolnix will do the job, but would someone tell me, how to automatize this operation? Thx in advance
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 13 of 13
Thread
-
-
I am not pretty familiar, but mkvextract (if it's a part of mkvtoolnix) will help to extract tracks with track ids.
you have to write your own batch or script. -
If the audio tracks have language tagging you could use Hybrid:
- start Hybrid
- set "Main->Primary Input Selection->Video handling" to "passthrough"
- set "Main->Primary Input Selection->Audio handling" to "passthrough all"
- set "Config->Output->Container Settings->General Settings->Standard output container" to "mkv"
If you require some special mkv compatibility settings to be enabled, check out "Config->Output->Container Settings->Mkv Settings" and dis-/enable what you need. - enable "Config->Automation->Passthrough streams->Subtitle"
- enable "Config->Automation->Passthrough streams->Limit audio passthrough/auto add all" and tick the 'English (eng-en)' box in the selection DropBox (if you want to keep other audio tracks, also tick their languages)
- enable "Config->Automation->On Load->Always extract timecodes from mp4/mkv/flv files"
- enable "Config->Automation->Matroska Settings->Pass-through subtitle default/forced flags" (otherwise the first subtitles will be set as default and the forced subtitle flag will not be used)
- enable "Config->Automation->Matroska Settings->Pass-through audio default/forced flags" (probably not needed, since you removed the other languages)
- set "Config->Path->Default output path" or enable "Config->Path->Adjust->Output path to source path"
- enable "Main->Generate"
- drag&drop all the files you want to process onto the input line (Hybrid will then start to analyze the files)
- press "Main->Add to Queue"; Hybrid will then create all the necessary jobs for your files
- start the processing by pressing "Jobs->Start"
Cu Selur -
Try
if your mkv contains vid.h264 and aud.ac3,
enim$ mkvextract tracks "./path/source.mkv" 0:"./path/source-raw-video.h264" 1:"./path/source-raw-audio.ac3"
you have to specify proper file extensions for extracted raw files. -
@Selur Thanks for reply, but output files was exactly the same like the input ones (Hybrid didn't remove any audio track).
Information about video files:
file:
Format : Matroska
Format version : Version 1
File size : 261 MiB
Duration : 24mn 11s
Overall bit rate mode : Variable
Overall bit rate : 1 508 Kbps
Encoded date : UTC 2007-02-11 17:35:16
Writing application : mkvmerge v1.5.0 ('It's alright, baby') built on Jul 1 2005 10:35:18
Writing library : libebml v0.7.5 + libmatroska v0.7.7
video:
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : V_MS/VFW/FOURCC / H264
Duration : 24mn 11s
Bit rate : 1 142 Kbps
Nominal bit rate : 1 230 Kbps
Width : 704 pixels
Height : 396 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.171
Stream size : 198 MiB (76%)
Writing library : x264 core 54 rev 600
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=5 / brdo=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / slices=1 / nr=0 / decimate=1 / mbaff=0 / bframes=2 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / bime=0 / keyint=250 / keyint_min=25 / scenecut=40 / rc=abr / bitrate=1230 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30
Default : Yes
Forced : No
audio:
ID : 1/2/3
Format : Vorbis
Format settings, Floor : 1
Codec ID : A_VORBIS
Duration : 24mn 11s
Bit rate mode : Variable
Bit rate : 112 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 19.4 MiB (7%)
Writing library : libVorbis 1.0 (UTC 2002-07-17)
Language : English/English/Japanese
Default : No
Forced : No
and i want Japanese lang only -
Strange, should work normally.
-> need a DebugOutput to see where the problem is, see: http://www.selur.de/support -
from the looks of it filtering the language wasn't enabled, will send you a test version which adds some additional debug output
-> argh, think I found the problem. -> will send you a new test version once I fixed itLast edited by Selur; 20th Jan 2014 at 16:14.
-
Another option is ffmpeg
Code:for %a in ("*.mkv") do ffmpeg -i "%a" -map 0:0 -map 0:3 -c:v copy -c:a copy "%~na.new.mkv"
I don't know of any way of "in place" editing (editing the file in place without making a copy) for this type of manipulation. (mkvpropedit can do inplace editing of some parameters, but not discarding streams) -
Ok, Selur fixed smth in his program and everything is fine. Thanks for helping me.Greetings.
-
Selur's jet speed support gets your requirement rolling.
alternatively, following shell scripts also works.
if your mkv contains vid.h264 and audio3.ac3,
enim$ mkvextract tracks "./path/source.mkv" 0:"./path/source.h264" 3:"./path/source-audio3.ac3"
enim$ mkvmerge -o "./path/source-video-with-audio-1-n-2-dropped.mkv" "./path/source.h264" "./path/source-audio3.ac3"
you have to specify proper file extensions for extracted raw files. -
problems of the shell script/calls as it is atm.:
a. fails for vfr mkvs (time codes are not handled)
b. subtitles and attachments get lost (subtitles are not handled)
c. only works if the audio and video stream have the same id in each file
d. get's a lot more complicated if multiple audio streams need to be kept
e. things might get problematic if the paths and thus the command lines get to long, so the call parameters for mkvmerge&mkvextract would require to be exported to xml parameter files
Remuxing using mencoder might be a better than using mkvmerge&mkvextract since iirc. mencoder support selecting audio streams by language. (personally I would prefer ffmpeg, but I'm not sure if it allows selecting the audio by language.)
-> for a batch script to do the whole thing properly it must be a lot more complex
pro of the script/calls:
- low requirements
problem of the solution through Hybrid:
a. requires to have the tagged audio streams (otherwise manual processing is required)
b. requires to have Hybrid -> a lot of requirements
pro of the Hybrid solution:
- easier to handle and adjust than the script (selecting multiple audiostreams and subtitles is easy when they are tagged)
Cu Selur -
now OP has at least four different methods Hybrid, ffmpeg, mencoder or mkvtoolnix to try.
and that's why this forum rocks!
Similar Threads
-
How to remove one of two audio tracks in a mkv file?
By BooSnow in forum AudioReplies: 4Last Post: 18th Oct 2020, 10:00 -
Remove Tracks from MKV?
By therock003 in forum Video ConversionReplies: 11Last Post: 16th Nov 2011, 03:13 -
Remove multiple tracks from multiple MKV files
By accoutabc in forum Video ConversionReplies: 3Last Post: 7th Aug 2011, 11:50 -
Help with MKV files with multiple audio and subtitle tracks.
By razzn in forum Newbie / General discussionsReplies: 1Last Post: 13th Jul 2011, 16:59 -
No Audio On AVCHD-DVD, How To Remove Other Audio Tracks From MKV File First
By elistian in forum Video ConversionReplies: 1Last Post: 14th Dec 2009, 06:03