Tuesday, August 29, 2006

smooth scrolling credits for Cinelerra

An easy way to simulate scrolling credits is to use a very long jpeg or png image and use camera automation in order to scroll from the top part of the image all the way to the bottom of it. The one issue that has been called out on the Cinelerra boards is that the default camera automation is done using bezier curves. So, what'd you'd see by taking the defaults is that the scrolling would quicken at the beginning and the end of the automation, but be somewhat linear in the middle. The steps below show how to straighten out the curves in order to make the scrolling linear from beginning to end; in other words, a constant rate of scrolling all the way through the automation. Thanks to Nicolas from Paris for the directions!

- turn on the X and Y camera position indicators in the View menu
- click on the "Generate keyframes while tweaking" small key icon in the Timeline or Compositor
- for the scroll beginning, modify the Y position of the camera, in the compositor window. You can also click the "?" icon to enter the value directly
- at the end of the scroll, click and then I go back 1 frame to edit the Y camera position again
- go back to the main window and select "Camera Y" in the view menu.
- type "Alt-F" to modify the "Camera Y" green line height to see it entirely on the video track
- click on the start keyframe while typing "CTRL" to modify the keyframe curve slope
- do the same for the end keyframe in order to get a straight line between the start and end keyframes

After tweaking the settings, the scroll speed becomes nice and linear.

FC4 dependencies for Cinelerra CVS

Here are the packages you must have installed in order to compile the Cinelerra CVS from source on Fedora Core 4:

automake-1.9
libdv4, libdv-0.104*
ffmpeg*
xvidcore*
lame, lame-devel
libvorbis*
libogg*
libtool-1.5
a52*
libtheora*
libpng-1.2*
libjpeg-6*
libtiff*
esound*
audiofile*
libraw1394*
libavc1394*
freetype*
fontconfig*
nasm
e2fsprogs*
faad2-dev*
mjpegtools*
OpenEXR, OpenEXR-devel
fftw3*
libsndfile*
libiec61883*
x264, x264-d*
faac*

Notes
*for libdv-0.104, you must remove libdv-1.0.3 first which is used by *many* programs
*for mjpegtools, conflict msgs w/dries mjpegtools-libs
*OpenEXR path problem on build, create sym link to /usr/include/openexr

Thanks to Brendan Conoboy for suggesting the libdv-1.0.4 upgrade. Really sped up my playback framerate from about 9fps to 30fps.

Sweet!

Saturday, August 26, 2006

shaking title/freeze frame effect

The Projector is responsible for the shaking title effect. With "generate keyframes while tweaking" option selected, I created the shaking effect manually by moving the X/Y coordinates of the projector randomly in the compositor. I added further jerkiness by resetting projector coordinates manually via the X, Y, Z projector coordinate tool. I set the coordinates to 0,0 sometimes and then wildly negative and positive numbers (-264/+300) for real bouncy titles. I enabled the video track with titles only:
blurTitleShake
400K

After the shaking title experiment, I then completed the picture by adding a second video track with a Freeze Frame.
blurTitleShakeVideo
3MB

Timing fade outs and the proper freeze frame position were somewhat of a chore, but since I will be repeating this same sequence with different video and titling three or four more times, I should have the process optimized after finishing the last one.

blurred title

Boy, does that blur effect take forever in Cinelerra. And my box isn't a slouch: P4, 3.2Ghz, 2GB of 400DDR. For this short, four second video, it took 4.5 minutes to apply the blur effect on the title at DVD resolution using YUV4MPEG & FFMPEG. Ridiculous. Here it is though:
blurred title

Baby steps, I tell myself.

Sunday, August 20, 2006

system reconfig, final entry

Sil680 Not Recognized by Fedora
OK. I'm tired. Going to make this quick. Sil680 ATA RAID0 stripe set not recognized automatically by Fedora. Tried reinstall of Fedora. Does not recognize the RAID0 set I created. ARGH.

Saved by MDADM
I had to dust off my very, very rusty Linux RAID creation skills and manually create a software RAID set. In short:
- fdisk to mark the drives as part of a raid set
- use mdadm to make the raid set active
- create a mdadm.conf for the array
- put it in /etc/fstab
- format the stripe set

Here is the most important snip of what I did:
[root@computer /]# mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/hdg1 /dev/hdh1
mdadm: array /dev/md0 started.
[root@computer /]# mdadm --detail --scan >> /etc/mdadm.conf
[root@computer /]# cat /etc/mdadm.conf
DEVICE /dev/hdg* /dev/hdh*
ARRAY /dev/md0 level=raid0 num-devices=2 UUID=9c4c078f:8935e3e4:bfface8f:6a3c2c18
devices=/dev/hdg1,/dev/hdh1

[root@computer RPMS]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/devpts /dev/pts devpts gid=5,mode=620 0 0
/dev/shm /dev/shm tmpfs defaults 0 0
/dev/proc /proc proc defaults 0 0
/dev/sys /sys sysfs defaults 0 0
/dev/hda5 swap swap defaults 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
/dev/hdc /media/cdrecorder auto pamconsole,exec,noauto,managed 0 0
/dev/md0 /mnt/videos ext2 defaults 1 1
[root@computer /]# mkfs.ext2 /dev/md0
mke2fs 1.37 (21-Mar-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
29310976 inodes, 58609088 blocks
2930454 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=58720256
1789 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.


Congrats to me/Girlfriend Doesn't Care
Pretty good for a guy who didn't know mdadm before tonight. So yeah! RAID0 set works! Hoohah! Copied a movie to it and then tested it in Cinelerra. HOLY SMOKES! Getting 50fps on a 1280x720 HDV movie! Damn that's fast! I can't understand why my girlfriend doesn't care about this at 1am??!

Gotta crash. I think my work is done here.

Update, 9/11/07:
Here is a very nicely organized article on adding new hard drives to Fedora:
http://fedoranews.org/tchung/storage/

Saturday, August 19, 2006

system reconfig, #3

Cinelerra Installed..Working Another Matter
OK. So I am going to take a two hour break to watch Apollo 13. What better movie to watch to get you psyched to configure a RAID set! Before I am leaving, I have installed Core 4 successfully, got yum working after some RPM key stickiness, and downloaded all the dependencies for Cinelerra:

Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
cinelerra i386 2.0-0.4.20051210.2.fc4 /root/Desktop/cinelerra-2.0-0.4.20051210.2.fc4.i386.rpm 23 M
Installing for dependencies:
OpenEXR i386 1.2.2-6.fc4 extras 404 k
a52dec i386 0.7.4-8.fc4.rf dries 50 k
faac i386 1.24-3.fc4.rf dries 75 k
faad2 i386 2.0-8.fc4.rf dries 382 k
ffmpeg i386 0.4.9-0.lvn.0.21.20051228.4 livna 1.6 M
fftw i386 3.1.1-1.fc4 extras 865 k
fltk i386 1.1.6-1.2.fc4.rf dries 1.0 M
gsm i386 1.0.10-5.2.fc4.rf dries 39 k
imlib2 i386 1.2.1-1.fc4 extras 562 k
lame i386 3.96.1-4.fc4.rf dries 394 k
libiec61883 i386 1.0.0-0.2.fc4 freshrpms 35 k
libquicktime i686 0.9.7-0.lvn.8.4 livna 355 k
libsndfile i386 1.0.15-1.fc4 extras 218 k
mjpegtools i686 1.8.0-1.2.fc4 freshrpms 763 k
Updating for dependencies:
cpp i386 4.0.2-8.fc4 updates-released 2.1 M
gcc i386 4.0.2-8.fc4 updates-released 2.8 M
gcc-c++ i386 4.0.2-8.fc4 updates-released 2.8 M
gcc-gfortran i386 4.0.2-8.fc4 updates-released 2.3 M
gcc-java i386 4.0.2-8.fc4 updates-released 2.3 M
libgcc i386 4.0.2-8.fc4 updates-released 60 k
libgcj i386 4.0.2-8.fc4 updates-released 7.6 M
libgcj-devel i386 4.0.2-8.fc4 updates-released 1.1 M
libgfortran i386 4.0.2-8.fc4 updates-released 152 k
libraw1394 i386 1.2.0-1.fc4 updates-released 37 k
libstdc++ i386 4.0.2-8.fc4 updates-released 307 k
libstdc++-devel i386 4.0.2-8.fc4 updates-released 9.0 M
libtool i386 1.5.16.multilib2-3 updates-released 656 k

Now that's alotta dependencies. And this doesn't even cover the development versions of the programs so that you could compile the CVS version of Cinelerra. Cinelerra now works! Untested however..

Note to self: create image of this pristine FC4 root filesystem BEFORE it gets gobbed up!

Now let's watch the movie!

system reconfig, #2

Woops with Ghost
OK. A minor foul up in the steps from the last post. Seems that Ghosting the utility partition is not working as expected. Norton Ghost created a total new partition at the end of the XP partition on the 80 gigger. So, I went ahead and deleted it, as this 2GB partition eats into my Linux root partition. I never used the utility partition anyway, but I thought that Ghost would have correctly selected the 100MB partition I had chosen. Oh well. I'm not that concerned.

FDISK is for F*@K!
Another foul up was trying to use a Windows 98 boot disk and the classic fdisk program to both create the XP/Linux partitions and mark one as active. Word to the wise: DON'T USE FDISK! It has an annoying habit of "Verifying Drive Integrity" that takes FOREVER. So, I just decided to reboot and use my old 40GB XP system to carve up the drive and mark the 30GB partition as active. Saved a good deal of time there with that brainstorm. Phffflt!

Going SLEOOWLY.
Applying the XP image to the partition designated for it went super smooth, but the Dell has this ugly habit of taking forever to start up when I have the power to some disks plugged in and some not, but still connected to my Sil680 IDE stripe set RAID card. Frustrating, as it adds two minutes at the front end of every boot cycle. Argh. But now I have my XP system back up and running on my new 80GB drive! Hooray!

Core 4 from Scratch..with a bad CD!
I've decided that installing Fedora Core 4 from disks will make life cleaner. I could apply a partimage of my FC3 build or take the time to reimage the FC4 system, but I just want this to be over, so I am now in the middle of reinstalling FC4. The install has been crapping out on the Open Office RPMs. Seems there is a bad spot on the CD for them, so I deselected those packages for install. Only took me three FC4 installations and an hour to realize that I should do this. Oh, I'm just not very smart. :(

OK! What's left? Finishing the FC4 install and the stripe set.

system reconfig, #1

New Memory
Earlier this week, I had called TechDepot on the mistaken assumption that the memory speed drop to 333Mhz was due to the wrong Kingston memory being sent. So the Depot sent me another pair (at an unhealthy $187 per). So, after battling during the week with a conflict between my older Corsair (non-ECC/400DDR) and my new Kingston memory (ECC/400DDR), I decided to throw in the towel and use the older DDR in my audio editing rig and use both Kingston clips in the Dell video box. Installation was a snap, as all four Kingston clips were the same. Now I am running at full 400Mhz/Dual DDR/ECC POWER! Nothing like an upgrade!

Move the System Drives
Right now, the steps to moving the system drives are quite a few:
1) boot with Ghost disk
2) save an image of my XP system drive
3) save an image of my XP utility partition
4) sweep clean the 80GB drive I have in the system by backing my Fedora Core 3 partimage files to USB drive
5) remove 40GB drive
6) reformat and repartition the 80GB for two systems (XP and Linux)
7) apply recent XP image to XP partition
8) reinstall or apply Linux image to Linux partition

