Showing posts with label audio. Show all posts
Showing posts with label audio. Show all posts

Tuesday, December 13, 2011

MKVmerge Batch Commands, Remove Tracks

To remove a particular track from an MKV file, the following notation should work:

mkvmerge -o output.mkv -atrack !2 input.mkv 

But I wasn't able to get the exclamation mart (meaning DON'T copy this track) to work. For some reason I kept getting "track not found" message. This should work with --vtrack or --strack (subtitle) or whatever.

Fortunately, I wanted to remove all the subtitles from my files, so I used the following instead:

mkvmerge -o output.mkv --no-subtitles input.mkv

If you only want to do this on one file, the mkvmergeGUI is fast and easy, but if you want to do it on a whole directory of files, you want to use this at the command line in a "For Loop," like so:

for i in *mkv; do mkvmerge -o ./newfiles/`basename "$i" mkv`.mkv --no-subtitles "$i" ; done

This will remove all subtitle tracks from all MKV files in the current folder, then put the new files in a previously-created sub-folder named "newfiles".

Friday, November 18, 2011

Convert MKV (h264, AC3) to MP4 (h264, AAC)

From juliensimon.blogspot.com:

We have already inspected the file, so let's extract the streams:

mkvextract tracks video.mkv 1:video.h264 2:audio.ac3

Then, we need to transcode the audio stream to AAC (let's use high-quality VBR):

ffmpeg -i audio.ac3 -acodec libfaac -aq 255 -ar 44100 -ac 2 -async 1 -vsync 1 audio.aac

Now, we'll use MP4Box to remux the initial video stream and the new audio stream into an MP4 container:

MP4Box -new -add audio.aac -add video.h264 -fps 23.976 video.mp4
AAC import - sample rate 44100 - MPEG-4 audio - 2 channels
AVC-H264 import - frame size 1280 x 720 at 23.976 FPS
Import results: 60146 samples - Slices: 1027 I 36894 P 22225 B - 1 SEI - 968 IDR
Stream uses B-slice references - max frame delay 2
Saving video-ps3.mp4: 0.500 secs Interleaving

That's it :)

Monday, August 9, 2010

K3B To The Rescue

It turns out K3B is a great piece of software for writing optical discs. Brasero and others work for basic stuff, but K3B has saved the day when I could find no other native Linux software to do what needed to be done... namely write a traditional audio CD from a CUE sheet file and one large MP3. This requires the MP3 to be decoded and converted back into WAV format, then the CUE sheet must be used to parse the audio into various tracks of certain length for the audio CD. All other software I tried choked, even command line stuff. K3B JUST WORKED! I didn't want to have to run KDE / QT -based software on my Gnome / GTK -based Ubuntu system because of the extra libraries and resource cost, but considering the time and trouble involved in trying to accomplish something that just won't happen, it's worth it... at least for now. I'll still keep my eyes out for a Gnome / GTK -based application that can use CUE sheets and MP3 files, even though I rarely need to do that.