Wednesday, November 29, 2006

very simple interpolate effect experiment

I wanted to use the interpolate effect to mimic motion, or at least generate a smooth flow between static images. I thought I might be able to use this effect for video overlays and such.

For the experiment, I used four png images, each with a green dot near the center of each image. For each image, I moved the dot a bit so that the arrangement of the four images on the Cinelerra timeline would show a circle of green dots when played back. First, I imported each still frame into a Cinelerra project formatted to 30fps and 320x180. Then, I stretched each png to the length of 30 frames using the "align cursor on frames" option and then re-added the first png image to the end of the timeline in order to complete the circle of dots. Finally, I added the interpolate effect with an "input frames per second" value of 1.

Here is the resultant video with no interpolate effect (17Kb).

Here is the video with the interpolate effect applied (38Kb).

It does mimic movement, but is not very interesting just yet. I will try to add motion blurs to enhance this.

Friday, November 10, 2006

cam compatible HDV edit chain, part II (short)

I posted a more detailed version of this two posts ago (http://crazedmuleproductions.blogspot.com/2006_10_01_archive.html), but I thought I'd reiterate it in a shorter format:
1) from Cinelerra, export video using YUV4MPEG using mpeg2enc (.m2v) compression scheme with special params:
mpeg2enc --verbose 0 --aspect 3 --format 3 --frame-rate 4 --video-bitrate 18300 --nonvideo-bitrate 384 --interlace-mode 0 --force-b-b-p --video-buffer 448 --video-norm n --keep-hf --no-constraints --sequence-header-every-gop --min-gop-size 6 --max-gop-size 6 -o %
2) from Cinelerra, export audio using mpeg audio, layer II (384Kbps)
3) multiplex audio and video streams to MPEGPS (Program Stream) format using mplex:
mplex -f 3 -b 2000 video.m2v audio.m2a -o output.ps
4) convert .ps to .ts, MPEGTS (Transport Stream) format using VLC
5) export to cam, consider using 10sec blank leader

Update 5/17/2009
Note that if you bring the video into Cinelerra and the thumbnail is green, this means that the first frame of the video is not a keyframe. This is a problem with VLC. You can avoid this problem by using this ffmpeg command in place of Step 4 above:
ffmpeg -y -i OUTPUT.ps -acodec copy -f mpegts -qscale 1 OUTPUT.m2t
*** end update ***

Update 3/14/2008
Once the video is converted, you may then output to the camera using test-mpeg2 from libiec61883:
/2006/10/success-and-failure-in-land-of-dvhdv.html

Also, take note of a possible 2GB limit in libiec61883 uploading your content to the cam:
/2006/10/libiec61883-now-exports-files-greater.html
*** end update ***

Update 11/17/06
Last night, I found that doing performing other operations on your system like surfing the web or playing audio while running mplex or VLC convert may cause problems with the video as it uploads to the camera. So don't do anything while you convert your videos.

In my case, I was 28 minutes into an hour long video uploading to the cam when the import stopped. I no longer had uploading video displayed on the LCD screen of the cam. I only saw blue, the upload seemed to continue, but I got no final output. The solution was to remux the original streams using mplex and rebuild the MPEGTS using VLC. The important point being that one of these two processes is very sensitive to fluctuations in CPU or hard drive performance. So leave your PC alone while these processes are active.
*** end update ***

That's all she wrote for today. Enjoy!
the mule

Monday, October 30, 2006

motion experiment, part III

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 ***

The motion stabilizer is one of the most difficult effects to use in Cinelerra, as it has so many knobs and switches to figure out. It is very frustrating.

I had more luck this time with the motion effect, but it was still very hard to get working correctly. I kept playing around with different settings, but ended up using these:
- translation block around 1/6 of entire screen
- translation block more wide than high (400x150)
- track single frame
- stabilize subpixel
- zoom set to auto in compositor

Once I did get it working, I thought I did have a better feel for how the different parts interact. But the motion effect seems to be is something you have to spend a LOT of time with to get working correctly. It is still frustrating, though.

Here is the fruit of my labor:
http://content.serveftp.net/video/cinlover.mpg
Here was the original:
http://content.serveftp.net/video/cinlover2.mpg
both about 3MB

I definetly think the motion is better stabilized.

I will try to post a more detailed description of the steps I went through. Perhaps even a video, as motion stabilization is a real art. I wish it could be simplified in the software.

the mule

Sunday, October 29, 2006

rendering cam-compatible HDV MPEGTS files

I have been successful in exporting HDV back out to my cam. I haven't posted detailed output from the individual steps before, so here it is:

General Steps
1) export video from Cinelerra as mpeg2 using mpeg2enc
2) export audio from Cinelerra as mp3
3) mux in mplex
4) open MPEGPS in VLC and convert to TS.

Detail
1) export video from Cinelerra as mpeg2 using mpeg2enc:
mpeg2enc --verbose 0 --aspect 3 --format 3 --frame-rate 4 --video-bitrate 18300 --nonvideo-bitrate 384 --interlace-mode 0 --force-b-b-p --video-buffer 448 --video-norm n --keep-hf --no-constraints --sequence-header-every-gop --min-gop-size 6 --max-gop-size 6 -o /mnt/videos/20050721/20050721.m2v

2) export audio from Cinelerra as mp3:
--------------------------------------------
Input File : 'stdin' 48.0 kHz
Output File: '/mnt/videos/20050721/test.mp3'
384 kbps MPEG-1 Layer II j-stereo Psy model 1
[De-emph:Off Copyright:No Original:No CRC:Off]
[Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off]
ATH adjustment 0.000000
--------------------------------------------
encode_init: using tablenum 0 with sblimit 27
Hit end of audio data
Avg slots/frame = 1152.000; b/smp = 8.00; bitrate = 384.000 kbps


3) mux in mplex
[root@computer 20050721]# mplex -f 3 -b 2000 -o test.ps test.mp3 20050721.m2v
INFO: [mplex] mplex version 1.8.0 (2.2.4 $Date: 2005/08/28 17:50:54 $)
INFO: [mplex] File test.mp3 looks like an MPEG Audio stream.
INFO: [mplex] File 20050721.m2v looks like an MPEG Video stream.
INFO: [mplex] Found 1 audio streams and 1 video streams
INFO: [mplex] Selecting generic MPEG2 output profile
INFO: [mplex] Multiplexing video program stream!
INFO: [mplex] Scanning for header info: Audio stream c0 (test.mp3)
INFO: [mplex] MPEG AUDIO STREAM: c0
INFO: [mplex] Audio version : 1.0
INFO: [mplex] Layer : 2
INFO: [mplex] CRC checksums : no
INFO: [mplex] Bit rate : 49152 bytes/sec (384 kbit/sec)
INFO: [mplex] Frequency : 48000 Hz
INFO: [mplex] Mode : 0 stereo
INFO: [mplex] Mode extension : 0
INFO: [mplex] Copyright bit : 0 no copyright
INFO: [mplex] Original/Copy : 0 copy
INFO: [mplex] Emphasis : 0 none
INFO: [mplex] Scanning for header info: Video stream e0 (20050721.m2v)
INFO: [mplex] VIDEO STREAM: e0
INFO: [mplex] Frame width : 1280
INFO: [mplex] Frame height : 720
INFO: [mplex] Aspect ratio : 16:9 display
INFO: [mplex] Picture rate : 29.970 frames/sec
INFO: [mplex] Bit rate : 18300000 bits/sec
INFO: [mplex] Vbv buffer size : 229376 bytes
INFO: [mplex] CSPF : 0
INFO: [mplex] SYSTEMS/PROGRAM stream:
INFO: [mplex] rough-guess multiplexed stream data rate : 19077648
INFO: [mplex] Setting best-guess data rate.
INFO: [mplex] Run-in Sectors = 752 Video delay = 58123 Audio delay = 61126
INFO: [mplex] New sequence commences...
INFO: [mplex] Audio c0: buf= 0 frame=000000 sector=00000000
INFO: [mplex] Video e0: buf= 0 frame=000000 sector=00000000
INFO: [mplex] Scanned to end AU 39469
INFO: [mplex] STREAM e0 completed @ frame 39469.
INFO: [mplex] STREAM c0 completed @ frame 54874.
INFO: [mplex] Multiplex completion at SCR=118584775.
INFO: [mplex] Audio c0: buf= 2304 frame=054874 sector=00031342
INFO: [mplex] Video e0: buf= 0 frame=054843 sector=00509538
INFO: [mplex] AUDIO_STATISTICS: c0
INFO: [mplex] Audio stream length 63216000 bytes.
INFO: [mplex] Syncwords : 54875
INFO: [mplex] Frames : 54875 padded
INFO: [mplex] Frames : 0 unpadded
INFO: [mplex] BUFFERING min 18 Buf max 1169
INFO: [mplex] VIDEO_STATISTICS: e0
INFO: [mplex] Video Stream length: 1031417371 bytes
INFO: [mplex] Sequence headers: 6579
INFO: [mplex] Sequence ends : 1
INFO: [mplex] No. Pictures : 39470
INFO: [mplex] No. Groups : 6579
INFO: [mplex] No. I Frames : 6579 avg. size 58215 bytes
INFO: [mplex] No. P Frames : 32891 avg. size 19714 bytes
INFO: [mplex] No. B Frames : 0 avg. size 0 bytes
INFO: [mplex] Average bit-rate : 6264800 bits/sec
INFO: [mplex] Peak bit-rate : 9203600 bits/sec
INFO: [mplex] BUFFERING min 943996 Buf max 1944874
INFO: [mplex] MUX STATUS: no under-runs detected.
[root@computer 20050721]#



4) open MPEGPS in VLC and convert to MPEGTS.

Update 3/14/2008
Once the video is converted, you may then output to the camera using test-mpeg2 from libiec61883:

/2006/10/success-and-failure-in-land-of-dvhdv.html

Also, take note of a possible 2GB limit in libiec61883 uploading your content to the cam:
/2006/10/libiec61883-now-exports-files-greater.html

Saturday, October 28, 2006

libiec61883 now exports files greater than 2GB to cam!

As you may know, I've been successful in rendering HDV MPEGTS that works being output back to my cam. However, I stumbled upon the fact that libiec61883 cannot output files greater than 2GB. Well, I rolled back my operating system to an earlier image, rebuild libiec61883 with the -D_FILE_OFFSET_BITS=64 DEPS param in examples/Makefile and now I can send data greater than 2GB using the command
[scf@localhost ~]# test-mpeg2 -t 0 file.m2t
where 0 is the physical id of the cam as specified by gscanbus

I have found that using the incorrect physical id will result in the following error message:
[scf@localhost ~]# test-mpeg2 -t 1 file.m2t libiec61883 warning: No plugs exist on either node; using default broadcast channel 63.

However, the camera will still display the incoming video. If the physical id is correctly specified, you should see no errors and the "Starting to transmit.." message only:
[scf@localhost ~]# test-mpeg2 -t 0 file.m2t
Starting to transmit

I have no idea why this fixed the problem, because I used the same steps as before. Just glad it works.

Saturday, October 21, 2006

basic OpenGL vs XV performance stats

Thought I'd share some Cinelerra performance stats using OpenGL versus non-OpenGL (XV) display drivers. I used two tracks of identical length (32s), but different content.

OpenGL
one 32s 720P track: 20fps
two 32s 720P tracks, both play enabled, no fade on top track: 2.97fps
two 32s 720P tracks, both play enabled, 50% fade on top track: 3.04fps

Stopped then restarted Cinelerra and performed next test.

XV
one 32s 720P track: 10.6fps
two 32s 720P tracks, both play enabled, no fade on top track: 2.2fps
two 32s 720P tracks, both play enabled, 50% fade on top track: 2.18fps

Not fabulous performance for using > 1 track, but still slight improvement over XV.

Thursday, October 19, 2006

motion experiment, part II

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 ***

I was able to get a better result from the video I made a while back. I realized I did not use the "Previous Frame Same Block" option originally. This made a huge difference. As I didn't have much time to fuss with it, I lowered the translation search steps to 128 as you suggest.

Here are my results with comparison of before, after and zoom. The video is very compressed, but you can see that the zoom doesn't degrade too badly, as my source is HDV, which is something you'd be interested in seeing:
http://content.serveftp.net/video/motionexercise.m2v
7MB

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

HDV MPEG2 transport stream file sizes/render rates

The data rate of the 720P MPEG2-TS files output from my cam is about 108.95MB/min or 1.82MB/s. Here is a table of video length-to-size conversions.

duration size

12m 1.32GB
15m 1.65GB
18m35s 2.07GB
19m12s 2.12GB
20m01s 2.18GB
34m 3.70GB
Exporting 720P HDV from Cinelerra takes two processes:
1) render the video
2) render the audio

Here are some rendering times using mpeg2enc and mpeg layer 2 audio compression:

duration mpeg2enc render rate
63m 310m 4.92min per min of video

duration mp2 render rate
63m 6m 0.09min per min of audio

Mplex takes about 7 minutes to mux about an hour of audio and video.

Monday, October 16, 2006

hard work is paying off / HDV workflow

OK! I've got the latest video up on iTunes and now I just need to edit the XML for it. Editing the damn XML always takes too long. And of course, I want to get the track list right with the correct track times and witty comments. Ufff. OK! So the track list is done and now to send the boys the email for the latest video! Hurrah!

More for my benefit than anyone elses, here is my HDV workflow using Cinelerra:
1) import video
2) edit video
3) for multiple segments, make sure you set "align to frames" and audio and video segments end at the exact same time.
4) for HD output, render using mpeg2enc settings
5) for DVD output, render using ffmpeg -target DVD from Cinelerra, something like this:
ffmpeg -f yuv4mpegpipe -i - -y -i /mnt/videos/20050721/20050721.wav -target dvd %
6) for iPod output, render using ffmpeg -target DVD, then output to mpeg4 video/aac audio mov container:
ffmpeg -i inputdvd.mpg -f mov -vcodec mpeg4 -qscale 7 -s 320x180 -r 29.97 -aspect 16:9 -acodec aac -ac 2 -ab 128 output.mov
7) import .mov to XP iTunes
8) upload .mov to website
9) edit RSS XML
10) final test in iTunes

trials of Cinelerra rendering, deja vu all over again

Well, four hours of overnight rendering yields a video I can't playback. I get this error:
int YUVStream::read_header(): y4m_read_stream_header() failed: bad header magic
int YUVStream::open_read(char*): Bad YUV4MPEG2 header: parameter out of range


Now what the F is wrong? Is it a problem with:
- my rendering options I chose?
- this version of ffmpeg in general?
- my project?

I wasted a number of hours on the first two possibilities. I finally saw two issues in my project:
1) for some reason, probably my big fat fingers, an audio transition was placed right at the beginning of the project (Timecode 00:00:00). I deleted this.
2) I noticed that for joins between separate videos on the same a/v tracks, the joins between the audio and video segments did not end at the exact same place:
http://content.serveftp.net/video/avmisaligned.png

To stop this, I went to the end of each segment, zoomed in all the way, and made sure that each video and audio segment ended at the exact same time. If they didn't end at the exact same time, I clipped off a bit of whatever audio or video track is dangling by using the mark in/mark out indicators and doing a "cut". After doing the cut, the segments aligned perfectly.
Even with these changes, however, I still get a similar version of my original error when I load the project:
int YUVStream::read_header(): y4m_read_stream_header() failed: bad stream or frame header
int YUVStream::open_read(char*): Bad YUV4MPEG2 header: parameter out of range
However, I can output it to a usable format, so I don't mind the rather ugly error messages. You'd thought I would have known better by now. ARGH!

Along the way tonight, I've been trying to help the Cinelerra CVS community debug a couple of errors:
1) the intermittent project hangs
2) MS MPEG4 render crashes

I synchronized my hvirtual directory twice and recompiled, once for v932 for the project hang problem and then v940 for the MS MPEG4 render crashes. Both took a couple interations, but it seems like the programmers have the problems licked. That's good. We've been pushing them pretty hard lately.

So, finally around 11pm, I've rendered the video to a usable DVD mpg. Now it's time to render once more; this time to iPod format. It looks like FFMPEG has removed the "-b" bitrate switch in favor of some quality scale switch, "-qscale". The higher the qscale, the lower the quality. To create videos with the same quality as the original, you can use the "-sameq" switch. Otherwise, a qscale of 4 will yield a decent quality video with some significant compression. I'd use h264, but I haven't been able to install it successfully. I may try VLC..

Update 2009/06/09
My understanding of the "-sameq" switch was a little naive. Robert Swain enlightens here:
http://rob.opendot.cl/index.php/2009/05/01/bit-rate-file-size-quality-misunderstandings/

You'll probably need to read it a couple of times like I did.
:)
*** end update ***

Saturday, October 14, 2006

outstanding bugs/foul ups/frustration

There were a number of outstanding bugs that some of the cvs.cinelerra.org programmers addressed. One of them was that Cinelerra keeps hanging when I open up projects. It seems to happen on projects I've built before 2.1 that I've saved as 2.1. So I've told the programmers I will test their work once they apply the patches. I drank too much coffee in the afternoon and deleted a number of files that I wish I hadn't off of my FAT partition. Stupid ass. Luckily, I have those on a second drive, so I should be OK. Another thing to do: MAKE DVD BACKUPs OF PARTITION IMAGES, PRONTO!! Ugh. What a hassle. This new rig is NOT making my life any easier!!

Tonight, I finally got to edit some video..the last band video. Amazing! It has been about a month and a half since I started the whole OpenGL/export HDV to tape excursion and while I've learned a lot, it has just been frustrating as hell. The state of HDV on Linux is pretty rough. I'm lucky I've made it this far and I wouldn't have without the help of the community, both cvs.cinelerra.org and linux1394.org. I'd like to finish this edit job so that I can spend some time with my girlfriend before she leaves me. As I'm editing this video, I'm a little upset by the quality: the crappy automatic gain control on the cam makes dark shots look grainy and grey and the focus fades in and out. How good of a video production will I make if the camera work sucks? Yarg. At least I've finished the edits. Off to render!

Friday, October 13, 2006

editing rig is 95% there

My editing rig is 95% there, outside of not having the ability to render using h264. Also, I'm only able to export files greater than 2GB to tape. Apparently, this is a typical problem that should be resolved by using some compiler flags (-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE). However, the compiler flags did not work, so I was just reading up on this thread: http://www.google.com/search?hl=en&q=reading+files+larger+than+2gb+cflags+D_LARGEFILE_SOURCE

that states that my system needs to support the following calls: mmap64, sendfile64, sendfilev64, mkstemp64. I will also try to pass --enable-lfs to configure.

Thursday, October 12, 2006

VLC install

If cinelerra source dependencies are already installed, VLC requires the following files to be compiled:
- ffmpeg-devel
- fribidi
- libdvbpsi
- libiec61883/libraw1394
- libmad
- libtheora
- mpeg2dec
- twolame
- wxGTK (special build: buildgtk)
- gettext-devel

And then of course, VLC itself (special build: ./bootstrap)

Download the 77MB source files from http://www.videolan.org

Wednesday, October 11, 2006

exporting HD content to the cam: IT IS ALIIIIVE!! ALIVE!!

After a month of testing and experimentation with many inter-OS softwares, exporting HD content to my camera is working! YAHOO!! The greatest part is..I am Microsoft FREE!

Most of my work was based off of this original thread:
http://www.dvinfo.net/conf/archive/index.php/t-19007.html

But a number of steps (ffmpeg/DVHSCap) did not work for me.

Here are the steps I used to get HD content from Cinelerra back to my cam in full resolution, HD 720P format:

1) install the latest 2.6.18 kernel according to specs on http://www.linux1394.org
2) you'll need the latest libiec61883 and libraw1394 libraries from the same place . I needed to manually tweak the ./configure procedure for libiec61883 with the following environment variable:
PKG_CONFIG_PATH=/usr/local/lib/pkconfig
Another caveat to this step is that I needed to remove libraw1394 first, which was a nightmare because of all its dependencies. I created a yum install script to reinstall everything after this was complete.
3) you'll need to make a change to tsbuffer.c and recompile libiec61883 (don't have it now..email me if you need it).
4) you'll need to recompile mpeg2enc to allow for bitrates larger than 14000. This is referenced in the thread from way back when:
http://www.dvinfo.net/conf/archive/index.php/t-19007.html
--------------------
A kludgy hack allowed me to get bit rates higher than 15Mbs in mpeg2enc

I removed the following lines from conform.cc
if (bit_rate> 1.0e6 * maxval->bit_rate)
mjpeg_error_exit1("Bit rate is greater than permitted in specified Level");
---------------------
5) here are the mpeg2enc switches that were successful for me:
mpeg2enc --verbose 0 --aspect 3 --format 3 --frame-rate 4 --video-bitrate 18300 --nonvideo-bitrate 384 --interlace-mode 0 --force-b-b-p --video-buffer 448 --video-norm n --keep-hf --no-constraints --sequence-header-every-gop --min-gop-size 6 --max-gop-size 6 -o mpeg2.mpv
6) mplex params:
mplex -f 3 -b 2000 -o programstream.ps audio.mp2 mpeg2.mpv
7) Use VLC to convert the file to a transport stream. By the way, the VLC is a hellish snake pit of install dependencies. Go to http://www.videolan.org to download the latest source.

Here are the instructions for VLC from Paul St. Denis' original steps (http://www.celt.sunysb.edu/paul/mpeg2enc_HDTV.zip):
------------------
Start VLC, from the "file" menu select "open file", click on the "Browse..." button and find "programstream.ps", check on the "advanced output" check box and then click on the "Settings.." button. Make sure the "file" radio button is picked click on the "Browse..." button save the file on your desktop as "transport.ts".

Make sure that the "Encapsulation Method" is MPEG TS, leave everything else blank. Click OK, which brings you back to the other screen click OK again.
------------------

Yes, it's a lot of work. But to be Microsoft free is a great feeling.

Update: as of this writing (10/17), I'm only able to upload less than 2GB of video. For my 720P video cam, this is about 19.7 minutes of video. I am working with the linux1394 community to resolve this.

Saturday, October 07, 2006

success and failure exporting/importing video to/from camera

I should say that those notes are for HDV content, but some of them are
applicable for regular DV.

Today I spent some time with folks on the Cinelerra IRC channel trying to hook up my HDV cam for import and export functions. I used a combination of three programs: dvgrab to import/export DV content and test-mpeg2 (from libiec61883 source) or mpg1394grab for HDV export/import.

"mpg1394grab" (sorry for the typo) is used to capture IEC61883 streams to MPEG2TS format. Here is some more detail about it:
http://www.kinodv.org/article/view/54/1/11

The results were as following:

            import tape  import live stream  export file to cam
dvgrab not tested works does not work
test-mpeg2 works works sometimes does not work
mpg1394grab works works n/a

Notes:
mpg1394grab works better for grabbing HDV.
test-mpeg2 import command is "test-mpeg2 -r [node] [file]"
test-mpeg2 export command is "test-mpeg2 -t [node] [file]"

On my Fedora Core 4 system, I have a /dev/raw/raw1394 instead of a /dev/raw1394. I don't know why.

Make sure there is a symbolic link to /dev/raw1394:
ln -s /dev/raw/raw1394 /dev/raw1394

Make sure the driver is chmod 666:
chmod 666 /dev/raw/raw1394

To compile mpg1394grab, execute this:
gcc -lraw1394 mpg1394grab.c -o mpg1394grab

My camera is the JVCHD10U. In the onboard menu system of the camera, you can change the iLink Out setting to either SW (software) or AUTO (automatic). The JVC must be set to AUTO for Linux to recognize the cam. This is different than XP, which requires the camera setting to be SW.

For dvgrab, the camera must be set to DV/DV
For mpg1394grab and test-mpeg2, the camera must be set to MPEG2/HD

seeing my cam in Linux

The troubleshooting steps here helped me out quite a bit. In short:
1) make sure you have libraw1394
2) make sure there is a link to /dev/raw1394
3) download the latest kernel (http://www.mjmwired.net/resources/mjm-kernel-fc4.html
4) make sure to select Code Maturity Options (Prompt for developement drivers) and enable IEEE 1394, OHCI 1394, and Raw 1394 support options
5) make sure new kernel sees firewire interfaces (dmesg grep 1394)
5) load the modules (modprobe ohci1394 (the firewire card)/modprobe raw1394 (interface to it))
6) check that the modoules are there (lsmod)
7) use testlibraw
8) use gscanbus

This should do it!

Wednesday, October 04, 2006

trying to get HDV content back out to my cam..

Lest ye think I have been sitting on my very small, small laurels, I want all the open source, JVC HD10U fans out there know that I am still working the problem. However, I have almost given up as a result of my many trials and tribulations over the past five days with MPEGTS file formats and the JVC cam.

My journey started here:
http://www.dvinfo.net/conf/archive/index.php/t-19007.html

I replicated all of the steps; however, the last step I cannot reproduce because I don't have an Apple Mac. I've tried exporting the .ts file to the cam using DVHSTool, CapDVHS and the utility that comes with the cam, but all of them give me errors. I've tested against many different versions of outputted files with little success. My last hope is that I can get a virtual Mac going using Xen, download DVHSCap to it and then try DVHSCap on the file.

say a prayer..cross your fingers..

Sunday, October 01, 2006

JVC HD10U specs

Really good doc on the MPEG format utilized by the JVC HD10U:
http://www.gyhduser.com/article.php?filename=What-is-HDV-

Sunday, September 24, 2006

title sequence for birthday video complete..

Between writing doc to help myself and others on the Cinelerra list, I've finally produced some usable output. Check out my birthday video intro titles:
1.5MB

This is an mpeg4 quicktime vid. Mplayer/Xine should play it fine.

zoomed title

Well, this took way too long to do. Again with projector automation and manipulation of bezier curves. But, I figured I'd try it anyway. Nice little zoomed title
670K

Thursday, September 21, 2006

first split screen..

I used the projector and camera automation to do my first split screen today:
split.mpg
670K

Wednesday, September 20, 2006

digging that Batch Render capability!

Since I wrote that document regarding Cinelerra's QT for Linux compatibility, Cin's batch rendering came in quite handy.

Things to watch out for:
1) make sure your output path is not only the directory, but the destination filename as well
2) clicking New will add that render to the list. Now you can highlight the batch item and tweak its settings (file format/audio/video/batch enabling) if need be.
3) make sure to Save List to save out the batch. Inevitably, you'll make a mistake the first time you setup a batch. So it's important to be able to reload it if Cinelerra crashes or you've forgotten something.




Here is an updated discussion of the batch render feature:
http://crazedmuleproductions.blogspot.com/2010/01/batch-render-redux.html

the mule

Monday, September 18, 2006

Quicktime for Linux compatibility chart

I spent Sunday afternoon and evening creating this compatibility chart for QT for Linux formatted files exported from Cinelerra. There are many compression schemes that can be used within this file format and I did not have a list to tell me what scheme works and what doesn't in Cinelerra and some default media players like Mplayer, Quicktime for Win and Windows Media Player 10. Hence the guide.

Enjoy!
html format
open office calc format

Friday, September 15, 2006

upgraded video workstation has arrived!

My video rig is finally ready to go! After one month of hardware and software upgrades, I'm ready to start editing. Here are the upgrades I did:
- from 1GB non-ECC, Dual DDR to 2GB ECC Dual DDR mem
- from a system and a content drive to a system and RAID0 content drive
- from a 128MB ATI video card to a 512MB NVidia video card
- from non-OpenGL to OpenGL editing software

Update (9/19): converted my old 80GB dual-boot XP/Core 4 system drive to shiny new 250GB SATA w/16MB cache! Took about seven hours to backup the filesystems, partition the new drive and restore, with a few lessons learned along the way. Here's how this went:
http://cacasodo.blogspot.com/2006/09/replacing-old-dual-boot-system-drive.html

So, we're ready to go with da editing! Hooray!!

Install notes:
- FC4 install
- fstab/ntfs kernel module/NVidia drivers/xorg.conf/mdadm.conf/rpmkeys/remove libdv/install libdv4
- libdvDeps.sh
- install cinelerra
- cinSourceDeps.sh
- create /mnt/win, /mnt/nt
- window prefs/google/cin window placemnet/save on exit

rebuilding the workstation: lost my damn RAID set!

I *almost* had a minor tragedy last night while rebuilding my Fedora Core 4 box. The *almost* tragedy occurred while reinstalling Core 4. While going through the process, I told the installer to use my existing RAID set, but do not reformat it. I figured what harm could come to the drive if it doesn't get formatted? Well, a lot, apparently. Since I was rushing through the install, I neglected to take proper care of the 40GB of MPEG2 files on the RAID set. Here's what happened.

After the FC installer finished, it asks to reboot the box, so I rebooted. On bootup, the system gave me errors regarding an unrecognized filesystem and dropped me to a filesystem shell to fix what was wrong. I didn't know what was wrong, so I rebooted into a linux rescue disk and simply took the RAID filesystem out of /etc/fstab and rebooted.

On the second bootup, I started fdisk to look at the drives. To my dismay, fdisk did not recognize the RAID set partitions. Agh! I did some preliminary research online. I came to the determination that I figured I had lost my data, though I did have it backed up. But it would be a pain to retrieve the 40GB or so of videos from my backup system. Damn it. So I bit the bullet and created new partitions of type "fd", a Linux RAID autodetect partition as I had done when I setup the RAID set initially. When I wrote the partition table, fdisk gave me some error saying that the drives will resync after the box reboots. I rebooted and looked at the output of "fdisk -l". Things seemed alright, as the drives were recognized as Linux RAID autodetect. So I then reenabled /dev/md0 in /etc/fstab and made sure that /etc/mdadm.conf was correct. Dejectedly I rebooted.

When the system started, it dropped me into a prompt complaining of filesystem problems again. Now what? This time, I looked at the man pages for fsck and figured out the commands I needed to repair the disk. They ran something like this:
fsck -t ext2 /dev/md0 -V -r
-t filesystem type
-V verbose
-r prompt for each repair


A couple of inodes were missing or corrupt. OK. Fsck seemed to continue on with the different stages of the five stage check procedure. About five or ten minutes of this, I was getting worried. Happily, it finished the checks and dropped me to a prompt in order to exit and reboot. OK..that's progress! Also, the box came up clean with no errors. Sweet. I now went to view the filesystem, and to my shock and surprise, my original files were there! Awesome!! But now the real test is reading from and writing to files. I first viewed one of the videos in mplayer. This worked! I then performed an extensive write test. Cinelerra needs table of contents files for each video. These are index file, essentially. So at a prompt, I generated a bunch of toc files for the 30GB or so of video I had by using this one command:
for i in `ls -1 *.m2t` ; do echo $i ; mpeg3toc $i $i.toc ; done

The file creation took about twenty minutes but worked! I then loaded the files into Cinelerra, started editing and wouldn't you know they are good to go! Hooray! But I'm still an idiot.

Moral of the story is make sure you do your research on RAID before you decide to implement it.

Wednesday, September 13, 2006

ATI OpenGL 2.0 implementation incomplete..hello NVidia!

Sad to say, but all you ATI lovers (like I USED to be) are in for a rude surprise with ATIs' "OpenGL2.0" Linux driver implementation. After 1 1/2 days of finally getting my ATI All in Wonder 9800 Pro to actually use Direct Rendering and OpenGL2.0 and see it working well (5000FPS on glxgears), it was very disheartening to find out that ATI had not provided the proper 2.0 hooks for Cinelerra to use. Specifically, programming hooks like glDeleteShader were not implemented. The troubleshooting was quite informative, as I am not an active C programmer.

The solution was typical of today's PC market. If it don't work, buy one that does! So I went to B&H Photo and bought a BFG nVidia GeForce 7600GS, 512MB. Twenty minutes after getting home, the card was in the box, drivers were compiled, installed and working. Fifteen minutes after that, Cinelerra was compiled and I was using OpenGL2.0! Yeehoo!! And at twice the playback speed of what I was getting previously with the ATI card. I will report back on the performance of this card once I actually USE it.

Tuesday, September 12, 2006

openGL acceleration for Cinelerra not working just yet

Well, I spent all Sunday and Monday reconfiguring my workstation for hardware rendering (as detailed here), but my recompile of the latest Cinelerra code blew up on some obscure header file. Hopefully, the smart fellows on http://cvs.cinelerra.org can help out.

Wednesday, September 06, 2006

tracing a specific path using camera automation

For my Paris video, I wanted to simulate our walk of the city by panning an old map of Paris highlighted with the streets we traveled. To do this, I imported a series of large (2800x2100) still images created in Gimp and used camera automation to simulate movement. The camera automation needed to be very specific to trace our path. Thus, I had to get the X,Y coordinate pairs of each point I wanted the camera to center upon. The hurdle I encountered is that the origin of the X,Y coordinate system used in Gimp is at the upper-left hand corner of the image, whereas the origin of an image or video imported into Cinelerra is at the center of the image. So I had to do a conversion.

For an image that is 2800x2100:
(0,0) in Gimp is (-1400,-1050) in Cinelerra
(1400,1050) in Gimp is (0,0) in Cinelerra
(2800,2100) in Gimp is (1400,1050) in Cinelerra

Hence, in Gimp, all X/Y values are positive, but in Cinelerra, X and Y can have negative values.

Most of the camera automations to simulate our walk required about four coordinate pairs; hence, four conversions:
1) origin
2) first leg of walk
3) second leg of walk
4) destination

As you can see, when I wanted to change the speed or direction of the pan, the conversion of coordinates got a bit tedious. Also, I varied the movement of some of the camera automations so that not all were bezier curves, but more linear. As noted in an earlier post, this can be accomplished by displaying the X and Y camera positions and using CTRL-click on the vertices to "pull" the curves straight. This takes a little getting used to and is very time consuming. Note that there will be two sets of "pull" vertices on either side of the actual X/Y positions that you can adjust to straighten the curve slope.

But the result is quite pleasing:
ParisRoutes
55MB

Saturday, September 02, 2006

outputting HDV from Cinelerra

Update 9/10/06:
This procedure doesn't work. The working one is listed here:
/2006/11/cam-compatible-hdv-edit-chain-part-ii.html

Do it with FFMPEG:

Audio and Video Mux Example:
ffmpeg -i jpegphoto.mov -f mpegts -vcodec mpeg2video -aspect 1.777 -b 18300 -r 29.97 -s 1280x720 -acodec mp2 -ac 2 -ab 384 -ar 48000 output.m2t

Container/File Format:
-f mpegts

Video
-vcodec mpeg2video
-aspect 1.777
-b 18300
-r 29.97
-s 1280x720

Audio
-acodec mp2
-ac 2
-ab 384
-ar 48000

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

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