Right now, I am waiting for Ghost to finish creating the XP image. Talk back later.

Friday, August 18, 2006

system reconfiguration

All right. The time has come. This weekend, I intend to reconfigure my Cinelerra video rig for the upcoming task of editing surprise birthday, Stockholm and Paris videos. This will entail:
  • 2GBs of 400Mhz ECC, Dual DDR
  • migration of system drives from older 40GB to newer 80GB drives
  • 2x120GB stripe set

I have a lot of work ahead of me. Ugh. So let it begin.

Tuesday, May 09, 2006

chroma key test

Seems my camera does a better job with blue colors than green colors for chroma blue/green screen fun. Here's an example of using a blue pillow case for a chroma key background. Kinda came out well, minus the blue border around my hair!
http://content.serveftp.net/video/chromaTest2.mpg
3.3MB

Sunday, April 23, 2006

Cinelerra compile problem solved, more or less..

To follow up on this thread from a few weeks back, through a fair bit of reading and educated(?) guessing, I was able to get around this problem that stymied me.

One of the guys on the Cinelerra boards did clue me into the fact that the aclocal.m4 file was much too short, as it should be a superset of /usr/share/aclocal/libtool.m4. So that gave me a start. After reading a bit of doc and problem postings in Google regarding aclocal.m4, I saw that the file listing of hvirtual/m4 was about half as long as the list of *.m4 files in /usr/share/aclocal. So, I edited autogen.sh to point aclocal to build aclocal.m4 from the files in /usr/share/aclocal, rather than using the m4 directory under hvirtual. After running autogen, I then had a complete aclocal.m4 file with a libtool section. I did not have the libtool section in the file before building from /usr/share/aclocal.

