Updated on 2008-12-19

Yes, Apple is not close enough to OpenSource and portability as one might need/desire.

One of my collegues downloaded his video camera clips to his Apple iMac with Leopard, using probably iMovie (or iLife??) and produced a lot of MOV clips who he sent to me in a zip file.

When trying to open them under Windows, I couldn’t happen to view a single frame: I tried VLC, WMPlayer and, of course, QuickTime Player. No use.

I found anyway that:

  • The audio was hearable
  • The video had the codec fourcc name of: m2v1

I googled around and found that this must be an Apple codec encapsulation for MPEG2 videos.

So I tried to extract the raw streaming with MP4Box (using the GUI YAMB) and got a perfectly viewable mp2v streaming (.m2v).

That made me think: why the raw data is an m2v, but the fourccs are m2v1?!?!

Since I do not have time to investigate the MOV file format and, well, not knowledge at all, I tried the newbie method: search for m2v1 in the binary file with an hex editor.

Found 2 occurrencies: m2v1 and ‘m2v1′
The next obvious step was to try to change them to the real m2v fourccs: mp2v
Et voila! The mov played flawlessly in my VLC player (and others).

So I wanted to contribute and made a very skinny command line app for win that could change the fourccs for me.

Beware: this does not check for anything! Just changes up to two occurences of m2v1 to mp2v (anyware in the file).

Enjoy m2v1_to_mp2v ;-)


Update 2008-12-19

Yep, if you followed the comments, there’s another case where mp2v is not the right FourCC code, so I made an m2v1_to any FourCCs :)

m2v1_to FourCC

You must specify the fourcc destination code and you may add as many files as you like (also using jolly char): this enables you to run the tool on an entire directory with
m2v1_to -m2pv *.mov
Enjoy even more :-D


Update 2009-06-17
As many ppl here are having this issue and no solution seems to be released (except mine) we are having a wide range of cases: I’d like to specify here some more cases and their solution, just to prevent other ppl asking the same thing in the comments ;-)

BIG NOTE: be aware that your clip file must be writable, otherwise the patching might seem ok, but nothing has been actually patched at all! So first of all do a right click -> properties and un-check the read-only tick

Then, if you’re trying the first tool:
- put everything in a folder like C:\clips
- open a cmd window (Start -> Run, enter “cmd” without quotes, click Ok)
- at the prompt, cd \clips
- run the command with
m2v1_to_mp2v clipname.mov
- check the results

The results must be something like:
m2v1 to mp2v: opening clip1.mov…Parsing…Done!
Patching…second patch…
Done!

If not, that means that the file is not in the expected format: i.e. you will have to check manually (more below)

Yes, you might also want to just drag your file on the tool name, but in that way you’ll never be able to see the output (you might want to do that on known cases)

Now, provided that every test should always start from the original file, here some cases we’ve raised/solved in the comments:

1. The file might be patched correctly, but for some reason Windows Media Player is still unable to read it: i suggest you give a try with VLC (VideoLanClient)

Moreover if you want to use the file in your favorite videoediting software, you’d better first check in that. Or you might try with a different editing software: it might be that WMP does not read it, but opening the clips in an editing software, you can just re-encode (export) them in a more suitable format! Many software can do edit MOV files, but not everyone, so please just check (if you have them available, you might try Adobe or Ulead – the first two coming into my mind)

2. The file might be in a slightly different format: try to use the second tool specifying -mpg2 at the prompt as the FourCC patching code.
As stated in the usage lines (run the file from the command prompt and you’ll see this):
* m2v1 to FourCC
* by Marco Abiuso (2008)
* Changes up to 2 occurrencies of 'm2v1'
to specified FourCC code in a binary file
Usage: m2v1_to - [ ...]

…you should just write
m2v1_to -mpg2 myckip.mov
Yes, somebody tried mpg2 as the FourCC code and it worked!

It might be the case that the file is encoded in even another format: you’ll have to discover that, for example loading the file in VLC and checking the media streams information (in the current version of VLC: Tools -> Media Information or Ctrl-I while viewing): that should really give m2v1, but just double check to be sure.

Again: check that the software return signs of patching in the output, if not: the file has not been patched.

3. If none of the above works, you’d better use a nice binary editor (like Hex Editor Neo Free or XVI32) and try to find the original FourCC code. The FourCCs are very near the word Apple: just check all the occurrencies and you’ll find somewhere a human readable string with the word Apple in it: look at some four characters code and write that down. We will try to check that if you post it in the comments.

Here what appears “graphically” on my hex editor:
m2v1 hex string
See those m2v1 and ‘m2v1′ strings around the center of the image? Gotcha! :-)

Be aware that the word Apple will never appear if the file was not edited/created by a Machintosh! In that case the problem might still be the same, but we will have to check case by case.
Now I hope it’s more clear to everybody :-D

  • Share/Bookmark

Related posts

Related External Links

Rating

Not useful/interestingUseful/Interesting (+4 rating, 4 votes)
Loading ... Loading ...

73 Comments

  • Andy says:

    This may sound like a dumb question…but I can’t figure out how to run either of the two programs that you’ve used…is the a detailed explanation on using them? I’ve tried putting the .mov file in the same folder and running the program but nothing seems to work…if you could just let me know how to properly use it that would be great!

  • MindSuburbian says:

    Andy, you will have to open a dos prompt (console) from Windows (Usually go to Start, then Run, enter the command ‘cmd’ without quotes and hit OK)
    If you do not know how to use the dos prompt, try to run the command in the run box with the full path of your video file, e.g.

    m2v1_to_mp2v “c:\my videos\myfile.mov”

    Don’t forget the double quotes if you have spaces in the folder or file names.

  • Andy says:

    Hey thanks! It worked with the m2va_to_mp2v but unfortunately I couldn’t get it to work with the fourcc version…I typed into the dos-prompt “m2v1_to -mp2v C:\Folder\Folder\*.mov” did i do something wrong?

    No offense against VLC but I prefer using something like Quicktime or even media player classic…is there another FourCC code that I could use rather than mp2v?

  • MindSuburbian says:

    Hi,
    unfortunately that’s not a perfect science as i don’t know the .mov file format and the internal workings of QTimePlayer/VLC/WindowMediaPlayer, so either you discover a better supported FourCC code, or you’ll have to end up using VLC…

  • Andy says:

    well I have no idea how to do that. But thanks so much for finding a solution!

  • Dodge says:

    hmmm lets see how can i say this….I have kinda a personal video of me and this girl I need help converting :( I have tried and can not figure out from m2v1 :( help please

  • MindSuburbian says:

    Dodge, it’s not about the content here ;-)

    Tell me what you did and what you got, and i’ll try to help.

    Unfortunately it seems there’s nothing else to do (a part from running the tool and watching videos thru VLC)

  • Tim says:

    One suggestion & one observation:

    I believe you can use ffmpeg to change the fourcc of a file like so:

    ffmpeg -i infile.mov -vtag mpg2 -acodec copy -vcodec copy outfile.mov

    In the MOV file I’ve got it contains the following streams:
    Stream #0.0(eng): Video: ‘m2v1′, 720×576, 25.00 tb(r)
    Stream #0.1(eng): Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
    Stream #0.2(eng): Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
    Stream #0.3(eng): Data: tmcd / 0x64636D74

    My guess is that the two mono Audio streams are actually left/right stereo. ffmpeg will strip everything but the first video & audio stream and VLC will only play one audio stream at once. I haven’t worked out a way to merge them …

  • MindSuburbian says:

    Ah, that’s a good catch!

    Anyway, you would have to re-encode the audio streams if you want to obtain a stereo track.

  • Paul Hood says:

    Took me a few minutes to figure out the command line because I’m hard headed, but once I did, WOW!!

    This was a lifesaver!! I have been scratching my head trying to figure out why my MACBook would export this format in MOV that Apple’s own QT Player wouldn’t even play in Windows. What’s up with that anyway!? I imported the movies from my Sony Handycam into IMovie and thought I had it goin’ on! Then copied to a flash drive to bring to work and……the big disappointement hit when they wouldn’t play.

    I appreciate your work and efforts in this tool. I wish I was a programmer!!

Leave a Reply

Powered by WP Hashcash