Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
Hi everyone!

This problem comes up a lot in the forums here: Somebody wants to change a video container (.avi, .MTS, .mpg, ...) to another (.mov) without reencoding the movie and therefore losing quality and time.

This is a very simple task for the command line tool "ffmpeg", but people are often afraid to use the Terminal.

So, today I wanted to procrastinate and wrote a small application to do exactly this: Provide a simple enough interface and convert video containers without reencoding using "ffmpeg" in the background.

So, I have two questions for the forum:

1. Would you be interested in such a tool? It would probably take me another day to make it run smoothly (accepting multiple files, ask for overwrite permission, ...), and I don't want to invest it if noone would ever use the thing.

2. Do you want to maybe have a look at it and tell me what you would improve, add or change. It's a very simple first version (took me about 2 hours, and I never wrote a Mac App), but it kind of works.

Here is a link to the very first beta-version of the App:
(EDIT: The programmer of the Windows version is hosting it on his sourceforge site now. This is the updated link to version 1.0)
Video Container Switcher (on sourceforge)

If it's not wanted by anyone, at least I learned the basics of programming Mac Applications. :)
 
Last edited:
  • Like
Reactions: LiterallySimon

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
My question is why would someone need to just change the container?

That actually happens a lot. Not as often as needing to reencode, but for this there are plenty of options...

The most common cases for a container switch are probably:

1. From an AVCHD recording, you threw away everything but the .MTS files. There is no (free) program yet to convert those into something you can import into any editing software.

2. You have some old .avi files that won't import into your NLE, but you know that the codec should work fine, it's just the (outdated) .avi container that's the problem.

3. You get sent .flv (youtube) or .wmv (Windows) files to work with but can't use them in your editing application.

It's just that from the past, I remember this problem showing up very regularly on the forum. Especially the conversion of .MTS files, but not exclusively.

But: I'll wait another day or two to see if anyone here actually thinks this is a good idea and only then will I polish the application to be presentable.
 

KeithPratt

macrumors 6502a
Mar 6, 2007
804
3
This would find use. But to use it I'd have to feel confident that everything (video, audio and metadata) would safely make it across from one container to another, and I'd get a preemptive warning message when any part of the swap would be unsuccessful. I think people would pay $5 for that.
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
This would find use. But to use it I'd have to feel confident that everything (video, audio and metadata) would safely make it across from one container to another, and I'd get a preemptive warning message when any part of the swap would be unsuccessful. I think people would pay $5 for that.

That sounds nice. I certainly won't be charging anything for it though, the main work is done by the guys at ffmpeg. :)

Currently, I made a checkbox "Keep original file", and even if that is unchecked, the file will only be deleted if there were no errors whatsoever in the conversion. I think the video and audio should be safe there. :)

The metadata is another issue. Most of it will be recognized and transferred, but I can not guarantee that some won't be missing if ffmpeg can't handle it. But that's a good thing to look into, thanks!
 

nateo200

macrumors 68030
Feb 4, 2009
2,906
42
Upstate NY
Yes yes yes!!! I love Subler which only does .mp4 containers though...I wish I could have a .MOV muxer so I could add multichannel PCM in with ProRes, H.264, etc. Sometimes I edit the audio separately and want to re-add it to the container for archiving in .MOV format instead of having to use MKV containers which I love but doesn't go into FCP well and doesn't support ProRes footage for some reason. Also converting .MTS/.M2TS to a .MOV format like a Canon DSLR would allow better importing and easier transcoding...MPEG stream clip can't transcode AVCHD containers but it can transcode H.264....luckily I work more with DSLR video than AVCHD cameras BUT my new job I will be using both so this would be nice as I have developed a way of importing footage and It works for me :p
 

JasonA

macrumors member
Feb 18, 2009
97
1
Yes, I would definitely use something like this. One of my favorite programs is tsMuxerGUI, but it seems it's no longer being supported for Lion/Mountain Lion. It's one of the things holding me back from updating my OS.
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
Yes yes yes!!!

Yes, I would definitely use something like this.

Well, the two of you gave me another reason and I took a look at it this evening... So the tool now does multiple files in batch mode, checks before overwriting anything, and warns after errors.

It is pretty self-explanatory and I'm gonna upload it to sourceforge or some software website in the next days.

There is a guy who did something similar for Windows, and I contacted him to maybe put it on the same page. I also recorded a short "documentational" video for him because he can't test it himself (Windows...). So for a first look, check this out:
http://www.youtube.com/watch?v=O278FHawa9k

