Change video container without re-encoding

Discussion in 'Digital Video' started by floh, Apr 13, 2012.

  1. floh macrumors 6502

    Joined:
    Nov 28, 2011
    Location:
    Stuttgart, Germany
    #1
    Hi!

    This does come up very often in this forum, but I have never read a satisfying answer, although I searched through old threads.

    The question I want to dedicate a whole thread to would be: It happens to me (and obviously others) a lot that I have video and audio stream data inside one container (.avi, .mov, .mp4, .mkv, ... or even .mts, .dv, ...) but my editing software or playback device (or myself) requires another container but would be okay with the codec inside.

    Is there a software, preferably with a GUI, commercial or non-commercial that can do just this? Extracting the stream content from one container and muxing and packing it into another without re-encoding everything?

    I honestly don't know of one. I always recommend the command-line-tool ffmpeg, because I come from Linux and know it pretty well, but it is not very comfortable and has its problems with HD movies.

    Any ideas?
     
  2. JasonA macrumors member

    Joined:
    Feb 18, 2009
    #2
    MPEG Streamclip and tsMuxerGUI both work great for this purpose. As far as I know, though, tsMuxerGUI won't work in Lion but does work in Snow Leopard with a hack.
     
  3. floh thread starter macrumors 6502

    Joined:
    Nov 28, 2011
    Location:
    Stuttgart, Germany
    #3
    I haven't used MPEG Streamclip in a long time, but I just installed it again. I am impressed by what it can do now. You can actually theoretically change containers by opening a file and choosing "Save as...", then picking a container.

    However: It did not work (Error message) for many codecs, for others I did not have the option to pick a different container than "mpeg" and it would not even display many of my older movies. For the ones I tried, it failed on 8 out of 10... and there was no complicated codec, strange resolution or uncommon container format in there...

    So while this is actually really good to know, I am still looking for the ultimate tool. Something like a reliable "iContainerConvert"! ;)

    I can't try that one in Lion, but if you already need a hack to run it in Snow Leopard, it seems pretty outdated...
     
  4. JasonA macrumors member

    Joined:
    Feb 18, 2009
    #4
    It depends on what flavor/codecs you're working with. MPEG Streamclip can't work with H.264 unless it's in MP4 or MOV already, but is great for transport streams and anything else containing MPEG2 video. If you need to convert MKVs that contain H.264, Quicktime 7 Pro with Perian installed usually works. MKVtools is also something good to have in the toolbox.
     
  5. floh thread starter macrumors 6502

    Joined:
    Nov 28, 2011
    Location:
    Stuttgart, Germany
    #5
    I seriously don't understand why there is no swiss army knife tool for this. It doesn't seem too hard to me... The program wouldn't even have to be able to encode any codec, but just put the stream information in another container... Or am I mistaken and there is a lot more to it?

    But I guess there is a reason why most of these previous threads seem to get nowhere...

    Thanks, AJason, for reminding me of Handbrake and to check out the "Save As..." function. It seems like it can do a lot, even though sadly not for H.264 which is becoming more and more common.
     
  6. MisterMe macrumors G4

    MisterMe

    Joined:
    Jul 17, 2002
    Location:
    USA
    #6
    QuickTime Pro?
     
  7. emmgunn macrumors member

    Joined:
    Jul 7, 2008
    #7
    One of the difficulties lies in how "picky" the containers are about the codec settings of the tracks they contain, combined with variance in what the players (hardware and software) will actually allow in the various codecs it supports. Some examples: you'll find sometimes you'll have an MP4 that Quicktime won't play, but VLC has no problems with it, or perhaps only Mplayer can play it in sync. AVI supports H264, but only if it's encoded with the proper settings. MP4 apparently supports DTS, but I don't know of too many players that would play it. The iDevices are picky about the avc profile level of h264 videos you want to play with them.

    So passing thru tracks from one container to another can be tricky. Most of the above software will do it. You can can add subler, iflicks to the list, though I'm partial to MKVtools and the other apps in that suite (AVItools, MP4tools and SUBtools) which focuses on minimizing the re-encoding needed, but then I'm probably biased :).
     
  8. ppc_michael, Apr 15, 2012
    Last edited: Apr 15, 2012

    ppc_michael Guest

    ppc_michael

    Joined:
    Apr 26, 2005
    Location:
    Los Angeles, CA
    #8
    ffmpeg does this easily:

    Code:
    ffmpeg -i inputfile.mkv -vcodec copy -acodec copy outputfile.mp4
    -vcodec copy and -acodec copy ensure the video and audio streams are simply copied over, not recompressed. I think ffmpeg gives a warning if the container doesn't support the codecs. I use this for all kinds of stuff. You can also mux multiple sources this way, and select specific streams with the -map option.
     
  9. floh thread starter macrumors 6502

    Joined:
    Nov 28, 2011
    Location:
    Stuttgart, Germany
    #9
    I know! :) If you read my OP, you can see that I personally use ffmpeg a lot (by now mainly for exactly such things, for reencoding there are faster and better tools)!

    I was just looking for the ultimative GUI that does the container exchange, because so many people are asking in the forum and I never saw a satisfying answer...

    By the way: While ffmpeg is still the most compatible application in this thread when it comes to codecs and containers (I tried the others), it does sometimes crash on me with HD material. I think mostly when I try footage that has been exported from Final Cut in Apple's Intermediate Codec or ProRes.

    I had a look at ffmpegX, but it is way worse than the command line tool. I think by now it actually uses mencoder in the background, not even the tool it got its name from...

    Have you found any installer that contains ffmpeg for MacOS? The only way I could see was MacPorts or compiling it myself, which is also not that easy an option for many users...

    Thanks anyways, I agree with you that this is the best tool for the job, just not the shiniest one... :)
     
  10. ppc_michael Guest

    ppc_michael

    Joined:
    Apr 26, 2005
    Location:
    Los Angeles, CA
    #10
    Well, I'm mostly on Linux now, so I just get it through the package manager. On my Mac, I think I compiled it myself. I do not know of an installer. :/

    VLC can do it too either through the command line or through the GUI via File > Convert/Save. You just check "Keep Original Video Track" and "Keep Original Audio Track" in the profile settings, then choose your encapsulation. I have found it to be much less reliable than ffmpeg, though, both in terms of supported formats, as well as compatibly of the output file with other media players/editors.
     
  11. emmgunn macrumors member

    Joined:
    Jul 7, 2008
    #11
    If you take a look inside the "packages" of any of the mac video applications, there is a good chance that you'll find static binaries for ffmpeg.

    Cheers.
     

Share This Page