I don't know what side effects this has, but the CVS compiled and I can playback and render video from my saved projects, so I assume this is a valid solution. The only side effect I've noticed so far is that I get a few more ALSA underruns like this:
AudioALSA::write_buffer underrun

ps - here's some doc I found that may help someone in a similar predicament:
re automake:
http://www.delorie.com/gnu/docs/automake/automake.html#SEC_Top
re libtool:
http://people.debian.org/~keybuk/libtool-updating.html

Saturday, April 15, 2006

created iTunes-ready movie from MPG!

Very happy to say that I was able to create an iTunes/iPod-ready movie from an ffmpeg produced mpeg1video! Hoohah! On my second FC4 box that has all the codec libraries, I was able to use the following ffmpeg string to get the iTunes file to work:
ffmpeg -i sourceMpeg -b videobitrate -ab audiobitrate -f mov -vcodec mpeg4 -acodec aac output.mov

So, now my workflow is looking like this:
1) bring in HDV footage
2) run mpeg3toc (or rename files to .MPG)
3) edit video (make sure no hanging or truncated video tracks are there!)
4) render audio file as WAV
5) render video file as MPG and add a -i for the audio
6) outside of Cinelerra, convert to iTunes with the above command
7) convert to DVD with script

Not bad. I'm pooped. Goodnight.

Thursday, April 13, 2006

audio/video sync problems..first complete editing job completed

After struggling with video/audio synchronization issues, I've finally got 56 minutes of passable video. Due to my own stupidity (the fact that my Audio-Technica AT822 stereo mic was attached to, but not plugged in to the video cam) and that the audio coming from the cam is pretty lousy, I needed to use my backup recording device. So I had to sync the audio from my Creative Labs Nomad. Cinelerra is good with audio, but I had to resample to 48000hz to match the audio sampling rate of the original video.

I first tried to match the Nomad audio with the video, but that became an exercise in frustration. I still had the camera audio, so matching the Nomad audio to the cam's audio was MUCH easier than matching up to the video. As well, this method allowed me to play all four audio tracks (2 stereo from Nomad/2 stereo from cam) back at the same time. Monitoring this, if I heard bouncback echo, I knew my synchronization was off. So rule to remember, if you have a couple sources of audio, match to the audio, not what's on the screen, cause you'll be pulling out all your hair trying to match to the vid.

Glad this one is in the bag. It is truly my first complete video created in Cinelerra. Nothing special within, just fades/titles and a little time clock at the end. It was reduced from the original HDV to 320x180, 160kbps sound (247MB). Also, the video quality pretty much sucks because I didn't whitebalance or even focus for that matter. It was inevitable, as I was rushing to get setup for the three measly hours we had in the rehearsal space. Ah well.
http://content.serveftp.net/video/20060406.mpg

Update 2/25/08
Here is a helpful article for anyone needing to troubleshoot audio/video sync problems in Cinelerra:
/2007/05/nudge-avidemux2-and-reminder-about.html

Sunday, April 09, 2006

Unsuccessful compile from CVS source

Today was a frustrating one. Tried to get the latest CVS build of Cinelerra (cvs.cinelerra.org) compiled on my Dell 400SC running Fedora Core 4. No go. I'm not the best at compiling beyond "configure, make, make install", so the process of autogen, aclocal and autoreconf were new to me.

A couple things learned:
- running aclocal creates an aclocal.m4 file. In order to make sure you are pointing to the correct macros within the build files, you need to make sure to point to m4 using:
aclocal -I m4

- the aclocal.m4 file should be larger than /usr/share/aclocal/libtool.m4, because aclocal.m4 is a superset of /usr/share/aclocal/libtool.m4.

If you have trouble compiling Cinelerra, try running autoreconf -i --force.

That's about it for tonight. I'm off to see if my 48Khz audio will match to my 48Khz video! Yeehoo!

talk to you later!

Sunday, March 26, 2006

Burned a DVD using Linux! Success!!

Such small things make us happy. Well, this was not a small thing, as I've been wanting to use Linux to burn a DVD of my custom videos created from Cinelerra for a loooong time. Up until now, I've copped out and just rebooted to XP to get the dirty work done. This was the first time I really sat down and muddled through the arcane commands to get a DVD burned. In fact, not only did I get a DVD-R burned, but I also figured out how to get a DVD-RW formatted and a DVD image burned to that! F'n A!!

I will work on a doc later, but here are the quick and dirty steps to burning a DVD on a Fedora Core 4 system:

