Sunday, February 26, 2006

Exporting Video from Cinelerra for a Video iPod

So. I really, REALLY wanted MPEG-4 output from Cinelerra to go directly into iTunes and my brother's iPod. I had output a test file:
http://content.serveftp.net/video/renderTest/test.mpeg4.mov (7.8MB)
that loaded and played in iTunes. However, when I went to upload it, iTunes gave me the message:

"Some of the songs in the iTunes music library, including the song "(Video name)",
were not copied to your iPod because they cannot be played on this iPod."



Luckily, Apple provides a feature called "Convert Selection for iPod" when you right-click.
But GEEZ! I already rendered this thing. I've got to do it again? Ugh. OK. And OH NO! The conversion utility takes a RIDICULOUS amount of time! Even on a very fast machine like mine, a 3.2Ghz P4 with 1GB of PC3200 memory, the conversion speed is roughly 1.5 minutes per minute of video. Argh!! That is way TOO slow. But I went ahead and did the conversion with my short test video. On the bright side, once the video was converted, I could then update my iPod and the video was on my iPod. Hooray!!

I continued playing around and loading many different videos into iTunes. In my travels, I stumbled upon one that did not require a conversion. I was shocked! I then reasoned that I'd save a helluva lot of time if I just produced the videos in the format that iTunes expects in the first place. But how to do that? So, my next course of action was to research why that one file worked in iTunes without a conversion and why mine needed the conversion.

To do this, I analyzed the output of MPlayer to determine the differences between files. I learned quite a bit over the past couple of days about audio and video formats by reviewing the output of MPlayer. It helps to have the text of both files displayed in two windows next to each other in order to more easily compare the files line by line. I've done this for you in the image below (click this link with SHIFT-click to open a second browser window):
http://content.serveftp.net/video/renderTest/cinItunesConversion.jpg

Reviewing the diffences, I noticed the following:
1) iTunes compatible file had the audio track as the first track in the MOV container, my file had the video as the first track
2) iTunes compatible file was 44.1Khz audio, my file was 48000Khz
3) iTunes compatible file included an extra audio header, my file didn't have the extra header
4) iTunes compatible file audio compression method was MPEG-4, my file was twos complement
5) iTunes compatible file FPS rate was 15, my file was 59.97

After way too many hours of trial and error (and scowls from my girlfriend and dog), I am proud to say that I have found the settings in Cinelerra that will make an MPEG-4 video totally compatible with iTunes so that iTunes does not need to re-render (the "Convert Selection for iPod" feature) the video!

Here are the specs:

For the project:
Set Format
Sample Rate to 44100khz
Number of Channels to two
FPS can be the FPS of your source video
(try lower to 25 or less if problems)
Width 320
Height 240 (320x180 fine as well)
For the render:
Audio
MPEG-4 Audio
Bitrate 128000
Quantization of 100
Video
MPEG-4 Video
The rest of the parameters are Cinelerra's
defaults, but I will reiterate here:
Bitrate 7000000
Tolerance 500000
Fixed Quantization selected
Quantization 10
Keyframe Interval 45

I don't care how you do it, but you have to get your videos in that format
because iTunes is COMPLETELY STRICT when it comes to these settings! If you expect your video to upload into iTunes without needing a re-render, you
CANNOT deviate from ANY of these settings!!

Caveat: with the possible exception of the MPEG-4 Video defaults. But I
would only deviate from the settings after you've got the file uploaded into
iTunes without any issues first.

Please let me know how this works for everybody,
scott

References:
http://www.apple.com/ipod/specs.html
http://www.ipodwizard.net/showthread.php?t=4413
http://members.shaw.ca/Kyle-Rogers/
Beginner's Guide to Exporting Video from Cinelerra

Update 10/15/2008
Making a Podcast, by Apple

Wednesday, February 01, 2006

Beginner's Guide to Exporting Video from Cinelerra

Alright! I've just created a Beginner's Guide to Exporting Video from Cinelerra! In Cinelerra speak, "rendering" means exporting. I hope all you Cinelerra fans out there appreciate it! Please let me know how you like the doc.

:)
enjoy

Thursday, December 29, 2005

NYC video posted on Google

This was the first video I created with my JVC HD10U, back in 2004. Got some good jazz keeping the action going in this one:
One Weekend In NYC

Wednesday, December 28, 2005

using ffmpeg to combine an audio and video file

In order to get my NYC video onto Google, I had to go through a number of steps to get it to a Google-acceptable MPEG2 format:
1) in XP, re-render the original Microsoft WMV file into an AVI using Adobe Premiere
2) again in XP, demux the AVI file (split apart into separate audio and video streams) using TMPGEnc into a DVD-ready, MPEG2 video stream (.m2v file) and a Windows waveform audio (.wav)
3) in Fedora, remux the video using ffmpeg:
ffmpeg -i OneWeekendInNYC.wav -i OneWeekendInNYC.m2v -target dvd -hq -minrate 8000000 -title "OneWeekendInNYC" -author "Crazed Mule Productions, Inc." -copyright "2005" -comment "Video of downtown NYC, summer 2005 with jazz accompaniment shot with JVC HD10U" OneWeekendInNYC.mpg