If you are really keen on getting it, I uploaded what I called "version 1.0" at the same location I linked to in my first post. I would actually be glad if someone ran it on Mountain Lion, and maybe some other systems. It won't work on 32 Bit or PowerPC.
 
Nov 28, 2010
22,670
30
located
That actually happens a lot. Not as often as needing to reencode, but for this there are plenty of options...

The most common cases for a container switch are probably:

1. From an AVCHD recording, you threw away everything but the .MTS files. There is no (free) program yet to convert those into something you can import into any editing software.

You could try the first four or five steps and see if that gets your footage into an editing application:

Transcoding .MTS files (AVCHD footage) to an editable format (.MOV)

Btw, I am not really fond of editing compressed footage (MPEG-2 or MPEG4) and always like my footage in an editing friendly format, thus I don't mind transcoding the footage, even if the source is terrible to begin with.
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany

Hey, I wasn't aware of this thread, it's certainly very helpful, thanks! But this shows that this question is asked frequently around here. :)

Btw, I am not really fond of editing compressed footage (MPEG-2 or MPEG4)

Preaching to the choir, my friend, I am the same way. I still do it sometimes if e.g. I do a very simple multicam edit without lots of effects. In this case, my hard drive bandwidth is sometimes harder on me than my CPU, so I leave the files H.264 encoded...

But (as you probably know) many people try to edit in H.264, and as you definitely know, many people mess up their AVCHD folder structure and are left with only the .MTS files. I just thought I could program an easy fix for this, and maybe it'll help some people...

By the way, it's great fun programming GUIs with XCode. I spent 5 hours in total on this project, including the learning of Objective-C.
 
Nov 28, 2010
22,670
30
located
Preaching to the choir, my friend

Ich habe das wahrscheinlich schonmal gefragt, aber wie heißt nochmal die berüchtigte Straße im Rotlichtviertel? Auf der anderen Seite der Hauptstätter Straße, aber Google Maps gibt mir keine Antwort. Ist es die Leonhardtstraße?

Ach, ist ficken eigentlich auch zensiert hier? Nöööö.
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
Ich habe das wahrscheinlich schonmal gefragt, aber wie heißt nochmal die berüchtigte Straße im Rotlichtviertel? Auf der anderen Seite der Hauptstätter Straße, aber Google Maps gibt mir keine Antwort. Ist es die Leonhardtstraße?

Meinst Du die Olgastraße?

Ob berüchtigt oder nicht weiß ich nicht, aber jedes Mal wenn ich am späteren Abend mit dem Fahrrad durch ebendiese fahre, stehen auffällig viele zu leicht bekleidete Frauen vor den rot erleuchteten Fenstern rum... :)
 
Nov 28, 2010
22,670
30
located
Meinst Du die Olgastraße?

Ob berüchtigt oder nicht weiß ich nicht, aber jedes Mal wenn ich am späteren Abend mit dem Fahrrad durch ebendiese fahre, stehen auffällig viele zu leicht bekleidete Frauen vor den rot erleuchteten Fenstern rum... :)

Hmm, kann sein, ich bin da nur einmal langelaufen und habe mich gewundert, was das ist. Das letzte mal habe ich sowas in Amsterdam oder auf Fahrten in die Tschechiche Republik gesehen. Berlin ist da irgendwie nicht so heimelig, außer der Oranienburger Straße, doch das ist eher ein Touristenmolloch.

Olgastraße passt auch besser, auch wenn es ein oder zwei Vorurteile bedient.

Mal schauen, vielleicht bin ich ja mal irgendwann wieder in Stuttgart, aber wahrscheinlich macht das WoM eher wieder auf als ich mal da vorbeikomme.

Musikhaus Lange müßte es auch noch geben, hmm.
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
Olgastraße passt auch besser, auch wenn es ein oder zwei Vorurteile bedient.

Kicher...

Musikhaus Lange müßte es auch noch geben, hmm.

Dass Du mal in Stuttgart warst, war mir klar. Aber ein Musiker aus Stuttgart? Vielleicht kenn ich Dich doch irgendwie...

Ich bin bis dahin womöglich aber auch schon wieder weg, ich mach hier nur noch meine Doktorarbeit fertig und dann husch... Du bist im Moment in Berlin? Da stehen die Chancen vermutlich höher, dass ich mal in der Nähe bin...

Grüße aus dem Südwesten!
 
Nov 28, 2010
22,670
30
located
Kicher...



Dass Du mal in Stuttgart warst, war mir klar. Aber ein Musiker aus Stuttgart? Vielleicht kenn ich Dich doch irgendwie...

Und was für ein Musiker ... . Ich habe ein Jahr Gitarre "gelernt", aber nicht mal die alte Gans ist hängen geblieben. Mein Mitbewohner ist da musikalischer, Gitarre/Bass (ist doch ehhhhh das gleiche) und Trommel/Schlagzeug.

Ich bin eher der visuelle Mensch, Photographie und all der Rotz.

Und viel Erfolg bei der Doktorarbeit, und Respekt, wie sie hier im tollen, ahem, armen Berlin so einem hinterherrufen, wenn man mal die Möpse spazieren führt. Na gut, ein Mops. Ahem, was für ein Stinker.

So, the mods shall get angry now, wir haben hier janz schee abgelitten.
 

nateo200

macrumors 68030
Feb 4, 2009
2,906
42
Upstate NY
Wow great little app! Just tried it out and it works great! I muxed together an MKV with PCM in a .WAV container with H.264 elementary stream (.264 stream) and it converted to a Quicktime MOV!!! Thanks a bunch! I really appreciate when people put time into making these little apps! Very simple but just what I need. One of these days Ill take a look back at programming...I was pretty proficient in Java, Visual Basic and very little C++ but honestly it was allot of work and I just sorta gave up (I took 4 classes though).
 

nateo200

macrumors 68030
Feb 4, 2009
2,906
42
Upstate NY
So I was just given 64gigs worth of AVCHD to edit....for whatever reason FCP X will NOT transcode .MTS files...its such a b****! It'll transcode H.264/2ch PCM in a .MOV container but when I import from camera it sits there and goes to 100% then goes back down to 0% then 100% and back...and under the tasks it shows the same files! I tried converting an .MTS file to .MOV with Video Container Switcher but it chokes....

Already looked at this: https://forums.macrumors.com/showthread.php?p=15654240#post15654240
Already posted in there....
 
Last edited:

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
So I was just given 64gigs worth of AVCHD to edit....for whatever reason FCP X will NOT transcode .MTS files...its such a b****! It'll transcode H.264/2ch PCM in a .MOV container but when I import from camera it sits there and goes to 100% then goes back down to 0% then 100% and back...and under the tasks it shows the same files! I tried converting an .MTS file to .MOV with Video Container Switcher but it chokes....

This is a very simple tool (I took less than a day to write it). It might very well be possible that if FCPX can't handle the files, you won't have any luck with the Video Container Switcher.

But out of interest: Can you send me (copy-paste) the error message that Video Container Switcher gives out? Or tell me what you mean by "chokes"? Maybe there is a simple fix, but I'm not too optimistic...

By the way: What do you mean by "FCPX won't transcode"? 64 gigs of AVCHD is a huge amount of files. If FCPX tries to analyze and preview the complete folder, it will most certainly take a long time until it allows you to do anything again.

So, another three questions would be:
- Have you tried to create a new AVCHD folder structure with just one of those files in there and then go via "Import from camera..."
- Have you tried waiting a long time for FCPX to calm down again? Sounds silly, but it does help with such huge amounts of data.
- Do you know which camcorder the files came from and have you tried googling if there are known problems for FCPX?

If you send me one of the files, I can try running it through ClipWrap. ClipWrap does cost some money, so it would be better to try it first...
 

nateo200

macrumors 68030
Feb 4, 2009
2,906
42
Upstate NY
This is a very simple tool (I took less than a day to write it). It might very well be possible that if FCPX can't handle the files, you won't have any luck with the Video Container Switcher.

But out of interest: Can you send me (copy-paste) the error message that Video Container Switcher gives out? Or tell me what you mean by "chokes"? Maybe there is a simple fix, but I'm not too optimistic...

By the way: What do you mean by "FCPX won't transcode"? 64 gigs of AVCHD is a huge amount of files. If FCPX tries to analyze and preview the complete folder, it will most certainly take a long time until it allows you to do anything again.

So, another three questions would be:
- Have you tried to create a new AVCHD folder structure with just one of those files in there and then go via "Import from camera..."
- Have you tried waiting a long time for FCPX to calm down again? Sounds silly, but it does help with such huge amounts of data.
- Do you know which camcorder the files came from and have you tried googling if there are known problems for FCPX?

If you send me one of the files, I can try running it through ClipWrap. ClipWrap does cost some money, so it would be better to try it first...

Well its not all 64gigs at once...I tried a 4.29GB .MTS file first and it imported fine but it won't transcode! I actually just got Automator (simsaladimbamba suggested it in one of his tutorials) to work to convert the .MTS to .MP4 which I am now transcoding to ProRes 422....BUT I just find it weird that it will not transcode .MTS really at all....I even tried a 2minute .MTS test file from the same camera....I've had no trouble with H.264 in other formats like I said but .MTS is really just not working....I know obviously you have to be patient with 64gigs of H.264 but Im telling you IT TRANSCODES ABSOLUTELY NOTHING with .MTS! If I throw in .MOV from my DSLR and I mean tons of it I walk away, do some errands, whatever and I see it clipping along (pun intended :D :p). I don't know the specific model of the camcorder but Ill get it and look it up soon...I just don't understand how a supported codec doesn't work...I checked the encoding settings of the .MTS files too...thought maybe too many reference frames or B-frames or something but it wasn't the case as I've thrown some pretty complex encoded H.264 content into FCPX before and it was fine...I've been encoding video for like 10 years...I remember when H.264 came out and me and my friends were all crapping our selfs with the efficiency over regular MPEG4 and MPEG2!!!

But as for your Video Container Switcher, it keeps going and going and going and progressively sucks up more memory and CPU tell I have to force quit it. At least with the .MTS files....I'm guessing it has to do with the header files of .MTS being different than most, or possibly a FAT32 like limit...most of the files I tried it on were over 4gigs...and while I have all my drives formatted to handle over 4gigs I am not a programmer anymore so I don't know if a program would choke on something bigger than 4gigs. It works great on MKV's, MP4's, MOV's, that I have though.
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
If I throw in .MOV from my DSLR

This seems like a very silly question to ask, since you seem to know a lot about codecs and containers (and I really appreciate that): You do know that the .MTS files by themselves are not the whole container. Using (importing or even just converting) .MTS-files is the last resort I would refer to if you only got .MTS-files, and not the whole AVCHD folder structure. And if the structure is not available but was deleted. Then (and only then) would I recommend trying to work with .MTS files.

So, if you do have the whole AVCHD folder structure (it contains at least a CLIPINF folder, a STREAM folder and an INDEX.BDM file), you can import clips from it into FCPX via "Import from camera (Command-I)" and then pushing the "Open archive" button on the bottom left. Then you navigate to your folder and open the whole folder. The clips will show up in the FCPX window for import.

Be aware that when you convert the .MTS files without the CLIPINF folder, you will lose all metadata, no matter how brilliantly smart your converter is, because the .MTS files only contain stream, no other information whatsoever (like timecode, roll, camera model, ...).

But as for your Video Container Switcher, it keeps going and going and going and progressively sucks up more memory and CPU tell I have to force quit it.

Ugh. That does sound like something is seriously going wrong. Sorry about that. If you find the time, can you still send me a PM with the output. You can just press "Command-H" to show the output window of the ffmpeg executable trying to convert the file. You should be able to mark and copy-paste the text from this window. That would be great, thanks.

Maybe I should at least equip the tool with a "Cancel" button during conversion in case nothing it hangs this badly... Manually killing it shouldn't be needed in any software...
 

nateo200

macrumors 68030
Feb 4, 2009
2,906
42
Upstate NY
This seems like a very silly question to ask, since you seem to know a lot about codecs and containers (and I really appreciate that): You do know that the .MTS files by themselves are not the whole container. Using (importing or even just converting) .MTS-files is the last resort I would refer to if you only got .MTS-files, and not the whole AVCHD folder structure. And if the structure is not available but was deleted. Then (and only then) would I recommend trying to work with .MTS files.

So, if you do have the whole AVCHD folder structure (it contains at least a CLIPINF folder, a STREAM folder and an INDEX.BDM file), you can import clips from it into FCPX via "Import from camera (Command-I)" and then pushing the "Open archive" button on the bottom left. Then you navigate to your folder and open the whole folder. The clips will show up in the FCPX window for import.

Be aware that when you convert the .MTS files without the CLIPINF folder, you will lose all metadata, no matter how brilliantly smart your converter is, because the .MTS files only contain stream, no other information whatsoever (like timecode, roll, camera model, ...).



Ugh. That does sound like something is seriously going wrong. Sorry about that. If you find the time, can you still send me a PM with the output. You can just press "Command-H" to show the output window of the ffmpeg executable trying to convert the file. You should be able to mark and copy-paste the text from this window. That would be great, thanks.

Maybe I should at least equip the tool with a "Cancel" button during conversion in case nothing it hangs this badly... Manually killing it shouldn't be needed in any software...

Yes I realize that the .MTS is not the whole thing and I do understand the AVCHD structure. I've authored both Blu-ray and AVCHD discs before using nothing but TsmuxeR which requires a bit more knowledge of the structure than completely automated authoring suites. I've also imported from this same camera about a year ago and it did the same thing on a 20minute video I had to edit....took me like 20 hours to finish because my CPU was at 100% the whole time trying to decode the AVC.......As for loosing metadata and timecode....Ive honestly never needed that or worked with it before :O I know that sounds crazy but I mostly work with one camera and the times I've used more than one I didn't use time code as reference because it somehow got corrupted :/

But yes a Cancel button would be nice!
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
Yes I realize that the .MTS is not the whole thing

Sorry for asking, I thought so. Just had to make sure...

I also mostly discarded the metadata, but in the inspector in FCPX, it is so very obvious that now I am actually using it to seperate the angles from different cameras (camera model info) and then make a multicam clip (timecode) from them. Very handy, but I'm not nearly at the peak of what you can do with it, I think.

I am also coming from a Linux background, that's why I have to know my way around codecs and command line tools. Helped me a lot at times. If you have trouble with this one camera model and you will have to edit footage from it in the future, my offer still stands that I can try ClipWrap on one of the files. If it works, you might invest the $50 for it to save you some time.

Oh, and: I'll add the cancel button as soon as I find the time.
 

nateo200

macrumors 68030
Feb 4, 2009
2,906
42
Upstate NY
Sorry for asking, I thought so. Just had to make sure...

I also mostly discarded the metadata, but in the inspector in FCPX, it is so very obvious that now I am actually using it to seperate the angles from different cameras (camera model info) and then make a multicam clip (timecode) from them. Very handy, but I'm not nearly at the peak of what you can do with it, I think.

I am also coming from a Linux background, that's why I have to know my way around codecs and command line tools. Helped me a lot at times. If you have trouble with this one camera model and you will have to edit footage from it in the future, my offer still stands that I can try ClipWrap on one of the files. If it works, you might invest the $50 for it to save you some time.

Oh, and: I'll add the cancel button as soon as I find the time.

Hmm I think I can do a trial of ClipWrap, or can I not? Either way I was playing around with the camera today, its a Panasonic and I got a ton of short test videos from it. I should mention that the footage I received was interlaced :)O yuck not my choice ever! I hate interlacing) I don't know if that would change anything...I imagine though that I will be doing more multi camera work I guess, I had better figure out this issue soon :/
 

floh

macrumors 6502
Original poster
Nov 28, 2011
460
2
Stuttgart, Germany
Hmm I think I can do a trial of ClipWrap, or can I not?

That is very well possible. And actually an option...

Either way I was playing around with the camera today, its a Panasonic and I got a ton of short test videos from it. I should mention that the footage I received was interlaced :)O yuck not my choice ever! I hate interlacing) I don't know if that would change anything...I imagine though that I will be doing more multi camera work I guess, I had better figure out this issue soon :/

The interlacing should not have posed any problem. I've just played around with a few clips and am now pretty sure the file size was the problem. Seems like my little tool can't handle files that are too big. I'll try to find a way around it soon. Thanks for the hint though.

Good luck with your interlaced footage. Will it at least be played back on an interlaced TV screen? ;)
 
Nov 28, 2010
22,670
30
located
Just another thought, at my workplace we now also have to handle AVCHD footage and in order to get them into Avid Media Composer 5.5.3..3, we open the .mts file in QT X and use the SAVE AS command (CMD+SHIFT+S) to save it as a .mov file, which then can be imported via AMA into MC. The same should be able via FCP X and that .mov file, though it might be a bit cumbersome to do so without a batch function. I just open six or so .mts files in QT X and use that CMD+SHIFT+S and Exposé to save as .mov and switch between windows and can get 30 videos done in less than five minutes (excluding the actual saving process).

These are the QT Components I have in my Macintosh HD / Library / QuickTime / folder, they can be downloaded in ten minutes from now (still uploading from an abysmal internet connection for ten or more people).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.