In an earlier post, I explained the name of this blog, “Try, Test and Learn” to mean that I wanted to learn the ins and outs of WordPress. Maybe I’ll learn something about WordPress with this post, but that would be incidental to its purpose which is simply to write an account of a video conversion and manipulation project which occupied many evening and weekend hours over several months.
- What this is about?
- The task
- First Conversion attempt
- Something went wrong!
- Splitting, splicing and more post-processing
- Final Notes
My friend (and boss) John MacMillan, (‘Mac’) is also a stand-up comedian. Last February, he, together with several other guest artists who are also my colleagues, performed for charity at the Pilot, a Toronto jazz club.
The show was professionally videographed, but several months on, Mac had not released any of the recordings. I asked why, and he explained that: 1. There were 9 files, 22.06 GB in all, and therefore unmanageable, and 2. they didn’t play properly. I was intrigued by the problem and asked him what he meant. He brought his new MacBook Pro, and clicked on one of the smaller files. The files had the .mov extension which was associated on his machine with QuickTime. Alas, QuickTime responded with “The document “Feb11-2011-02.mov” could not be opened. The movie is not in a format that QuickTime Player understands. You may need to install additional software to open this time of file” The options were “Tell Me More” and “Ok”. “, but not saying which additional software was needed. I suggested he try VLC. VLC showed the Video, but no sound. Stumped, I asked him to give me one of the smaller files so that I examine them on my own.
So he have me a copy of the 2nd file of 9. It was 293.8 MB and 64 secs long, and I set out to figure out what was the problem with it. I tried again playing it in all media players I had on my MacBook Pro and my Windows machine.
These were my findings::
- VLC (Mac and Windows): Video, No audio.
- RealPlayer, DivX Player (Mac and Windows): Audio, No Video
- iTunes (Windows): Audio, No Video [iTunes for Mac didn’t Play it at all]
In any case, it was clear that even if I was to be find a player that would play the .mov files natively, I would have to drastically reduce the total file sizes; 22 GB for two hours max of video was insane. My task would be to make the files playable, and to make their size manageable. Two hours of video should fit nicely on a standard DVD.
The first step was to figure out what kind of file I was dealing with:
Here are the parameters as shown by the Mac versions of QuickTime (v10) and VLC (1.1)
A videographer friend of my daughter, Janet identified the original files as being native to a Sony XDCam.
In converting the files, I wanted the resulting video file to be as close to the original as possible, ie. Resolution 1980 x 1080, and audio in stereo, (or two channels). Of course, the resulting file had to pass the subjective look and hear test, and to be reasonably sized. I tried several converters, generating test file after test file. For example, an .avi file looked fine, but the audio was mono.
Mr. Video Codec (my nephew, Anthony J) recommended that I “transcode … to H.264 (Main or High Profile) with AAC audio in an MP4 or MOV container, (I) should get very nice quality at about 5 Mbps.”. So I had to find a converter that encoded those specs.
After trying several converters, I found the Mac version of the free Kigo Video Converter (http://www.kigo-video-converter.com/free-video-converter-mac/ ) and it seemed to fit the bill. When converting to MP4, Kigo offers 3 codecs: xvid, mpeg4 and x264. Among Audio settings, I chose the aac codec, and audio channel: 2, (assuming this to mean that two channels were retained after the conversion. There is a choice for A/V sync with the choices being ‘default’ or ‘basic’. I tried both settings and didn’t notice any difference. The resulting .mp4 file seemed just fine. The .mp4 played in most players, the sound was in stereo and the file size was reduced from 293.8 MB to 7.3 MB.
With this solution in hand, I asked Mac to send me the remaining 8 MOV files for similar conversion. With these, I proceeded to apply the same conversion using Kigo to them. While some of the resulting .mp4 files were fine, (at least) one had no sound, and another had a two minute stretch of silence in the middle. Clearly it was time to “go back to the drawing board”; What could have gone wrong? Was there really no audio on one of the recordings ?
I played the problem .mov with RealPlayer, vlc etc, and the result was consistent with the earlier results: no video with RealPlayer, and no audio with vlc. But the important point was that indeed there WAS audio in that file. Here is how the waveform for that file looked in audacity (http://audacity.sourceforge.net/ )
It seems that one track channel was muted, while the other had audio. But why didn’t Kigo pick it up? I have no idea
In my first attempt, the result was the same as with Kigo. No sound.
I then noticed that under the audio settings, there was a button “Add All tracks”.
By default, only Track 0 was showing. I pressed the “Add All Tracks” button, and Track 1 was added.
I carried out the conversion, but still no sound. One last try, I thought, what about deleting track 0 ?
BTW, Handbrake has another interesting feature: A preview functionality. Basically, it allows you to encode a 7 second snippet to check the result of the settings before going through with the conversion, and yes indeed, by deleting the empty Track 0, the conversion was successful with both video and audio. The original 7.24 min .mov was 2.03 GB, the result only 248.7MB.
There was that other problem of the videoclip with a 2 min audio gap. Here is its waveform:
The solution was to run Handbrake adding both tracks, with their order reversed, ie. track 1, before track 0, and that worked.
One thing I must state on the record: a lot of what I was doing was really “Trial and error. Some things worked, other didn’t, and sometimes I would rerun a conversions with what I thought would be the same settings and get better or worse results. Frankly, I didn’t know exactly what I’m doing, just trying one thing after another. So if you were to try following the steps I describe, I wouldn’t be surprised if slightly different results came about.
In any case, I eventually had all 9 .mov files converted to much smaller mp4s. The 22GB of .mov files were now 3GB in mp4s. The initial task was now complete.
Of the 9 files, 6 were uninteresting short outtakes, leaving 3 for further processing. Number 9 was a discrete clip of one act. Number 6 was a continuous 54 min clip that needed to split into 4 parts, and Number 5 was the continuation of the 4th segment of number 6.
So how to split an MP4 video file, and secondly how to splice (merge) two MP4 files together.
The first subclip of the video file is now selected and c be saved. From MPEG Streamclip’s File Menu, Select Save As:
and then give the cut clip an new name:
Now to continue, play the original video clip, and select the rest of the subclips by pressing “I” (for IN), and “O” (for OUT), and save them in the same manner until all required subclips are saved in distinct files.
The final step in the manipulation of the clips is to splice two video clips together, specifically to follow Feb11-2011-006-4.MP4 with Feb11-2011-005.MP4. Yes, File 006 is followed by 005.
The splicing tool I used is SimpleMovieX ( http://simplemoviex.com/SimpleMovieX/info.html). The SimpleMovieX website has a tutorial to demonstrate how to join the two files: How to merge Movies. The tutorial shows two methods: The first involves pasting the video files on to the SimpleMovieX window, one after the other, but I couldn’t get this method to work. The second method involves pasting the two files at the same time. SimpleMovieX the asks if the files should be ordered by date or by name. In my case, the file dates were the same, and the file names gave the wrong sequence. So I just added ‘1’ and ‘2’ as prefixes to the files and pasted them to the SimpleMovieX window, and then save it from the File menu. I saved the merged file as a .mov, as the save as MPEG-4 option was greyed out, probably because the SimpleMovieX I was using was a Trial version. But the mov was good enough for me.
Now, I had 4 MP4 video files and 1 MOV video file. The original task of turning the original raw files from the event into smaller playable video files was finished. Next I put together these files into a DVD image and burned it to a disk. For this, I used the iDisk application that was included with Mac OS X. Describing this process is outside the scope of this post.
I started this post by noting that QuickTime wouldn’t play the original .MOV files. That was QuickTime 10.0 which comes with Mac OS X 10.6 (Snow Leopard). QuickTime 10.1 which is included with Mac OS X 10.7 (Lion) played the original files without any problem
I also found two other players that would play these files: On the Mac, there is MPlayer OSX Extended ( http://www.mplayerosx.ch/#