REFERENCES
http://heroinewarrior.com/cinelerra/cinelerra.html#MAKING%20A%20DVD
http://dvd.chevelless230.com/
http://www.kerklied.com/adrie/presentatiedvdmakeneng.html
http://users.dslextreme.com/~craig.lawson/linux_notes/video.html#Writing_to_DVD_media
growisofs syntax

PREREQUISITES
I needed ifogen, so get the latest copy of dvdrtools found here:
http://www.arklinux.org/projects/dvdrtools

CREATE DVD-READY MPEG
[root@computer 20060319]# ffmpeg -i test.m2v -i test.wav -target dvd output.mpg

TEST DVD-READY MPEG
[root@computer 20060319]# mplayer output.mpg

MAKE THE DIRECTORY TO PUT DVD IMAGE IN
[root@computer 20060319]# mkdir -p dvd/VIDEO_TS

CREATE DVD READY FILES (VOB/BUF/IFO)
[root@computer 20060319]# ifogen output.mpg -o dvd

VIEW DIRECTORY
[root@computer 20060319]# ll dvd/VIDEO_TS/
total 34444
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.BUP
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.IFO
-rw-r--r-- 1 root root 35205120 Mar 26 14:58 VTS_01_1.VOB

CREATE TABLE OF CONTENTS
[root@computer 20060319]# ifogen -T -o dvd
INFO: dvdauthor creating table of contents
scanning dvd/VIDEO_TS/VTS_01_0.IFO

VIEW DIRECTORY
[root@computer 20060319]# ll dvd/VIDEO_TS/
total 34460
-rw-r--r-- 1 root root 6144 Mar 26 14:59 VIDEO_TS.BUP
-rw-r--r-- 1 root root 6144 Mar 26 14:59 VIDEO_TS.IFO
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.BUP
-rw-r--r-- 1 root root 12288 Mar 26 14:58 VTS_01_0.IFO
-rw-r--r-- 1 root root 35205120 Mar 26 14:58 VTS_01_1.VOB

CREATE THE DVD IMAGE
[root@computer 20060319]# mkisofs -dvd-video -udf -o dvd.iso dvd/

USE -scanbus SWITCH TO VERIFY DEVICE NAME
[root@computer 20060319]# dvdrecord -scanbus

THIS COMMAND DID NOT WORK WITH MY ATA NEC DRIVE LABELED 1,0,0
[root@computer 20060319]# dvdrecord -ignsize -dao -v dev=1,0,0 fs=67108864 dvd.iso

THIS COMMAND CHECKS YOUR DRIVE
[root@computer 20060319]# cdrecord -dev=ATA:1,0,0 driveropts=help -checkdrive

THIS COMMAND BURNS A DVD-R WITH THE DEVICE LABELED ATA:1,0,0
[root@computer 20060319]# dvdrecord -ignsize -dao -v dev=ATA:1,0,0 fs=67108864 dvd.iso

THIS COMMAND FORMATS A DVD-RW
[root@computer 20060319]# dvd+rw-format -f /dev/hdc

THIS COMMAND BURNS A DVD ISO IMAGE TO A REWRITEABLE DVD DISC
[root@computer 20060319]# growisofs -Z /dev/hdc=dvd.iso

Until next time..good burning to you!

5/30/07 update: Here's a great article on the many types of DVDs and how to use them in Linux:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/creating-dvds.html

Saturday, March 25, 2006

motion stabilization effect experiment

Update 2009/03/17
I finally put together a motion stabilization tutorial. Hopefully, it helps folks who are as confused as I using the thing.
*** end update ***

Tonight, I used Cinelerra's motion tracker to stabilize a section of shakey video. The source was some sunset footage taken in high wind. The wind was so blustery that the camera and tripod were shaking. Cinelerra's motion stabilization saved the day, though.

Here is the video before motion stabilization
Here is the video after motion stabilization applied
(both vids ~7MB)

Pretty good, no?

Update:
Here's the next in the series:
/2006/10/motion-experiment-part-ii.html

Sunday, March 12, 2006

a foul up

Last night, I encoded my first full length video podcast as a Quicktime from Cinelerra. I brought it into iTunes and used the 'Convert Selection for iPod' feature and it spent all night (from 11pm to 11am) converting. The .MOV file specs were pretty heavy:
- 50 minutes long
- 720x404 resolution
- 524MB

I used a PIII, 1.5Ghz laptop w/512MB of memory to do the conversion, hence the slowness. Once the file was converted, both audio and video tracks played back! Hooray! This was a lot better than my previous result wherein the audio was gone. So, I found the new .M4V file on the filesystem and looked at the metadata in the properties. I saw that there was no metadata, so not thinking that it could have a deleterious effect on the file, I added the missing metadata to the file as it existed on XP. Bad, nary I say REAL bad idea!

After adding the metadata to the file, the .M4V would no longer play in iTunes (6.0.4) or Quicktime. To put it politely..RATS!! I tried removing the metadata, but no go..the file still would not play. So, the twelve hours I spent converting the video was all for naught, cause now I have to do it all again. Wunnerful.

Let me be clear though..
1) you CAN edit the metadata for an iTunes video podcast within iTunes
2) you CANNOT edit the metadata for an iTunes video podcast in the filesystem. This will break the audio for the podcast.

This being the case, I decided to move my website over to my audio workstation in order to allow me to use my main video editing workstation to do the iTunes conversion. Screw the portable..conversion took way too long there. Copying the website from the video editing box to the audio workstation would allow me to use either of my primary machines to serve web content depending on which one I was using at the time. Both are dual boot setups, XP or Win2K and Fedora Core 4, so at least now I have flexibility. Of course, I wish it was under different circumstances that I make that improvement to my workstation setup. Argh.

So now the file is converting on my P4, 3.2Ghz, 1GB box. I'm hoping to get at least a 3x improvement in conversion time. So, I'm looking at 5pm today for the file to be done. 1-5pm..4hrs. Yeesh. I need a faster box..ain't it always the case!

UPDATE: Good news! It only took two hours to convert the file..sweet! I think the remarkable improvement may be bolstered by the MPEG compression available in my All-in-Wonder 9800 Pro video card. I should switch video cards and try this to verify..

Other things of note I'd like to get done:
- setup RSS feed for newly created video
- update Beginner's Guide for bitrate calculation/QT M4V metadata warning
- change rendering partition to ext2 (non-journaling file system)
- eventually get RAID0 back up and running for rendering partition

At least my cam should be coming back from the shop this week!

Saturday, March 11, 2006

problem rendering files with custom resolutions

Last night, I exported an MPG stream and put it into iTunes. The MPG in iTunes plays just fine. When I converted it using iTunes, though, the resulting file had no sound. What is going on here? If I use the Cinelerra standard YUV4MPEG pipe, with -target DVD, the video renders fine and comes back into Cinelerra in its' entirety. But when I use a custom resolution size (480x320), the video track gets truncated shorter than the audio track when I reimport the rendered MPEG back into Cinelerra. So something is definetly wrong about how Cinelerra is rendering files with custom resolutions. I guess I'm going to have to enter a bug because no one seems to be responding to my posts on cvs.cinelerra.org.

Tonight, I'm rendering the file as MOV and hopefully that will solve my issues. Of course, this is all extra work, because my original intent is to do all of this within Cinelerra, instead of having to go out.

More evidence of strangeness is that even though xine and mplayer played the MPG, ffplay played the video stream, but there was no audio. That may be telling me something.

Friday, March 10, 2006

optimal drive/partition setup for Cinelerra

To keep it simple, I would use five drives and do four logical partitions. This would allow for all filesystems to be on separate drive spindles:
- one system drive for /root, /usr, etc - ext3
- one storage drive for source files - ext3
- one working drive for index files in .bcast - ext2
- two working drives in RAID0 (stripe set) for destination render - ext2

If you only have four drives, just keep the source files on the system drive. I would think the index files would be the most used/most reads. I have to test this use "iostat -x " to monitor read/write stats of each physical device. I assume the render partition would be the heaviest hit, so make that your RAID stripe. You can do software RAID, but as a person who runs a decent sized HP web server farm, we've always depended on hardware RAID because CPU cycles are offloaded to the RAID card itself, rather than the operating system using CPU cycles for software RAID. Since rendering is pretty much all CPU, except for the input/index file reads and the destination render file writes, it makes sense that software RAID would tend to slow your rendering down.

Finally, ext2 is very important..no journaling necessary for the working drives..just storage.

When I used Adobe Premiere, I noticed that my ATI All In Wonder actually sped up the MPEG2 render times by 50%. However, I haven't been able to get the fglrx driver to work w/my dual monitor setup on FC4. Fglrx works with one monitor, but dammit, there's no way I'm going back to just one monitor! But I will need to test out whether or not the fglrx driver speeds rendering for Cinelerra as it does Premiere.

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