I'm a Mac user. I have VLC, QuickTime 7 Pro, Video Monkey and MPEG Streamclip.
I have a file xxxx.mkv which I can open in VLC, which gives me a choice of two [English] audio tracks. The second track is a review of the video.
I have tried various ways to resave the video but there is no option to save it with audio track 2. It always saves with track 1 only. I would like it in MP4 format.
Is there a way to achieve this on a Mac?
Many thanks.
+ Reply to Thread
Results 1 to 7 of 7
-
-
Code:
FFmpeg -i xxxx.mkv -map 0 -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a aac -b:a 160k xxxx.mp4
-
You can use ffmpeg and copy all video and audio tracks (i assume it is h.264 so no need to recode video) and change container from mkv to mp4.
Code:ffmpeg -y -i %1 -map 0 -c copy -movflags faststart -f mp4 %~n1.mp4
Alternatively you can map selected video and audio tracks explicitly.
Code:ffmpeg -y -i %1 -map 0:0 -map 0:1 -map 0:2 -c copy -movflags faststart -f mp4 %~n1.mp4
Last edited by pandy; 24th Nov 2016 at 13:29.
-
Hi, and thanks for your replies which, unfortunately, I don't understand.
To be honest, I was hoping for "launch such & such App then select x parameter and click Export" type of instruction.
I have downloaded FFmpeg for Mac. I've unzipped the folder and dragged it to my Applications folder.
When I double-click the file labelled "ffmpeg" it launches "Terminal" and opens a window with code and a highlighted instruction to get the manual but it doesn't do anything and nor can I type anything into the window. Key presses are ignored.
Later:
I've opened a new terminal window and typed 'man ffmpeg' but it states No manual entry for ffmpeg.
-
FFmpeg has no graphical user interface; it is meant to be run only on the command line with all options and parameters supplied. Documentation is here. You can just copy-paste the code I posted above into Terminal, overwrite with the actual filenames you want, and hit ENTER. Or if your MKV already contains h.264/AVC video and AAC audio, then copy-paste
Code:FFmpeg -i xxxx.mkv -map 0 -c copy xxxx.mp4
-
You could use a two step process:
1) Use MKVToolnix (there's a GUI version for the Mac) to remux the video and only the audio track you want into a new MKV file (it lets you pick which tracks you want to keep).
2) Use VLC to remux the tracks from the new MKV to MP4. -
ffmpeg is quite powerful tool, but it does require some basic knowledge of using command line tools. And on Mac OS that means using Terminal.app.
1/ Binaries (the compiled command line tools) on Mac OS can reside anywhere, but if you put it them where Terminal will look for them, then you'll never have to specify the path to the app anymore, which is easier and saves time. A good place is /usr/local/bin/ as the designated repository for 3rd party binaries. ‘usr’ in not visible in the Finder to avoid accidental changes, so open it by using the Go menu in the Finder, then Go to folder, then paste /usr/local/bin/ . Now you can copy the ffmpeg binary there.
2/ You may specify a working directory in Terminal, like a default folder. Meaning: whenever you specify just a filename (without a path), it will look for it in this working directory. This makes life much easier, as you may be tinkering with one file for multiple operations, or multiple files in the same folder. The command is: cd (for change directory). (Example in combination with #3.)
3/ Terminal supports drag-and-drop. If you do need to specify a file (or folder) with complete path, then you can drag-and-drop the file (or folder) onto the Terminal window, and Terminal with translate that into the path to that file (or folder). E.g. Type “cd ” (without the quotes, include the trailing space), then drag-and-drop the parent folder for a video file onto the Terminal window. Enter. (Type “ls”. Enter. You should get a listing of the directory contents.)
4/ Command parameters need to be separated with spaces. Options often are preceded by a dash. If you forget the space separator, then usually it will fail because it became nonsensical. Be sure to be aware of the need for a leading space when you combine drag-and-drop in the commands. As the space is used as a separator, it also means filenames with spaces have to be escaped (e.g. sintel\ 1280\ surround.mp4).
5/ Mac OS comes a with a set of basic commands. Specialty tools, like video converters, have to be installed separately. Each has their own set of commands, sometimes similar, sometimes not.
Code:ffmpeg -i xxxx.mkv
Code:ffmpeg -y -i xxxx.mkv -map 0:0 -map 0:2 -map 0:1 -c copy -movflags faststart xxxx.mp4
-i xxxx.mkv specifies the input file
-map 0:0 -map 0:2 -map 0:1 specifies the mapping of streams, from input to output. The 0 before the colon (:) points to the first input file. The number after the colon is the stream number. The re-arranged order means the second audio in the source will be the first audio in the output.
-c copy specifies the same codecs (no transcoding) for output as input
-movflags faststart runs a second pass to write the index at the beginning of the file (instead of the end)
-f mp4 specifies the format as MP4. If your output file already has the .mp4 suffix, then this part may be omitted.
xxxx.mp4 specifies the output. Your user home directory is default, unless otherwise specified previously in that session. Output may optionally include a path.
Similar Threads
-
Adding lossless audio to video / replacing audio track
By Jacobson in forum Video ConversionReplies: 72Last Post: 29th Jul 2016, 21:05 -
Set and save multiple selections on an audio track
By glvid in forum AudioReplies: 12Last Post: 16th Apr 2016, 07:15 -
Editing an audio track in an Mp4 video WITHOUT video data loss ?
By PeteV in forum Newbie / General discussionsReplies: 2Last Post: 11th Nov 2014, 13:46 -
MKV video/audio not in sync for added audio track
By paolone67 in forum EditingReplies: 2Last Post: 1st Sep 2014, 11:21 -
Software for syncing and muxing audio track with video track?
By uranometria in forum Video ConversionReplies: 1Last Post: 21st Jul 2014, 01:52