In the above example, ffmpeg has a number of inputs:
1) the audio file: -i OneWeekendInNYC.wav
2) the video file: -i OneWeekendInNYC.m2v
3) a target media type for the combined audio and video file: -target dvd
4) high quality transcode: -hq
5) a minimum bit rate for the compression: -minrate 8000000 (This doesn't seem to work based on the second to the last line of output which shows a lower average bitrate, below)
6) various descriptive metadata (-title "OneWeekendInNYC" -author "Crazed Mule Productions, Inc." -copyright "2005" -comment "Video of downtown NYC, summer 2005 with jazz accompaniment shot with JVC HD10U")
7) the filename of the combined audio and video streams: OneWeekendInNYC.mpg

Here is the output of that command. Note the input files, output filename and second to last line with the average bit rate. I believe the -target dvd overrides the -minrate option:
[root@computer video]# ffmpeg -i OneWeekendInNYC.wav -i OneWeekendInNYC.m2v -target dvd -hq -minrate 8000000 -title "OneWeekendInNYC" -author "Crazed Mule Productions, Inc." -copyright "2005" -comment "Video of downtown NYC, summer 2005 with jazz accompaniment shot with JVC HD10U" /root/OneWeekendInNYC.mpg
ffmpeg version 0.4.9-pre1, build 4753, Copyright (c) 2000-2004 Fabrice Bellard
Input #0, wav, from 'OneWeekendInNYC.wav':
Duration: 00:01:57.6, start: 0.000000, bitrate: 1536 kb/s
Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Input #1, mpegvideo, from 'OneWeekendInNYC.m2v':
Duration: 00:01:57.6, start: 0.000000, bitrate: 7998 kb/s
Stream #1.0: Video: mpeg2video, yuv420p, 720x480, 29.97 fps, 7998 kb/s
Assuming NTSC for target.
Output #0, dvd, to '/root/OneWeekendInNYC.mpg':
Stream #0.0: Video: mpeg2video (hq), yuv420p, 720x480, 29.97 fps, q=2-31, 6000 kb/s
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 448 kb/s
Stream mapping:
Stream #1.0 -> #0.0
Stream #0.0 -> #0.1
[mpeg2video @ 0x7f6a330]Warning min_rate > 0 but min_rate != max_rate isn't recommended!
Press [q] to stop encoding
frame= 3526 q=0.0 Lsize= 91494kB time=117.6 bitrate=6373.5kbits/s
video:83347kB audio:6431kB global headers:0kB muxing overhead 1.911009%

Obviously, there will be some loss of quality with these many rendering steps, but quality is not of primary importance when posting to Google video.

Hope this helps!
mule

Reference
FFMPEG HowTo

working with the Google Video Uploader for Linux

One of the most irritating things about working with the Google Video Uploader for Linux is
1) knowing which Java tool you need to install to get the uploader to work and
2) the damn syntax for executing the JAR archive.

First, install the latest Java Runtime Environment, found here:
http://java.sun.com/j2se/1.5.0/jre/install.html

Secondly, once you've got the latest JVM installed, use the following syntax to start the Google Video Uploader for Linux:
java -jar GoogleVideoUploader.jar

Finally, if you are so bold, you may install the entire Java JDK found here:
http://java.sun.com/j2se/1.5.0/install.html

These few steps took me about four hours to figure out one day. Frustrating.

Hope this helps folks.

Thursday, December 22, 2005

flowery video

Oh, a little Vivaldi is good for the soul! Enjoy this video, full of flowering, buzzing things:
One Weekend in Virginia

Sunday, October 16, 2005

Finally. My first video is posted on Google Video!

Enjoy my Nags Head video people!

don't be in the drum section of a music store when your website is down

I had gone into the city to Manny's music yesterday to look at a Roland PD80R drum pad based on the fact that the guy on the phone at Manny's told me they had the pad in stock. Well, when I got there, the idjut who was at the desk couldn't find the pad in the system. Argh. Trip wasted. But just at this moment, I received a system down call. Double yarg!!

Word to the wise: when you're on a SEV 1 call, the worst place in the world is to be in the DRUM section of a music store.."What? The system card failed??! Site down??!! What??!" Truly frustrating and nerve racking. In the end, I bugged out of the city thinking they didn't have it. Also, I was more interested in getting back to Jersey to be available to help.

So today I call back to speak to the original guy to ask him "what the F happened?" This guys' name is Brian, and Brian indeed told me they had it; however, it is shared inventory with Sam Ash across the street. Apparently, the guy who helped me in the store when I got there didn't check. YARG!! So I went home, double-pissed, cause I didn't get to lighten my wallet with a new toy AND the fcking web site was down!! 16 hours later and I'm finally catch some zzz's. Harumph.

Well, today Brian was good enough to walk across the street to Sam's and verify they had the pads in stock. So I may or may not go.

how's that for a friggin weekend?