Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I open Handbrake, it's usually because I have a video that won't play in some device/program. For example, I have an mkv but my Chromecast only supports MP4. I found out recently that Handbrake isn't always the best option.

Oftentimes you want to remux the video, which means copying it to a new container format without touching the underlying stream. Handbrake doesn't support remuxing (no idea why); you have to turn to ffmpeg on the commandline [1]. Remuxing works if the video and audio codecs are supported by your target but the container isn't, and is very fast—about as fast as copying the file.

With remuxing you still have the option of changing the order of the audio tracks. For example, you can take a Cantonese film with a Mandarin dub and make the Mandarin dub primary so you don't have to fiddle with it (protip if you're learning Mandarin: all the good movies are in Cantonese but they all have Mandarin dubs).

[1] There are GUI options that I haven't explored, see below.



Explore MKVMerge in the MKVtoolnix set. It can de-mux and re-mux really well, and has a good GUI.


Thanks for the tip!

I keep a random google doc of some of my magical ffmpeg incantations that have worked in the past. I usually use it for cutting video segments out of longer vids. Seems like different versions have had different ways of handling things, and/or I really don't know what I'm doing!


I would vehemently disagree with "good GUI", although I'm not entirely sure we're talking about the same tool -- mine is called 'MKVToolnix GUI', but I can't find any GUI utility going by the name 'MKVMerge'. Anyway, it is a very useful tool for this, though Avidemux has a similar feature set and in my opinion is easier to use.


I realise you didn't ask, but having tried a bunch of macOS demuxers, I've found MP4tools to be the best fit for me:

http://www.emmgunn.com/mp4tools-home/


Adding to the list: I've been using Subler for many years to mux to MP4 (and to transcode AC3 to AAC if needed), and it hasn't let me down:

https://subler.org/


I have a command line script for doing this exact thing in ffmpeg

for i in *mkv; do ffmpeg -i "$i" -vcodec copy -acodec copy "${i%.mkv}.mp4"; done;


Yup this is my favourite way too. The annoying thing is that the audio and video codecs are supported most likely by the problem device just the container that is not. My Samsung TV (KS8000) supports MKV though which is superb for me.


Avidemux is probably the best tool around for remuxing (between any containers). It can do encodes too, but I've never really played with it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: