r870: Merge 2.1:
[cinelerra_cv.git] / doc / cinelerra.texi
blobe6cc7297f447d002999694024aac44b1d06c1d27
1 \input texinfo   @c -*-texinfo-*-
5 @setfilename cinelerra.info
6 @settitle Secrets of Cinelerra
9 @titlepage
10 @center @title Secrets of Cinelerra
11 @subtitle Version 2.1.0
12 @author Heroine Virtual Ltd.
13 @page
14 Copyright @copyright{} 2006 Heroine Virtual Ltd.
15 @end titlepage
19 @node TOP
20 @top
22 @chapter SHORT CONTENTS
24 @menu
25 * ABOUT CINELERRA::          Cinelerra in brief.
26 * INSTALLATION::             Making Cinelerra work on your system.
27 * CONFIGURATION::            Adjusting the behavior of Cinelerra.
28 * CREATING A NEW PROJECT::   Creating a new project
29 * THE MAIN WINDOWS::         The most often used user interfaces.
30 * LOADING AND SAVING FILES:: Moving media between disk and Cinelerra.
31 * NAVIGATING THE PROJECT::   Moving around the media.
32 * EDITING::                  Moving the media in time.
33 * USING EFFECTS::            Altering the media.
34 * SETTING PROJECT ATTRIBUTES:: Changing the way the media is displayed.
35 * COMPOSITING::              Overlaying different sources of video.
36 * KEYFRAMES::                Making effects change over time.
37 * CAPTURING MEDIA::          Moving media from the real world to disk.
38 * IMPROVING PERFORMANCE::    Making Cinelerra run better on Linux.
39 * TROUBLESHOOTING::          Problems with Cinelerra.
40 * SECRETS OF CINELERRA::     Unusual applications of Cinelerra to common problems.
41 * SECRETS OF CINELERRA EFFECTS::      Secrets of the more complicated effects.
42 * PLUGIN AUTHORING::         How to write new effects.
43 * KEYBOARD SHORTCUTS::       How to accelerate most commands with the keyboard.
44 @end menu
48 @contents
56 @node ABOUT CINELERRA
57 @chapter ABOUT CINELERRA
59 For years some people have wanted a way to edit their audio and video
60 in one place as fluidly as writing text.  Cinelerra tries to be a
61 single location for all your audio and video editing needs.  All the
62 recording, editing, and playback are handled here.  It can be used as
63 an audio player.  It can be used to record audio or video.  It can even
64 be used as a photo retoucher.
66 There are two types of moviegoers: producers who create new content,
67 going back over their content at future points for further refinement,
68 and consumers who want to acquire the content and watch it.  Cinelerra
69 is not intended for consumers.  Cinelerra has many features for
70 uncompressed content, high resolution processing, and compositing, with
71 very few shortcuts.  Producers need these features because of the need
72 to retouch many generations of footage with alterations to the format,
73 which makes Cinelerra very complex. There are many more standard tools
74 for consumers like MainActor, Kino, or Moxy, which you should consider
75 before using Cinelerra.
77 In 1996 our first editor came out: Broadcast 1.0.  It was just a window
78 with a waveform in it, it could cut and paste stereo audio waveforms on
79 a UNIX box, except unlike other audio editors it could handle files up
80 to 2 gigabytes with only 64 megs of RAM.  That was a feature normally
81 only accessible to the highest end professional audio houses.
83 In 1997 Broadcast 1.0 was replaced by Broadcast 2.0.  This time the
84 window had a menubar, patchbay, console, and transport control. 
85 Broadcast 2.0 still only handled audio but this time it handled
86 unlimited tracks, and it could perform effects on audio and save the
87 resulting waveform to disk.  More notably a few effects could be
88 performed as the audio was playing back, in realtime.  A user could mix
89 unlimited numbers of tracks, adjust fade, pan, and EQ, and hear the
90 result instantly.   Amazingly this real time tweeking is still
91 unavailable on most audio programs.
93 But Broadcast 2.0 still didn't handle video and it wasn't very graceful
94 at audio either.  In 1999 video broke into the story with Broadcast
95 2000.  This iteration of the Broadcast series could do wonders with
96 audio and offered a pretty good video feature set.  It could edit video
97 files up to 64 terabytes.  It could do everything Broadcast 2.1 did
98 with audio except now all effects for video and audio could be chained
99 and performed on the fly, with instant feedback as a user tweeked
100 parameters during playback.  Broadcast 2000 made it very easy to do a
101 lot of processing and editing on video and audio that would otherwise
102 involve many hours setting up command line sequences and writing to
103 disk. For a time it seemed as if the original dream of immersive movie
104 making for everyone regardless of income level had arrived.
106 Later on Broadcast 2000 began to come short.  Its audio and video was
107 graceful if you knew how to use it efficiently, but quality issues and
108 new user interface techniques were emerging.  Broadcast 2000 kept the
109 audio interface from its ancestors, which didn't apply well to video. 
110 Users likewise were maturing.  No longer would it be sufficient to just
111 edit video on a UNIX box.  Most users expected on UNIX the same thing
112 they got in Win or Mac. In mid 2000 designs for a Broadcast 2000
113 replacement were drafted.  The Broadcast name was officially retired
114 from the series and the software would now be called Cinelerra. 
115 Cinelerra would allow users to configure certain effects in much less
116 time than required with Broadcast 2000.  It would begin to emulate some
117 of the features found in Win and Mac software while not attempting to
118 become a clone.  It's interface would be designed for video from the
119 ground up, while supplementing that with the Broadcast audio
120 interface.  As always, quality improvements would happen.
129 @menu
130 * ABOUT THIS MANUAL::
131 @end menu
133 @node ABOUT THIS MANUAL
134 @section ABOUT THIS MANUAL
136 This manual is relevant only for the heroinewarrior.com version of
137 Cinelerra.  If you are using the cinelerra.org fork, you should use the
138 manual for that version.  The behavior of different forks is highly
139 variable.  This manual has been copied and translated into many
140 languages.
142 Organizing information in the easiest manner for users to find out what
143 they need to know is sort of like cataloging the internet.  They've
144 been trying to get it right for 30 years and will probably keep trying
145 until the end of time.
147 There a lot of fragments of documentation scattered throughout the
148 internet about Cinelerra.  This document attempts to combine all the
149 pieces of information in one piece.
151 Like the operating system and compiler for a piece of software, the
152 document writing format is the most important thing in choosing our
153 document format.  We wanted a format which would be readable regardless
154 of corporate whims and fads.  A piece of software which compiles on GCC
155 and Linux will be usable as long as there are C compilers.  Documents
156 written in Texinfo will be readable as long as there's a C compiler.
158 After many years of searching for the perfect documentation format
159 we've arrived at TexInfo.  This format can be converted to HTML,
160 printed, automatically indexed, but most importantly is not bound to
161 any commercial word processor.
163 There are no screenshots in this manual.  Screenshots become obsolete
164 quickly and as a result confuse the users.  What looks one way in a
165 screenshot will always look different in the real program because the
166 real program and the manual are always evolving, never perfectly
167 synchronized.  It is true that manuals should have screenshots, but our
168 objective in omitting screenshots is to keep the software costs minimal
169 so you don't have to pay for it.  That includes additional labor to
170 synchronize the manual with the software.
172 In addition to telling you the basic editing features of Cinelerra this
173 manual covers tricks that won't be described anywhere else.  We're
174 going to try to come up with certain things you can do with Cinelerra
175 that you wouldn't think of on your own.
193 @node INSTALLATION
194 @chapter INSTALLATION
197 The Cinelerra package contains Cinelerra and most of the libraries
198 needed to run it.  We try to include all the dependancies because of
199 the difficulty in tracking down the right versions.  Also included are
200 some utilities for handling files.  The following are the general
201 contents of all Cinelerra packages.
203 @itemize
205 @item
207 @b{Foreign language translations} - These go into /usr/share/locale.
209 @item
211 @b{Cinelerra executable} - This goes into /usr/bin
213 @item
215 @b{Cinelerra plugins} - These go into /usr/lib/cinelerra in 32 bit
216 systems and /usr/lib64/cinelerra in 64 bit systems.
218 @item
220 @b{soundtest} - Utility for determining sound card buffer size.
222 @item
224 @b{mplexlo} - Multiplexing of MPEG elementary streams without standards
225 conformance but more efficiently.
227 @item
229 @b{mpeg3cat} - Utility for reading an MPEG file from a certain standard
230 and outputting it to stdout.
232 @item
234 @b{mpeg3toc, mpeg3cat, mpeg3dump} - Utilities/ for indexing and reading MPEG files.
236 @item
238 @b{mpeg3peek} - Utility for displaying the byte offset of a frame in an
239 MPEG file.
241 @end itemize
245 @menu
246 * INSTALLING AN RPM::
247 * COMPILING FROM SCRATCH::
248 * RUNNING CINELERRA::
249 @end menu
258 @node INSTALLING AN RPM
259 @section INSTALLING AN RPM
261 Cinelerra is easiest installed by downloading an RPM and running
263 @example
264 rpm -U --force --nodeps hvirtual*.rpm
265 @end example
267 on a Fedora 4 system.
269 On systems which don't support RPM look for a utility called
270 @b{rpm2cpio}.  Download a Cinelerra RPM and from the /
271 directory run
273 @example
274 rpm2cpio hvirtual*.rpm | cpio -i --make-directories
275 @end example
277 This doesn't always work because there are many forks of the C library,
278 each incompatible with the others.  This is the biggest reason to
279 compile from scratch.
287 @node COMPILING FROM SCRATCH
288 @section COMPILING FROM SCRATCH
290 It should be noted that the compiler used in building Cinelerra
291 binaries is the free GNU compiler and very conservative optimization
292 flags.  Alternative optimization flags and compilers produce varying
293 results.  Compiling the source is hard and there's no warranty if the
294 source code fails to compile, but the method for compiling starts by
295 downloading the source code and decompressing.
297 The compilation is verified on a vanilla Fedora 4 installation,
298 workstation mode.  Fedora doesn't install a lot of dependancies like
299 @b{nasm} and @b{yasm}.  Yes, 3 assemblers are now required to assemble
300 x86 code.  Compiling the source is hard and there's no warranty if the
301 source code fails to compile, but the method for compiling starts by
302 downloading the source code and decompressing.
304 @example
305 tar jxf cinelerra*.tar.bz2
306 @end example
309 The compilation is verified on a Fedora 4 installation.  Fedora 4
310 doesn't install a lot of the reqiured compilers.  Mainly @b{nasm} and
311 @b{yasm}, 2 of the 3 assemblers.  These have to be installed manually
312 for compilation to succeed.
314 Enter the hvirtual directory
316 @example
317 cd cinelerra
318 @end example
320 Then run
322 @example
323 ./configure
324 @end example
326 This checks the build environment for the right tools and should give
327 you an error if a tool is missing.  Once that succeeds run
329 @example
330 make
331 @end example
333 The make procedure should run through all the directories and put
334 binaries in the @b{i686} or @b{x86_64} directories.  When NFS was
335 a lot faster, we compiled Alpha and i686 binaries in the same
336 filesystem with the objects in different subdirectories, so all the
337 binaries are still put in subdirectories.
339 A lot of libraries are included to get the version numbers right.  Some
340 of the libraries don't compile on SMP systems.  One solution is to
341 disable SMP when rebooting and reenable it when compilation is
342 finished.  Another solution is to rerun make over and over until it
343 gets through the offending libraries.
346 Once finished, make sure you are root and run
348 @example
349 make install
350 @end example
352 to install the binaries.  If installation fails it means something
353 failed to compile or you weren't root.  Run @b{make} again and watch
354 for errors.
356 Sometimes you'll want to run @b{make clean} if you're programming
357 something or the system libraries change.  In this case, you'll
358 probably need to run @b{configure} again because some libraries delete
359 their configuration files in @b{make clean}.
361 @node RUNNING CINELERRA
362 @section RUNNING CINELERRA
365 The simplest way to run Cinelerra is by running
368 @example
369 /usr/bin/cinelerra
370 @end example
372 This command hides a much more capable command line interface.  Run
373 @b{cinelerra -h} to get a listing of command line options.  The use of
374 these options is described in several sections.
376 For rendering from the command line @xref{RENDERING FILES}.
389 @node CONFIGURATION
390 @chapter CONFIGURATION
393 Because of the variety of uses, Cinelerra cannot be run optimally
394 without some intimate configuration for your specific needs. Very few
395 parameters are adjustible at compile time.  Runtime configuration is
396 the only option for most configuration because of the multitude of
397 parameters.
399 Here we discuss not only the configuration options but which of the
400 different API's in Linux are supported.
402 Go to @b{settings->preferences} and to see the options.
405 @menu
406 * ENVIRONMENT VARIABLES::  These environment variables are recognized by Cinelerra
407 * AUDIO DRIVERS::          Information about the audio drivers
408 * VIDEO DRIVERS::          Information about the video drivers
409 * PLAYBACK::               Configuring parameters related to playback.
410 * RECORDING::              Configuring parameters related to recording.
411 * PERFORMANCE::            Configuring parameters related to how fast things go.
412 * INTERFACE::              Configuring the user interface.
413 * ABOUT::                  Viewing information about the program.
414 @end menu
417 @node ENVIRONMENT VARIABLES
418 @section ENVIRONMENT VARIABLES
420 In UNIX derivatives, environment variables are global variables in the
421 shell which all applications can read.  They are set with a command
422 like @b{set VARIABLE=value}.  All the environment variables can be
423 viewed with a command like @b{env}.  Cinelerra recognizes the following
424 environment variables:
426 @itemize
428 @item @b{LADSPA_PATH} - If you want to use LADSPA plugins, this must be
429 defined: a colon separated list of directories to search for LADSPA
430 plugins.  These are not native Cinelerra plugins.  @xref{LADSPA
431 EFFECTS}.
434 @end itemize
441 @node AUDIO DRIVERS
442 @section AUDIO DRIVERS
444 The audio drivers are used for both recording and playback to get data
445 to and from the hardware.  Since the same drivers are used for both
446 recording and playback, their functionality is described here in a
447 separate section.
452 @menu
453 * COMMON SOUND DRIVER ATTRIBUTES:: Attributes used for more than one sound driver.
454 * OSS:: Notes about the OSS driver
455 * OSS Envy24:: Notes about the OSS driver for the Envy24 chip
456 * ALSA:: Notes about the ALSA driver
457 * ESOUND:: Notes about the ESound driver
458 * RAW 1394:: Notes about the Raw1394 driver
459 * DV 1394:: Notes about the DV1394 driver
460 * IEC 61883:: Notes about the IEC 61883 driver
461 @end menu
463 @node COMMON SOUND DRIVER ATTRIBUTES
464 @subsection COMMON SOUND DRIVER ATTRIBUTES
466 @itemize
468 @item
469 DEVICE PATH
471 Usually a file in the @b{/dev/} directory which controls the
472 device.
474 @item
476 BITS
478 The number of bits of precision Cinelerra should set the device for. 
479 This sometimes has a figuritive meaning.  Some sound drivers need to be
480 set to 32 bits to perform 24 bit playback and won't play anything when
481 set to 24 bits.  Some sound drivers need to be set to 24 bits for 24
482 bit playback.
484 @end itemize
488 @node OSS
489 @subsection OSS
491 This was the first Linux sound driver.  It had an open source
492 implementation and a commercial implementation with more sound cards
493 supported.  It was the standard sound driver up to linux 2.4.  It still
494 is the only sound driver which an i386 binary can use when running on
495 an x86_64 system.
497 @node OSS Envy24
498 @subsection OSS Envy24
500 The commercial version of OSS had a variant for 24 bit 96 Khz
501 soundcards.  This variant required significant changes to the way the
502 sound drivers were used, which is what the OSS Envy24 variant is for.
505 @node ALSA
506 @subsection ALSA
508 ALSA is the most common sound driver in Linux 2.6.  It supports the
509 most sound cards now.  It takes advantage of low latency features in
510 Linux 2.6 to get better performance than OSS had in 2.4 but roughly the
511 same performance that OSS had in 2.0.  Unfortunately ALSA is constantly
512 changing.  A program which works with it one day may not the next day. 
513 New wrappers are being developed on top of ALSA at such a pace, we plan
514 to support them at regular intervals, not at every new release of a new
515 wrapper.
517 ALSA is no longer portable between i386 and x86_64.  If an i386 binary
518 tries to play back on an x86_64 kernel it'll crash.  For this scenario,
519 use OSS.
521 @node ESOUND
522 @subsection ESOUND
524 ESOUND was a sound server that sat on top of OSS.  It was written for a
525 window manager called Enlightenment.  It supported a limited number of
526 bits and had high latency compared to modern times but multiplexed
527 multiple audio sources.  It's unknown whether it still works.
529 @node RAW 1394
530 @subsection RAW 1394
532 The first interface between linux software and firewire camcorders. 
533 This was the least reliable way to play audio to a camcorder.  It
534 consisted of a library on top of the kernel commands.
536 @node DV 1394
537 @subsection DV 1394
539 The second rewrite of DV camcorder support in Linux.  This was the most
540 reliable way to play audio to a camcorder.  This consisted of direct
541 kernel commands.
543 @node IEC 61883
544 @subsection IEC 61883
546 The third rewrite of DV camcorder support in Linux.  This is a library
547 on top of RAW 1394 which is a library on top of the kernel commands. 
548 It's less reliable than DV 1394 but more reliable than RAW 1394.  The
549 next rewrite ought to fix that.
558 @node VIDEO DRIVERS
559 @section VIDEO DRIVERS
561 The audio drivers are used for both recording and playback to get data
562 to and from the hardware.  Since the same drivers are used for both
563 recording and playback, their functionality is described here in a
564 separate section.
567 @menu
568 * COMMON VIDEO DRIVER ATTRIBUTES:: Parameters used by more than one driver.
569 * X11::
570 * X11-XV::
571 * X11-OPENGL::
572 * BUZ::
573 * RAW 1394 VIDEO PLAYBACK::
574 * DV 1394 VIDEO PLAYBACK::
575 * IEC 61883 VIDEO PLAYBACK::
576 @end menu
578 @node COMMON VIDEO DRIVER ATTRIBUTES
579 @subsection COMMON VIDEO DRIVER ATTRIBUTES
582 @itemize
584 @item
586 DISPLAY
588 The is intended for dual monitor
589 displays.  Depending on the value of Display, the Compositor window
590 will appear on a different monitor from the rest of the windows.
592 @item
594 DEVICE PATH
596 Usually a file in the @b{/dev/} directory
597 which controls the device.
599 @item
601 SWAP FIELDS
603 Make the even lines odd and the odd lines even
604 when sending to the device.  On an NTSC or 1080i monitor the fields may
605 need to be swapped to prevent jittery motion.
607 @item
609 OUTPUT CHANNEL
611 Devices with multiple outputs may need a
612 specific connector to send video on.
614 @item
616 PORT
618 The IEEE1394 standard specifies something known as the
619 @b{port}.  This is probably the firewire card number in the system
620 to use.
622 @item
624 CHANNEL
626 The IEEE1394 standard specifies something known as the
627 @b{channel}.  For DV cameras it's always @b{63}.
629 @end itemize
631 @node X11
632 @subsection X11
634 This was the first method of video playback on any UNIX system, valid
635 all the way until 1999.  It just writes the RGB triplet for each pixel
636 directly to the window.  It's the slowest playback method.  It's still
637 useful as a fallback when graphics hardware can't handle very large
638 frames.
640 @node X11-XV
641 @subsection X11-XV
643 This was the second big method of video playback in UNIX starting in
644 1999.  It converts YUV to RGB in hardware with scaling.  It's the
645 preferred playback method but can't handle large frame sizes.  The
646 maximum video size for XV is usually 1920x1080.
649 @node X11-OPENGL
650 @subsection X11-OPENGL
652 The most powerful video playback method is OpenGL.  With this driver,
653 most effects are done in hardware.  OpenGL allows video sizes up to the
654 maximum texture size, which is usually larger than what XV supports,
655 depending on the graphics driver.
657 OpenGL doesn't affect rendering.  It just accelerates playback.  OpenGL
658 relies on PBuffers and shaders to do video rendering.  The graphics
659 driver must support OpenGL 2 and Cinelerra needs to be explicitely
660 compiled with OpenGL 2 support.  This requires compiling it on a system
661 with the OpenGL 2 headers.
663 PBuffers are known to be fickle.  If the graphics card doesn't have
664 enough memory or doesn't have the right visuals, PBuffers won't work. 
665 Try seeking several frames or restarting Cinelerra if OpenGL doesn't
666 work.
668 Because of OpenGL limitations, X11-OpenGL processes everything in 8 bit
669 colormodels, although the difference between YUV and RGB is retained.
671 The @b{scaling equation} in Preferences is ignored by OpenGL.  OpenGL
672 always uses linear scaling.
674 Project and track sizes need to be multiples of 4 for OpenGL to work.  
676 To get the most acceleration, OpenGL-enabled effects must be placed
677 after software-only effects.  All rendering before the last
678 software-only effect is done in software.  The core Cinelerra
679 operations like camera and projector are of course OpenGL.
683 @node BUZ
684 @subsection BUZ
686 This is a method for playing motion JPEG-A files directly to a
687 composite analog signal.  It uses a popular hack of the Video4Linux 1
688 driver from 2000 to decompress JPEG in hardware.  Sadly, even though
689 analog output is largely obsolete, newer drivers have replaced BUZ.
691 @node RAW 1394 VIDEO PLAYBACK
692 @subsection RAW 1394 VIDEO PLAYBACK
694 The first interface between linux software and firewire camcorders. 
695 This was the least reliable way to play video to a camcorder.  It
696 consisted of a library on top of the kernel commands.
699 @node DV 1394 VIDEO PLAYBACK
700 @subsection DV 1394 VIDEO PLAYBACK
702 The second rewrite of DV camcorder support in Linux.  This was the most
703 reliable way to play video to a camcorder.  This consisted of direct
704 kernel commands.
706 @node IEC 61883 VIDEO PLAYBACK
707 @subsection IEC 61883 VIDEO PLAYBACK
710 The third rewrite of DV camcorder support in Linux.  This is a library
711 on top of RAW 1394 which is a library on top of the kernel commands. 
712 It's less reliable than DV 1394 but more reliable than RAW 1394.  The
713 next rewrite ought to fix that.
721 @node PLAYBACK
722 @section PLAYBACK
726 @menu
727 * AUDIO OUT::
728 * VIDEO OUT::
729 @end menu
733 @node AUDIO OUT
734 @subsection AUDIO OUT
736 These determine what happens when you play sound from the timeline.
738 @itemize 
740 @item
741 SAMPLES TO SEND TO CONSOLE:
743 For playing audio, small fragments of sound are read from disk and
744 processed in a virtual console sequentially.  A larger value here
745 causes more latency when you change mixing parameters but gives more
746 reliable playback.
748 Some sound drivers don't allow changing of the console fragment so
749 latency is unchanged no matter what this value is.
751 A good way of ensuring high quality playback was to read bigger
752 fragments from the disk and break them into smaller fragments for the
753 soundcard.  That changed when the virtual console moved from the push
754 model to the pull model.  Since different stages of the rendering
755 pipeline can change the rate of the incoming data, it would now be real
756 hard to disconnect size of the console fragments from the size of the
757 fragments read from disk.
759 @item
761 AUDIO OFFSET:
763 The ability to tell the exact playback position on Linux sound drivers
764 is pretty bad if it's provided at all.  Since this information is
765 required for proper video synchronization, it has to be accurate.  The
766 @b{AUDIO OFFSET} allows users to adjust the position returned by the
767 sound driver to reflect reality.  The audio offset doesn't affect the
768 audio playback or rendering at all.  It merely changes the
769 synchronization of video playback.
771 The easiest way to set the audio offset is to create a timeline with 1
772 video track and one audio track.  Expand the audio track and center the
773 audio pan.  The frame rate should be something over 24fps and the
774 sampling rate should be over 32000.  The frame size should be small
775 enough for your computer to render it at the full framerate.  Highlight
776 a region of the timeline starting at 10 seconds and ending at 20
777 seconds.  Drop a @b{gradient} effect on the video track and configure
778 it to be clearly visible.  Drop a @b{synthesizer} effect on the audio
779 and configure it to be clearly audible.
781 Play the timeline from 0 and watch to see if the gradient effect starts
782 exactly when the audio starts.  If it doesn't, expand the audio track
783 and adjust the nudge.  If the audio starts ahead of the video, decrease
784 the nudge value.  If the audio starts after the video, increase the
785 nudge value.  Once the tracks play back synchronized, copy the nudge
786 value to the @b{AUDIO OFFSET} value in preferences.
788 @b{Note:} if you change sound drivers or you change the value of @b{USE
789 SOFTWARE FOR POSITIONING INFORMATION}, you'll need to change the audio
790 offset because different sound drivers are unequally inaccurate.
792 @item
794 VIEW FOLLOWS PLAYBACK
796 Causes the timeline window to scroll when the playback cursor moves. 
797 This can bog down the X Server or cause the timeline window to lock up
798 for long periods of time while drawing the assetse.
800 @item
801 USE SOFTWARE FOR POSITIONING INFORMATION
803 Most soundcards and sound drivers don't give reliable information on
804 the number of samples the card has played. When playing video you need
805 this information for synchronization. This option causes the sound
806 driver to be ignored and a software timer to be used for
807 synchronization.
809 @item
810 AUDIO PLAYBACK IN REALTIME:
812 Back in the days when 150Mhz was the maximum, this allowed
813 uninterrupted playback on heavy loads.  It forces the audio playback to
814 the highest priority in the kernel.  Today it's most useful for
815 achieving very low latency between console tweeks and soundcard
816 output.  You must be root to get realtime priority.
818 @item
819 AUDIO DRIVER
821 There are many sound drivers for Linux.  This allows selecting one
822 sound driver and setting parameters specific to it.  The sound drivers
823 and their parameters are described in the sound driver section. 
824 @xref{AUDIO DRIVERS}.
826 @end itemize
831 @node VIDEO OUT
832 @subsection VIDEO OUT
834 These determine how video gets from the timeline to your eyes.
836 @itemize
839 @item PLAY EVERY FRAME
841 Causes every frame of video to be displayed even if it means falling
842 behind the audio.  This should always be on unless you use mostly
843 uncompressed codecs.  Most compressed codecs don't support frame
844 dropping anymore.
848 @item
850 FRAMERATE ACHIEVED
852 The number of frames per second being displayed during playback.  This
853 is only updated during playback.
855 @item DECODE FRAMES ASYNCHRONOUSLY
857 If you have lots of memory and more than one CPU, this option can
858 improve playback performance by decoding video on one CPU as fast as
859 possible while dedicating other CPU to displaying video only.  It
860 assumes all playback operations are forward and no frames are dropped. 
861 Operations involving reverse playback or frame dropping are negatively
862 impacted.
864 Since this option requires enourmous amounts of memory, it may crash if
865 the input frames are very large.
868 @item
870 SCALING EQUATION
872 When video playback involves any kind of scaling or translation, this
873 algorithm is used.  This doesn't affect 1:1 playback.
875 @itemize
877 @item
878 NEAREST NEIGHBOR ENLARGE AND REDUCE
880 lowest but fastest
881 quality.  Produces jagged edges and uneven motion.
884 @item
886 BICUBIC ENLARGE AND BILINEAR REDUCE
888 highest but slowest
889 quality.  For enlarging a bicubic interpolation is used, which blurs
890 slightly but doesn't reveal stair steps.  For reduction a bilinear
891 interpolation is used, which produces very sharp images and reduces
892 noise.  The bilinear reduced images can be sharpened with a sharpen
893 effect with less noise than a normal sized image.
895 @item
897 BILINEAR ENLARGE AND BILINEAR REDUCE
899 when slight enlargement
900 is needed a bilinear enlargement looks better than a bicubic
901 enlargement.
903 @end itemize
906 @item
908 PRELOAD BUFFER FOR QUICKTIME
910 The Quicktime/AVI decoder can handle DVD sources better when this is
911 around 10000000.  This reduces the amount of seeking required. 
912 Unfortunately when reading high bitrate sources from a hard drive, this
913 tends to slow it down.  For normal use this should be 0.
916 @item 
918 DVD SUBTITLE TO DISPLAY
920 DVD IFO files usually contain subtitle tracks.  These must be decoded
921 with by the MPEG decoder.  Select @b{Enable subtitles} to enable
922 subtitle decoding.  There are usually multiple subtitle tracks starting
923 from 0.  The subtitle track to be decoded for all MPEG streams goes in
924 the DVD subtitlee to display text box.  Go to the asset corresponding
925 to the MPEG file in the Resources window and right click.  Click on
926 Info.  The number of subtitle tracks is given at the bottom.
929 @item 
931 INTERPOLATE CR2 IMAGES
933 Enables interpolation of CR2 images.  This is required since the raw
934 image in a CR2 file is a bayer pattern.  The interpolation uses dcraw's
935 built-in interpolation and is very slow.  This operation can be
936 disabled and the @b{Interpolate Pixels} effect used instead for fast
937 previewing.
940 @item 
942 WHITE BALANCE CR2 IMAGES
944 This enables white balancing for CR2 images if interpolation is also
945 enabled.  It uses the camera's matrix which is contained in the CR2
946 file.  White balancing is not performed if interpolation is not
947 performed because white balancing needs a blending of all 3 primary
948 colors. 
950 Disabling white balancing is useful for operations involving dark frame
951 subtraction.  The dark frame and the long exposure need to have the
952 same color matrix.
954 If you disable @b{Interpolate CR2 Images} and use the @b{Interpolate
955 Pixels} effect, be aware the @b{Interpolate Pixels} effect always does
956 both interpolation and white balancing using the camera's matrix,
957 regardless of the settings in Preferences.  Dark frame subtraction
958 needs to be performed before @b{Interpolate Pixels}.
960 @item
965 VIDEO DRIVER
967 Normally video on the timeline goes to the compositor window during
968 continuous playback and when the insertion point is repositioned. 
969 Instead of sending video to the Compositor window the video driver can
970 be set to send video to another output device during continuous
971 playback.  This doesn't affect where video goes when the insertion
972 point is repositioned, however.
974 The video drivers and their parameters are described in the video
975 driver section.  @xref{VIDEO DRIVERS}.
978 @end itemize
983 @node RECORDING
984 @section RECORDING
986 @menu
987 * FILE FORMAT::
988 * AUDIO IN::
989 * VIDEO IN::
990 @end menu
994 The parameters here affect what happens when you go to
995 @b{File->Record...}.  The intention was to make @b{File->Record...} go
996 as fast as possible into the record monitoring window, without a
997 lengthy dialog to configure the file format.  Instead the file format
998 for recording is set here and it is applied to all recordings.  Also
999 set here is the hardware for recording, since the hardware determines
1000 the supported file format in most cases.
1003 @node FILE FORMAT
1004 @subsection FILE FORMAT
1006 This determines the output file format for recordings.  It depends
1007 heavily on the type of driver used.  The interface is the same as the
1008 rendering interface.  The @b{Record audio tracks} toggle must be
1009 enabled to record audio.  The @b{Record video tracks} toggle must be
1010 enabled to record video.  The wrench button left of each toggle opens a
1011 configuration dialog to set the codec corresponding to audio and
1012 video.  The audio and video is wrapped in a wrapper defined by the
1013 @b{File Format} menu.  Different wrappers may record audio only, video
1014 only, or both.
1016 Some video drivers can only record to a certain wrapper.  DV, for
1017 example, can only record to Quicktime with DV as the video compression.
1018 If the video driver is changed, the file format may be updated to give
1019 the supported output.  If you change the file format to an unsupported
1020 format, it may not work with the video driver.
1024 @node AUDIO IN
1025 @subsection AUDIO IN
1027 These determine what happens when you record audio.
1029 @itemize
1030 @item
1032 RECORD DRIVER
1034 This is used for recording audio in the Record window.  It may be
1035 shared with the Record Driver for video if the audio and video are
1036 wrapped in the same stream.  It takes variable parameters depending on
1037 the driver.  The parameters have the same meaning as they do for
1038 playback.
1040 @itemize
1041 @item
1043 DEVICE PATH
1045 Usually a file in the @b{/dev/} directory which controls the
1046 device.
1048 @item
1050 BITS
1052 The number of bits of precision Cinelerra should set the device for. 
1053 This sometimes has a figuritive meaning.  Some sound drivers need to be
1054 set to 32 bits to perform 24 bit recording and won't record anything
1055 when set to 24 bits.  Some sound drivers need to be set to 24 bits for
1056 24 bit recording.
1060 @end itemize
1062 @item
1064 SAMPLES TO WRITE AT A TIME
1066 Audio is first read in small fragments from the device.  Many small
1067 fragments are combined into a large fragment before writing to disk. 
1068 The disk writing process is done in a different thread.  The value here
1069 determines how large the combination of fragments is for each disk
1070 write.
1072 @item
1074 SAMPLE RATE FOR RECORDING
1076 Regardless of what the project settings are.  This is the sample rate
1077 used for recording.  This should be the highest the audio device
1078 supports.
1080 @end itemize
1082 @node VIDEO IN
1083 @subsection VIDEO IN
1085 These determine what happens when you record video.
1087 @itemize
1088 @item
1090 RECORD DRIVER
1092 This is used for recording video in the Record window.  It may be
1093 shared with the Record Driver for audio if the audio and video are
1094 wrapped in the same stream.  It takes variable parameters depending on
1095 the driver.  The parameters have the same meaning as they do for
1096 playback.
1098 @item
1100 FRAMES TO RECORD TO DISK AT A TIME
1102 Frames are recorded in a pipeline.  First frames are buffered in the
1103 device.  Then they're read into a larger buffer for writing to disk. 
1104 The disk writing is done in a different thread as the device reading. 
1105 For certain codecs the disk writing uses multiple processors.  This
1106 value determines how many frames are written to disk at a time.
1108 @item
1110 FRAMES TO BUFFER IN DEVICE
1112 The number of frames to store in the device before reading.  This
1113 determines how much latency there can be in the system before frames
1114 are dropped.
1116 @item
1117 USE SOFTWARE FOR POSITIONING INFORMATION
1119 Video uses audio for
1122 synchronization but most soundcards don't give accurate position
1123 information.  This calculates an estimation of audio position in
1124 software instead of the hardware for synchronization.
1126 @item
1128 SYNC DRIVES AUTOMATICALLY
1130 For high bitrate recording the drives may be fast enough to store the
1131 data but Linux may wait several minutes and stall as it writes several
1132 minutes of data at a time.  This forces Linux to flush its buffers
1133 every second instead of every few minutes and produce slightly better
1134 realtime behavior.
1136 @item
1138 SIZE OF CAPTURED FRAME
1140 This is the size of the frames recorded.  It is independant of the
1141 project frame size because most video devices only record a fixed frame
1142 size.  If the frame size given here isn't supported by the device it
1143 might crash Cinelerra.
1145 @item
1146 FRAME RATE FOR RECORDING
1148 The frame rate recorded is different from the project settings.  This
1149 sets the recorded frame rate.
1151 @end itemize
1160 @node PERFORMANCE
1161 @section PERFORMANCE
1164 You'll spend most of your time configuring this section.  The main
1165 focus of performance is rendering parameters not available in the
1166 rendering dialog.  
1172 @itemize 
1174 @item
1175 CACHE ITEMS
1179 To speed up rendering, several assets are kept open simultaneously.
1180 This determines how many are kept open.  A number too large may exhaust
1181 your memory pretty fast and result in a crash.  A number too small may
1182 result in slow playback as assets need to be reopened more frequently.
1185 @item
1187 SECONDS TO PREROLL RENDERS
1189 Some effects need a certain amount of time to settle in.  This sets a
1190 number of seconds to render without writing to disk before the selected
1191 region is rendered.  When using the renderfarm you'll sometimes need to
1192 preroll to get seemless transitions between the jobs.  Every job in a
1193 renderfarm is prerolled by this value.  This does not affect background
1194 rendering, however.  Background rendering uses a different preroll
1195 value.
1197 @item
1199 FORCE SINGLE PROCESSOR USE
1201 Cinelerra tries to use all processors on the system by default but
1202 sometimes you'll only want to use one processor, like in a renderfarm
1203 client.  This forces only one processer to be used.  The operating
1204 system, however, usually uses the second processor anyway for disk
1205 access so this option is really a 1.25 processor mode.  The value of
1206 this parameter is used in renderfarm clients.
1208 @end itemize
1211 @menu
1212 * BACKGROUND RENDERING::
1213 * RENDERFARM::
1214 @end menu
1217 @node BACKGROUND RENDERING
1218 @subsection BACKGROUND RENDERING
1220 Background rendering was originally concieved to allow HDTV effects to
1221 be displayed in realtime.  Background rendering causes temporary output
1222 to constantly be rendered while the timeline is being modified.  The
1223 temporary output is played during playack whenever possible.  It's very
1224 useful for transitions and previewing effects which are too slow to
1225 display in a reasonable amount of time.  If renderfarm is enabled, the
1226 renderfarm is used for background rendering, giving you the potential
1227 for realtime effects if enough network bandwidth and CPU nodes exist.
1229 @itemize
1235 @item
1236 FRAMES PER BACKGROUND RENDERING JOB
1238 This only works if renderfarm is being used, otherwise background
1239 rendering creates a single job for the entire timeline.  The number of
1240 frames specified here is scaled to the relative CPU speed of rendering
1241 nodes and used in a single renderfarm job.  The optimum number is 10 -
1242 30 since network bandwidth is used to initialize each job.
1246 @item
1247 FRAMES TO PREROLL BACKGROUND
1249 This is the number of frames to render ahead of each background
1250 rendering job.  Background rendering is degraded when preroll is used
1251 since the jobs are small.  When using background rendering, this number
1252 is ideally 0.  Some effects may require 3 frames of preroll.
1258 @item
1259 OUTPUT FOR BACKGROUND RENDERING
1261 Background rendering generates a sequence of image files in a certain
1262 directory.  This parameter determines the filename prefix of the image
1263 files.  It should be on a fast disk, accessible to every node in the
1264 renderfarm by the same path.  Since hundreds of thousands of image
1265 files are usually created, @b{ls} commands won't work in the
1266 background rendering directory.  The @image{magnify} browse button for
1267 this option normally won't work either, but the @image{wrench}
1268 configuration button for this option works.
1270 @item
1271 FILE FORMAT
1273 The file format for background rendering has to be a sequence of
1274 images. The format of the image sequence determines the quality and
1275 speed of playback.  JPEG is good most of the time.
1278 @end itemize
1280 @node RENDERFARM
1281 @subsection RENDERFARM
1283 To use the renderfarm set these options.  Ignore them for a standalone
1284 system
1286 @itemize
1288 @item
1290 USE RENDER FARM FOR RENDERING
1292 When selected, all the
1293 @b{file->render} operations use the renderfarm.
1295 @item
1297 NODES
1299 Displays all the nodes on the renderfarm and which ones are active. 
1301 Nodes are added by entering the host name of the node, verifying the
1302 value of @b{port} and hitting @b{add node}.
1304 Computer freaks may be better off editing the
1305 @b{~/.bcast/.Cinelerra_rc} file than this if they have hundreds of
1306 nodes.  Remember that .Cinelerra_rc is overwritten whenever a copy of
1307 Cinelerra exits.
1309 Select the @b{ON} column to activate and deactivate nodes once they
1310 are created.
1312 Nodes may be edited by highlighting a row and hitting @b{apply changes}.
1314 @item
1316 HOSTNAME
1318 Edit the hostname of an existing node or enter the hostname of a new
1319 node here.
1321 @item
1323 PORT
1325 Edit the port of an existing node or enter the port of a new node here.
1327 @item
1329 REPLACE NODE
1331 When editing an existing node, hit this to commit the changes to
1332 @b{HOSTNAME} and @b{PORT}.  The changes won't be committed if you
1333 don't hit this button.
1335 @item
1337 ADD NODE
1339 Create a new node with the @b{HOSTNAME} and @b{PORT} settings.
1341 @item
1343 DELETE NODE
1345 Deletes whatever node is highlighted in the @b{NODES} list.
1347 @item
1349 SORT NODES
1351 Sorts the @b{NODES} list based on the hostname.
1353 @item
1355 RESET RATES
1357 This sets the framerate for all the nodes to 0.  Frame rates are used
1358 to scale job sizes based on CPU speed of the node.  Frame rates are
1359 only calculated when renderfarm is enabled.
1366 @item
1368 TOTAL JOBS TO CREATE
1370 Determines the number of jobs to dispatch to the renderfarm.  The more
1371 jobs you create, the more finely balanced the renderfarm becomes.
1373 Determine the total jobs to create by multiplying the number of nodes
1374 including the master node by some number.  Multiply them by 1 to have
1375 one job dispatched for every node.  Multiply them by 3 to have 3 jobs
1376 dispatched for every node.  If you have 10 slave nodes and one master
1377 node, specify 33 to have a well balanced renderfarm.
1379 @end itemize
1385 @node INTERFACE
1386 @section INTERFACE
1388 These parameters affect purely how the user interface works.
1390 @itemize
1392 @item
1394 INDEX FILES GO HERE
1396 Back in the days when 4 MB/sec was unearthly speed for a hard drive,
1397 index files were introduced to speed up drawing the audio tracks.  This
1398 option determines where index files are placed on the hard drive.
1401 @item
1403 SIZE OF INDEX FILE
1405 Determines the size of an index file. Larger index sizes allow smaller
1406 files to be drawn faster while slowing down the drawing of large files.
1407 Smaller index sizes allow large files to be drawn faster while slowing
1408 down small files.
1410 @item
1412 NUMBER OF INDEX FILES TO KEEP
1414 To keep the index directory from becoming unruly, old index files are
1415 deleted. This determines the maximum number of index files to keep in
1416 the directory.
1418 @item
1420 DELETE ALL INDEXES
1422 When you change the index size or you want to clean out excessive index
1423 files, this deletes all the index files.
1425 @item
1426 USE HOURS:MINUTES:SECONDS.XXX
1428 Various representations of time are given.  Select the most convenient
1429 one.  The time representation can also be changed by @b{CTRL}
1430 clicking on the time ruler.
1432 @item
1433 USE THUMBNAILS
1435 The Resource Window displays thumbnails of assets by default.  This can
1436 take a long time to set up.  This option disables the thumbnails.
1438 @item
1439 CLICKING IN/OUT POINTS DOES WHAT
1441 Cinelerra not only allows you to perform editing by dragging in/out
1442 points but also defines three seperate operations which occur when you
1443 drag an in/out point. For each mouse button you select the behavior in
1444 this window. The usage of each editing mode is described in editing.
1446 @item
1447 MIN DB FOR METER
1449 Some sound sources have a lower noise threshold than others. 
1450 Everything below the noise threshold is meaningless.  This option sets
1451 the meters to clip below a certain level.  Consumer soundcards usually
1452 bottom out at -65.  Professional soundcards bottom out at -90.
1453 @xref{SOUND LEVEL METERS}.
1455 @item
1456 MAX DB FOR METER
1458 This sets the maximum sound level represented by the sound meters.  No
1459 matter what this value is, no soundcard can play sound over 0 db.  This
1460 value is presented merely to show how far over the limit a sound wave
1462 @xref{SOUND LEVEL METERS}.
1464 @item
1465 THEME
1467 Cinelerra supports variable themes.  Select one here and restart
1468 Cinelerra to see it.
1470 @end itemize
1474 @node ABOUT
1475 @section ABOUT
1477 This section gives you information about the copyright, the time of the
1478 current build, the lack of a warranty, and the versions of some of the
1479 libraries.  Be sure to agree to the terms of the lack of the warranty.
1487 @node CREATING A NEW PROJECT
1488 @chapter CREATING A NEW PROJECT
1490 There are 2 ways to create a new project: going to @b{File->New} or
1491 loading new files @xref{LOADING FILES}.  Once a new project is
1492 created, all the parameters can be changed later without creating a new
1493 project.  
1496 @menu
1497 * USING THE NEW PROJECT DIALOG::
1498 * CHANGING PARAMETERS AFTER LOADING::
1499 @end menu
1503 @node USING THE NEW PROJECT DIALOG
1504 @section USING THE NEW PROJECT DIALOG
1506 One way is to go to @b{File->New}.  This dialog contains the parameters
1507 for the new project.  The sections of the @b{New} dialog are described
1508 here:
1510 @itemize
1512 @item
1514 @b{Presets} - Select an option from this menu to have all the project
1515 settings set to one of the known standards.
1517 @item
1518 @b{Audio -> Tracks} - Sets the number of audio tracks the new project
1519 should have.  Tracks can be added or deleted later, but options are
1520 provided here for convenience.
1522 @item
1523 @b{Audio -> Channels} - Sets the number of audio channels the new
1524 project should have.  The number of audio channels doesn't have to be
1525 the same as the number of tracks.
1527 @item
1528 @b{Audio -> Samplerate} - Sets the samplerate of the audio.  The
1529 project samplerate doesn't have to be the same as the media sample rate
1530 that you load.  Media is resampled to match the project sample rate.
1532 @item
1533 @b{Video -> Tracks} - Sets the number of video tracks the new project
1534 should have.  Tracks can be added or deleted later, but options are
1535 provided here for convenience.
1537 @item
1538 @b{Video -> Framerate} - Sets the framerate of the video.  The project
1539 framerate doesn't have to be the same as the media frame rate that you
1540 load.  Media is reframed to match the project framerate.
1542 @item
1543 @b{Video -> Canvas size} - Sets the size of the video output.  Each
1544 track also has its own frame size.  Initially the @b{New} dialog
1545 creates video tracks whose sizes all match the video output, but the
1546 video track sizes can be changed later without changing the video
1547 output.
1549 @item
1550 @b{Video -> Aspect ratio} - Sets the aspect ratio.  The aspect ratio is
1551 applied to the video output.  The aspect ratio can be different than
1552 the number of horizontal pixels / the number of vertical pixels. 
1553 Setting a different aspect ratio than the number of pixels results in
1554 nonsquare pixels.
1556 @item
1557 @b{Video -> Auto aspect ratio} - If this is checked, the @b{New} dialog
1558 always recalculates the @b{Aspect ratio} setting when the @b{Canvas
1559 size} is changed.  This ensures pixels are always square.
1561 @item 
1562 @b{Video -> Color model} - This sets the color model video intermediates
1563 in the project will be stored in.  Color models are described in a 
1564 separate section @xref{COLOR MODEL}.
1566 @end itemize
1580 @node CHANGING PARAMETERS AFTER LOADING
1581 @section CHANGING PARAMETERS AFTER LOADING
1583 After a project is created, you have to use the set format dialog to
1584 change parameters without deleting the project.  Go to @b{Settings->Set
1585 format}.  
1587 Most of the options are identical to the @b{File->New}
1588 options except the lack of a number of tracks to create and the
1589 addition of audio channel locations.
1591 This section is discussed in @xref{SETTING PROJECT ATTRIBUTES}.
1598 @node THE MAIN WINDOWS
1599 @chapter THE MAIN WINDOWS
1601 When Cinelerra first starts, you'll get four main windows.  Hitting
1602 @b{CTRL-w} in any window closes it.
1605 @menu
1606 * VIEWER::
1607 * COMPOSITOR::
1608 * PROGRAM::
1609 * RESOURCES::
1610 * SOUND LEVEL METERS::
1611 * OTHER WINDOWS::
1612 @end menu
1614 @node VIEWER
1615 @section VIEWER
1618 In here you'll scrub around source media and clips, selecting regions
1619 to paste into the project.  Operations done in the viewer affect a
1620 temporary EDL or a clip but not the timeline.
1622 @node COMPOSITOR
1623 @section COMPOSITOR
1626 This window displays the output of the timeline.  It's the interface
1627 for most compositing operations or operations that affect the
1628 appearance of the timeline output.  Operations done in the Compositor
1629 affect the timeline but don't affect clips.
1631 The video output has several navigation functions.  The video output
1632 size is either locked to the window size or unlocked with scrollbars
1633 for navigation.  The video output can be zoomed in and out and panned. 
1634 Navigating the video output this way doesn't affect the rendered
1635 output, it just changes the point of view in the compositor window.
1637 If it is unlocked from the window size, middle clicking and dragging
1638 anywhere in the video pans the point of view.
1640 Hitting the + and - keys zooms in and out of the video output.
1642 Underneath the video output are copies of many of the functions
1643 available in the main window.  In addition there is a
1644 @image{cwindow_zoom} zoom menu and a @image{cwindow_light} tally light.
1646 The zoom menu jumps to all the possible zoom settings and, through the
1647 @b{Auto} option, locks the video to the window size.  The zoom menu
1648 does not affect the window size.
1650 The tally light turns red when rendering is happening.  This is useful
1651 for knowing if the output is current.
1653 Right clicking anywhere in the video output brings up a menu with all
1654 the zoom levels and some other options.  In this particular case the
1655 zoom levels resize the entire window and not just the video.  
1657 The @b{reset camera} and @b{reset projector} options center the camera
1658 and projector @xref{COMPOSITING}.
1660 The @b{Hide controls} option hides everything except the video.
1662 On the left of the video output is a toolbar specific to the compositor
1663 window.  Here are the functions in the toolbar:
1665 @menu
1666 * PROTECT VIDEO::
1667 * MAGNIFYING GLASS::
1668 * MASKS TOOL::
1669 * CAMERA::
1670 * PROJECTOR::
1671 * CROP TOOL::
1672 * EYEDROPPER::
1673 * TOOL INFO::
1674 * SAFE REGIONS TOOL::
1675 @end menu
1677 @node PROTECT VIDEO
1678 @subsection PROTECT VIDEO
1680 @image{protect}
1682 This disables changes to the compositor output from clicks in it.  It
1683 is an extra layer on top of the track arming toggle to prevent
1684 unwanted changes.
1686 @node MAGNIFYING GLASS
1687 @subsection MAGNIFYING GLASS
1689 @image{magnify}
1691 This zooms in and out of the compositor output without resizing the
1692 window.  If the video output is currently locked to the size of the
1693 window, clicking in it with the magnifying glass unlocks it and
1694 creates scrollbars for navigation.
1696 Left clicking in the video zooms in.
1698 Ctrl clicking in the video zooms out.
1700 Rotating the wheel on a wheel mouse zooms in and out.
1703 @node MASKS TOOL
1704 @subsection MASKS TOOL
1706 @image{mask}
1708 This brings up the mask editing tool @xref{MASKS}.  Enable the
1709 @image{toolwindow} tool window to see options for this tool.
1711 @node CAMERA
1712 @subsection CAMERA
1715 @image{camera}
1717 This brings up the camera editing tool @xref{THE CAMERA AND
1718 PROJECTOR}.  Enable the @image{toolwindow} tool window to see options
1719 for this tool.
1721 @node PROJECTOR
1722 @subsection PROJECTOR
1724 @image{projector}
1726 This brings up the projector editing tool @xref{THE CAMERA AND
1727 PROJECTOR}.  Enable the @image{toolwindow} tool window to see options
1728 for this tool.
1730 @node CROP TOOL
1731 @subsection CROP TOOL
1733 @image{crop}
1735 This brings up the cropping tool @xref{CROPPING}.  The
1736 @image{toolwindow} tool window must be enabled to use this tool.
1738 @node EYEDROPPER
1739 @subsection EYEDROPPER
1741 @image{eyedrop}
1743 This brings up the eyedropper.  The eyedropper detects whatever color
1744 is under it and stores it in a temporary area.  Enabling the
1745 @image{toolwindow} tool info shows the currently selected color.  Click
1746 anywhere in the video output to select the color at that point.
1748 The eyedropper not only lets you see areas which are clipped, but its
1749 value can be applied to many effects.  Different effects handle the
1750 eyedropper differently.
1753 @node TOOL INFO
1754 @subsection TOOL INFO
1756 @image{toolwindow}
1758 This brings up a window containing options for the currently selected
1759 tool.
1762 @node SAFE REGIONS TOOL
1763 @subsection SAFE REGIONS TOOL
1765 @image{titlesafe}
1767 This draws the safe regions in the video output.  This doesn't affect
1768 the rendered output @xref{SAFE REGIONS}.
1780 @node PROGRAM
1781 @section PROGRAM
1784 This contains the timeline and the entry point for all menu driven
1785 operations.  The timeline consists of a vertical stack of tracks with
1786 horizontal representation of time.  This defines the output of
1787 rendering operations and what is saved when you save files.  Left of
1788 the timeline is the patchbay which contains options affecting each
1789 track.
1791 Under the @b{Window} menu you'll find options affecting the main
1792 windows.  @b{default positions} repositions all the windows to a 4
1793 screen editing configuration.  On dual headed displays, the
1794 @b{default positions} operation fills only one monitor with windows.
1797 @node RESOURCES
1798 @section RESOURCES
1801 Effects, transitions, clips, and assets are accessed here.  Most of the
1802 resources are inserted into the project by dragging them out of the
1803 resource window.  Management of resource allocation is also performed
1804 here.
1806 @node SOUND LEVEL METERS
1807 @section SOUND LEVEL METERS
1809 An additional window, the @b{levels window} can be brought up from
1810 the @b{Window} menu.  The @b{levels} window displays the output
1811 audio levels after all mixing is done.
1813 Sound level meters appear in many locations.  They can be toggled in
1814 the viewer and compositor windows with the @image{show_meters} level
1815 toggle. They appear in the patchbay when a track is expanded (@xref{THE
1816 PATCHBAY}.)  They appear in the recording monitor when audio is being
1817 recorded.  
1819 The sound levels in the @b{levels window, compositor, and viewer}
1820 correspond to the final output levels before they are clipped to the
1821 soundcard range.  In the @b{record monitor} they are the input values
1822 from the sound card.  In the @b{patchbay} they are the sound levels for
1823 each track after all effects are processed and before downmixing for
1824 the output.
1826 Most of the time, audio levels have numerical markings in DB but in the
1827 patchbay there isn't enough room.
1829 The sound level is color coded as an extra means of determining the
1830 sound level.  Even without numerical markings, the sound level color
1831 can distinguish between several ranges and overload.  Look at the color
1832 codings in a meter with numerical markings to see what colors
1833 correspond to what sound level.  Then for meters in the patchbay in
1834 expanded audio tracks, use the color codings to see if it's overloading.
1836 Be aware that sound levels in Cinelerra can go above 0DB.  This allows
1837 not only seeing if a track is overloading but how much information is
1838 being lost by the overloading.  Overloading by less than 3DB is usually
1839 acceptable.  While overloading is treated as positive numbers in
1840 Cinelerra, it is clipped to 0 when sent to a sound card or file.
1842 The visible range of the sound level meters is configurable in
1843 @b{settings->preferences->interface} (@xref{INTERFACE}.)
1845 @node OTHER WINDOWS
1846 @section OTHER WINDOWS
1848 The @b{Overlays window} can be brought up from the @b{Window}
1849 menu.  This is a quick way to toggle what is drawn in the timeline. 
1850 Every option in the @b{View} menu is available here.
1858 @node LOADING AND SAVING FILES
1859 @chapter LOADING AND SAVING FILES
1862 @menu
1863 * SUPPORTED FILE FORMATS::     What formats Cinelerra can import and export
1864 * LOADING FILES::              Loading all types of files
1865 * LOADING THE BACKUP::         Recovering the session from before a crash
1866 * SAVING FILES::               Saving edit decision lists
1867 * RENDERING FILES::            Saving media files
1868 @end menu
1879 @node SUPPORTED FILE FORMATS
1880 @section SUPPORTED FILE FORMATS
1882 Here are most of the supported file formats and notes regarding their
1883 compression.  You may be able to load other formats not described here.
1885 The format of the file affects what Cinelerra does with it.  Edit
1886 decision lists replace the project settings.  Formats which contain
1887 media but no edit decisions just add data to the tracks.  If your
1888 project sample rate is 48khz and you load a sound file with 96khz,
1889 you'll still be playing it at 48khz.   If you load an EDL file at 96khz
1890 and the current project sample rate is 48khz, you'll change it to
1891 96khz.
1893 Some file formats are very slow to display on the timeline.  These
1894 usually have video which is highly compressed.  Drawing highly
1895 compressed video picons can be very slow.  Disable picon drawing for
1896 these files with the @b{draw media} toggle to speed up operations.
1899 @sp 1
1900 @image{track_attributes}
1901 @b{Track attributes}
1903 Supported file formats are currently:
1905 @itemize
1906 @item
1908 @item
1910 @item
1911 AIFF
1912 @item
1913 AC3 audio
1914 @end itemize
1916 @menu
1917 * QUICKTIME::
1918 * MPEG-4 AUDIO::
1919 * IMAGE SEQUENCES::
1920 * STILL IMAGES::
1921 * AVI::
1922 * MPEG FILES CONTAINING VIDEO::
1923 * DVD MOVIES::
1924 * MPEG 1 AUDIO::
1925 * OGG THEORA/VORBIS::
1926 * EDIT DECISION LIST::
1927 @end menu
1930 @node QUICKTIME
1931 @subsection QUICKTIME
1932 Quicktime is not the standard for UNIX but we use it because it's well
1933 documented.  All of the Quicktime movies on the internet are
1934 compressed.  Cinelerra doesn't support most compressed Quicktime movies
1935 but does support some.  If it crashes when loading a Quicktime movie,
1936 that means the format probably wasn't supported.
1938 @b{NOTES ON QUICKTIME ENCODING}
1940 Here are some notes regarding making Quicktime movies in Cinelerra:
1942 Quicktime is a wrapper for 2 codecs, a video codec and an audio codec. 
1943 The video and audio codecs are picked separately.  The preferred
1944 encoding for Quicktime output is MPEG-4 Video and MPEG-4 Audio.  This
1945 format plays in the commercial players for Windows and has good
1946 compression quality.  For better compression, use H-264 Video. 
1947 Unfortunately H-264 decoding is so slow it can't play very large frame
1948 sizes.
1950 Cinelerra supports 2 nonstandard codecs: Dual MPEG-4 video and dual
1951 H.264 video.  These won't play in anything but Cinelerra and XMovie. 
1952 They are designed for movies where the frames have been divided into 2
1953 fields, each field displayed sequentially.  The dual codecs interleave
1954 2 video streams to improve efficiency without requiring major changes
1955 to the player.
1957 @node MPEG-4 AUDIO
1958 @subsection MPEG-4 AUDIO
1960 This is the same as Quicktime with MPEG-4 Audio as the audio codec.
1962 @node IMAGE SEQUENCES
1963 @subsection IMAGE SEQUENCES
1966 Rendering an image sequence is not the same as rendering a single
1967 image.  When rendering an image sequence Cinelerra generates a table of
1968 contents file for the image sequence and makes a different image file
1969 for every timeline position.  The table of contents can be loaded
1970 instead of the individual images to get better performance.  To learn
1971 more about the different image formats supported in an image sequence,
1972 read about still images.
1975 @node STILL IMAGES
1976 @subsection STILL IMAGES
1979 Rendering a single image causes the image file to be overwritten for
1980 every timeline position.  No table of contents is created.  When
1981 loaded, the image takes up one frame in length and doesn't change the
1982 project attributes.
1984 Several still image formats not normally found in other programs are
1985 described here.
1987 @menu
1988 * OPEN EXR IMAGES::
1989 * RAW DIGITAL CAMERA IMAGES::
1990 @end menu
1992 @node OPEN EXR IMAGES
1993 @subsubsection OPEN EXR IMAGES
1995 You may not know about Open EXR.  This format stores floating point RGB
1996 images.  It also supports a small amount of compression.  Projects
1997 which render to EXR should be in a floating point color model to take
1998 advantage of it @xref{SETTING PROJECT ATTRIBUTES}.  Several compression
1999 options are available for EXR.
2001 @itemize
2003 @item
2005 @b{PIZ} Lossless wavelet compression.  This is the best compression.
2007 @item
2008 @b{ZIP} Lossless gzip algorithm.
2010 @item
2011 @b{RLE} Lossless run length encoding.  This is the fastest and worst
2012 compression.
2014 @item
2015 @b{PXR24} Lossy compression where the floating point numbers are
2016 converted to 24 bits and compressed with gzip.
2018 @end itemize
2020 Select @b{Use Alpha} if the project colormodel has an alpha channel and
2021 you want to retain it in the file.  Otherwise the primary colors are
2022 multiplied by the alpha channel.
2024 @node RAW DIGITAL CAMERA IMAGES
2025 @subsubsection RAW DIGITAL CAMERA IMAGES
2027 RAW digital camera images are a special kind of image file which
2028 Cinelerra only imports.  These must be processed in a floating point
2029 color space once they are on the timeline.  Raw images from Canon
2030 cameras are the only ones tested.  They need to have the @b{Linearize}
2031 effect applied to correct gamma.  Because raw images take a long time
2032 to interpolate, they are usually viewed first in a proxy file and then
2033 touched up.
2035 First apply the Linearize effect to a track of raw images and set it to
2036 @b{automatic} with @b{0.6} gamma.  Then render the timeline to a
2037 Quicktime JPEG file.  Append the Quicktime JPEG file in a new track and
2038 disable playback of the old track.  Now the gamma corrected copy of
2039 each raw image can be previewed relatively fast in the same timeline
2040 position as the original image.
2044 @node AVI
2045 @subsection AVI
2047 AVI with assorted audio and video codecs.  Because AVI is so
2048 fragmented, your luck will vary.
2051 @node MPEG FILES CONTAINING VIDEO
2052 @subsection MPEG FILES CONTAINING VIDEO
2055 MPEG files containing video can be loaded directly into Cinelerra.  If
2056 the file is supported, a table of contents is built.  If the file is
2057 unsupported, it usually crashes or shows very short tracks. 
2058 Unfortunately, this method of loading MPEG files isn't good enough if
2059 you intend to use the files in a renderfarm.  
2061 To use MPEG files in a renderfarm you need to run @b{mpeg3toc} to
2062 generate a table of contents for the file, then load the table of
2063 contents.  Mpeg3toc needs the absolute path of the MPEG file.  If you
2064 don't use an absolute path, it assumes the MPEG file is in the same
2065 directory that Cinelerra is run from.
2067 MPEG streams are structured into multiple tracks.  Each track can be
2068 video or audio.  Each audio track can have 1-6 channels.  Cinelerra
2069 converts each channel of audio into a track.
2071 @b{NOTES ON MPEG VIDEO ENCODING}
2073 MPEG video encoding is done separately from MPEG audio encoding.  In
2074 MPEG video there are 2 colormodels.  The YUV 4:2:0 colormodel is
2075 encoded by a highly optimized version of mpeg2enc with presets for
2076 standard consumer electronics.  In the process of optimizing mpeg2enc,
2077 they got rid of YUV 4:2:2 encoding.  The YUV 4:2:2 colormodel is
2078 encoded by a less optimized version of mpeg2enc.
2080 YUV 4:2:2 encoding was kept around because the NTSC version of DV video
2081 loses too much quality when transferred to YUV 4:2:0.  This DV video
2082 must be transferred to YUV 4:2:2.
2084 When encoding YUV 4:2:0, the bitrate parameter changes meaning
2085 depending on whether the bitrate or quantization is fixed.  If the
2086 bitrate is fixed, it's the target bitrate.  If the quantization is
2087 fixed, it's the maximum bitrate allowed.  This is a quirk of the
2088 mpeg2enc version.
2090 @node DVD MOVIES
2091 @subsection DVD MOVIES
2094 DVD's are spit into a number of programs, each identified by a unique
2095 @b{IFO} file.  If you want to load a DVD, find the corresponding
2096 @b{IFO} file for the program of interest.  Load the IFO file directly
2097 and a table of contents will be built.  Alternatively for renderfarm
2098 usage, a table of contents can be created separately.
2102 @example
2103 mpeg3toc -v /cdrom/video_ts/vts_01_0.ifo dvd.toc
2104 @end example
2106 or something similar.  Then load @b{dvd.toc}.
2110 @node MPEG 1 AUDIO
2111 @subsection MPEG 1 AUDIO
2113 These are .mp2 and .mp3 files.  If fixed bitrate, they can be loaded
2114 directly with no table of contents.  Variable bitrate streams need to
2115 have a table of contents created with @b{mpeg3toc}.
2117 @node OGG THEORA/VORBIS
2118 @subsection OGG THEORA/VORBIS
2121 The OGG format is an antiquated but supposedly unpatented way of
2122 compressing audio and video.  The quality isn't as good as H.264 or
2123 MPEG-4 Audio.  In reality, anyone with enough money and desire can find
2124 a patent violation so the justification for OGG is questionable.
2126 @node EDIT DECISION LIST
2127 @subsection EDIT DECISION LIST
2130 Edit decision lists are generated by Cinelerra for storing projects. 
2131 They end in .xml.  They change project attributes when loaded.
2133 Because edit decision lists consist of text, they can be edited in a
2134 text editor.
2153 @node LOADING FILES
2154 @section LOADING FILES
2156 All data that you work with in Cinelerra is acquired either by
2157 @b{recording from a device} or by @b{loading from disk}.  This
2158 section describes loading.
2160 The loading and playing of files is just as you would expect. Just go
2161 to @b{file->Load}, select a file for loading, and hit @b{ok}. Hit
2162 the forward play button and it should start playing, regardless of
2163 whether a progress bar has popped up.
2165 Another way to load files is to pass the filenames as arguments on the
2166 command line.  This creates new tracks for every file and starts the
2167 program with all the arguments loaded.
2169 If the file is a still image, the project's attributes are not changed
2170 and the first frame of the track becomes the image.  If the file has
2171 audio, Cinelerra may build an index file for it to speed up drawing. 
2172 You can edit and play the file while the index file is being built.
2174 @menu
2175 * INSERTION STRATEGY::
2176 * LOADING MULTIPLE FILES::
2177 @end menu
2189 @node INSERTION STRATEGY
2190 @subsection INSERTION STRATEGY
2192 Usually three things happen when you load a file.  First the existing
2193 project is cleared from the screen, second the project's attributes are
2194 changed to match the file's, and finally the new file's tracks are
2195 created in the timeline.
2197 But Cinelerra lets you change what happens when you load a file.
2199 In the file selection box go to the @b{Insertion strategy} box and
2200 select it.  Each of these options loads the file a different way.
2202 @itemize
2205 @item
2206 Replace current project
2208 All tracks in the current project are deleted and new tracks are
2209 created to match the source.  Project attributes are only changed when
2210 loading XML.  If multiple files are selected it adds new tracks for
2211 every file.
2213 @item
2214 Replace current project and concatenate tracks
2216 Same as replace current project except if multiple files are selected
2217 it concatenates the tracks of every file after the first.
2219 @item
2220 Append in new tracks
2222 The current project is not deleted and new tracks are created for the
2223 source.
2225 @item
2226 Concatenate to existing tracks
2228 The current project is not deleted and new files are concatenated to
2229 the existing tracks.
2231 @item
2232 Paste at insertion point
2234 The file is pasted in like a normal paste operation.
2236 @item
2237 Create new resources only
2239 The timeline is unchanged and new resources are created in the Resource
2240 Window.
2242 @end itemize
2245 The insertion strategy is a recurring option in many of Cinelerra's
2246 functions.  In each place the options do the same thing.  With these
2247 options you can almost do all your editing by loading files.
2249 If you load files by passing command line arguments to Cinelerra, the
2250 files are loaded with @b{Replace current project} rules.
2256 @node LOADING MULTIPLE FILES
2257 @subsection LOADING MULTIPLE FILES
2259 In the file selection box go to the list of files.  Select a file.  Go
2260 to another file and select it while holding down @b{CTRL}.  This
2261 selects one additional file.  Go to another file and select it while
2262 holding down @b{SHIFT}.  This selects every intervening file.  This
2263 behavior is available in most every list box.
2265 Select a bunch of mp3 files and @b{Replace current project and
2266 concatenate tracks} in the insertion strategy to create a song
2267 playlist.
2272 @node LOADING THE BACKUP
2273 @section LOADING THE BACKUP
2275 There is one special XML file on disk at all times.  After every
2276 editing operation Cinelerra saves the current project to a backup in
2277 @b{$HOME/.bcast/backup.xml}.  In the event of a crash go to
2278 @b{file->load backup} to load the backup.  It is important after a
2279 crash to reboot Cinelerra without performing any editing operations. 
2280 Loading the backup should be the first operation or you'll overwrite
2281 the backup.
2284 @node SAVING FILES
2285 @section SAVING FILES
2287 When Cinelerra saves a file it saves an edit decision list of the
2288 current project but doesn't save any media.  Go to @b{File->save
2289 as...}.  Select a file to overwrite or enter a new file.  Cinelerra
2290 automatically concatenates @b{.xml} to the filename if no
2291 @b{.xml} extension is given.
2293 The saved file contains all the project settings and locations of every
2294 edit but instead of media it contains pointers to the original media
2295 files on disk.
2297 For each media file the XML file stores either an absolute path or just
2298 the relative path.  If the media is in the same directory as the XML
2299 file a relative path is saved.  If it's in a different directory an
2300 absolute path is saved.
2302 In order to move XML files around without breaking the media linkages
2303 you either need to keep the media in the same directory as XML file
2304 forever or save the XML file in a different directory than the media
2305 and not move the media ever again.
2307 If you want to create an audio playlist and burn it on CD-ROM, save the
2308 XML file in the same directory as the audio files and burn the entire
2309 directory.  This keeps the media paths relative.
2311 XML files are useful for saving the current state before going to sleep
2312 and saving audio playlists but they're limited in that they're specific
2313 to Cinelerra.  You can't play XML files in a dedicated movie player. 
2314 Realtime effects in an XML file have to be resynthesized every time you
2315 play it back.  The XML file also requires you to maintain copies of all
2316 the source assets on hard drives, which can take up space and cost a
2317 lot of electricity to spin.  For a more persistent storage of the
2318 output there's rendering.
2325 @node RENDERING FILES
2326 @section RENDERING FILES
2328 Rendering takes a section of the timeline, performs all the editing,
2329 effects and compositing, and stores it in a pure movie file.  You can
2330 then delete all the source assets, play the rendered file in a movie
2331 player, or bring it back into Cinelerra for more editing.  It's very
2332 difficult to retouch any editing decisions in the pure movie file,
2333 however, so keep the original assets and XML file around several days
2334 after you render it.
2336 All rendering operations are based on a region of the timeline to be
2337 rendered.  You need to define this region on the timeline.  The
2338 navigation section describes methods of defining regions. 
2339 @xref{NAVIGATING THE PROJECT}.  The rendering functions define the
2340 region based on a set of rules.  When a region is highlighted or in/out
2341 points are set, the affected region is rendered.  When no region is
2342 highlighted, everything after the insertion point is rendered.  Merely
2343 by positioning the insertion point at the beginning of a track and
2344 unsetting all in/out points, the entire track is rendered.
2348 @menu
2349 * SINGLE FILE RENDERING::      Rendering a single file
2350 * BATCH RENDERING::            Rendering several files unattended
2351 * THE RENDER FARM::            Rendering using many computers
2352 * COMMAND LINE RENDERING::     Rendering from the command line without a GUI
2353 @end menu
2357 @node SINGLE FILE RENDERING
2358 @subsection SINGLE FILE RENDERING
2360 The fastest way to get media to disk is to use the single file
2361 rendering function.
2363 Go to @b{File->render} to bring up the render dialog.  Select the
2364 magnifying glass @image{magnify} to bring up a file selection dialog.  This determines
2365 the filename to write the rendered file to and the encoding parameters.
2367 In the render dialog select a format from the @b{File Format} menu. 
2368 The format of the file determines whether you can render audio or video
2369 or both.  Select the @b{Render audio tracks} toggle to generate
2370 audio tracks and @b{Render video tracks} to generate video tracks.
2373 Select the wrench @image{wrench} next to each toggle to set compression
2374 parameters.  If the file format can't store audio or video the
2375 compression parameters will be blank.  If @b{Render audio tracks} or
2376 @b{Render video tracks} is selected and the file format doesn't
2377 support it, trying to render will pop up an error.
2379 The @b{Create new file at each label} option causes a new file to be
2380 created when every label in the timeline is encountered.  This is
2381 useful for dividing long audio recordings into individual tracks.  When
2382 using the renderfarm, @b{Create new file at each label} causes one
2383 renderfarm job to be created at every label instead of using the
2384 internal load balancing algorithm to space jobs.
2386 When @b{Create new file at each label} is selected, a new filename
2387 is created for every output file.  If the filename given in the render
2388 dialog has a 2 digit number in it, the 2 digit number is overwritten
2389 with a different incremental number for every output file.  If no 2
2390 digit number is given, Cinelerra automatically concatenates a number to
2391 the end of the given filename for every output file.
2393 In the filename @b{/hmov/track01.wav} the @b{01} would be
2394 overwritten for every output file.  The filename
2395 @b{/hmov/track.wav}; however, would become @b{/hmov/track.wav001}
2396 and so on and so forth.  Filename regeneration is only used when either
2397 renderfarm mode is active or creating new files for every label is
2398 active.
2400 Finally the render dialog lets you select an insertion mode.  The
2401 insertion modes are the same as with loading files.  In this case if
2402 you select @b{insert nothing} the file will be written out to disk
2403 without changing the current project.  For other insertion strategies
2404 be sure to prepare the timeline to have the output inserted at the
2405 right position before the rendering operation is finished. 
2406 @xref{EDITING}.  Editing describes how to cause output to be inserted
2407 at the right position.
2409 It should be noted that even if you only have audio or only have video
2410 rendered, a @b{paste} insertion strategy will behave like a normal
2411 paste operation, erasing any selected region of the timeline and
2412 pasting just the data that was rendered.  If you render only audio and
2413 have some video tracks armed, the video tracks will get truncated while
2414 the audio output is pasted into the audio tracks.
2418 @node BATCH RENDERING
2419 @subsection BATCH RENDERING
2423 If you want to render many projects to media files without having to
2424 repeatedly attend to the @b{Render} dialog, @b{batch rendering} is the
2425 function to use.  In this function, you specify many EDL files to
2426 render and the unique output files for each.  Then Cinelerra loads each
2427 EDL file and renders it automatically, without any user intervention. 
2428 Each EDL file and its output to be rendered is called a @b{batch}. 
2429 This allows a huge amount of media to be processed and greatly
2430 increases the value of an expensive computer.
2432 The first thing to do when preparing to do batch rendering is define
2433 projects to be rendered.  The batch renderer requires a separate EDL
2434 file for every batch to be rendered.  Set up a project and define the
2435 region to be rendered either by highlighting it, setting in/out points
2436 around it, or positioning the insertion point before it.  Then save the
2437 project as an EDL.  Define as many projects as needed this way.  The
2438 batch renderer takes the active region from the EDL file for rendering.
2440 With all the EDL files prepared with active regions, go to
2441 @b{File->batch render}.  This brings up the batch rendering dialog. 
2442 The interface for batch rendering is a bit more complex than for single
2443 file rendering.
2446 A list of batches must be defined before starting a batch rendering
2447 operation.  The table of batches appears on the bottom of the batch
2448 render dialog and is called @b{batches to render}.  Above this are
2449 the configuration parameters for a single batch.
2451 Set the @b{output path}, @b{file format}, @b{Audio}, @b{Video}, and
2452 @b{Create new file at each label} parameters as if it was a single
2453 file.  These parameters apply to only one batch.  In addition to the
2454 standard rendering parameters, you must select the source EDL to use in
2455 the batch.  Do this by setting the @b{EDL path}.
2457 If the @b{batches to render} list is empty or nothing is highlighted,
2458 click @b{New} to create a new batch.  The new batch will contain all
2459 the parameters you just set.
2461 Repeatedly press the @b{New} button to create more batches with the
2462 same parameters.  Highlight any batch and edit the configuration on the
2463 top of the batch render window.  The highlighted batch is always
2464 synchronized to the information displayed.
2466 Click and drag batches to change the order in which they're rendered. 
2467 Hit @b{delete} to permanently remove the highlighted batch.
2469 In the list box is a column which enables or disables the batch.  This
2470 way batches can be skipped without being deleted.  Click on the
2471 @b{Enabled} column in the list box to enable or disable a batch.  If it
2472 is checked, the batch is rendered.  If it is blank, the batch is
2473 skipped.
2475 The other columns in the batch list are informative.
2477 @itemize
2479 @item
2480 @b{Output} The output path of the batch.
2481 @item
2482 @b{EDL} The source EDL of the batch.
2483 @item
2484 @b{Elapsed} The amount of time taken to render the batch if it is finished.
2486 @end itemize
2488 To start rendering from the first enabled batch, hit @b{Start}.
2490 Once rendering, the main window shows the progress of the batch.  Once
2491 the batch finishes, the elapsed column in the batch list is updated and
2492 the next batch is rendered until all the enabled batches are finished.
2493 The currently rendering batch is always highlighted red.
2496 To stop rendering before the batches are finished without closing the
2497 batch render dialog, hit @b{Stop}.
2499 To stop rendering before the batches are finished and close the batch
2500 render dialog, hit @b{Cancel}.
2502 To exit the batch render dialog whether or not anything is being
2503 rendered, hit @b{Cancel}.
2511 @node THE RENDER FARM
2512 @subsection THE RENDER FARM
2514 When bicubic interpolation and HDTV was first done on Cinelerra, the
2515 time needed to produce the simplest output became unbearable even on
2516 the fastest dual 1.7Ghz Xeon of the time.  Renderfarm support even in
2517 the simplest form brings HDTV times back in line with SD while making
2518 SD faster than realtime.
2520 While the renderfarm interface isn't spectacular, it's simple enough to
2521 use inside an editing suite with less than a dozen nodes without going
2522 through the same amount of hassle you would with a several hundred node
2523 farm.  Renderfarm is invoked transparently for all file->render
2524 operations when it is enabled in the preferences.
2526 Cinelerra divides the selected region of the timeline into a certain
2527 number of jobs which are then dispatched to the different nodes
2528 depending on the load balance.  The nodes process the jobs and write
2529 their output to individual files on the filesystem.  The output files
2530 are not concatenated.  It's important for all the nodes to have access
2531 to the same filesystem on the same mount point for assets.
2533 If a node can't access an input asset it'll display error messages to
2534 its console but probably not die.  If it can't access an output asset
2535 it'll cause the rendering to abort.
2537 It should be noted that in the render dialog, the @b{Create new file at
2538 each label} option causes a new renderfarm job to be created at each
2539 label instead of by the load balancer.  If this option is selected when
2540 no labels exist, only one job will be created.
2542 A Cinelerra renderfarm is organized into a master node and any number
2543 of slave nodes.  The master node is the computer which is running the
2544 GUI.  The slave nodes are anywhere else on the network and are run from
2545 the command line.  Run a slave node from the command line with 
2547 @b{cinelerra -d}
2549 That is the simplest configuration.  Type @b{cinelerra -h} to see more
2550 options.  The default port number may be overridden by passing a port
2551 number after the -d.
2554 Most of the time you'll want to bring in the rendered output and fine
2555 tune the timing on the timeline.  Also some file formats like MPEG
2556 can't be direct copied.  Because of this, the jobs are left in
2557 individual files.
2559 You can load these by creating a new track and specifying
2560 @b{concatenate to existing tracks} in the load dialog.  Files which
2561 support direct copy can be concatenated into a single file by rendering
2562 to the same file format with renderfarm disabled.  Also to get direct
2563 copy, the track dimensions, output dimensions, and asset dimensions
2564 must be equal.
2566 MPEG files or files which don't support direct copy have to be
2567 concatenated with a command line utility.  MPEG files can be
2568 concatenated with @b{cat}.
2570 Configuration of the renderfarm is described in the configuration
2571 chapter @xref{RENDERFARM}.  The slave nodes traditionally read and
2572 write data to a common filesystem over a network, thus they don't need
2573 hard drives.
2575 Ideally all the nodes on the renderfarm have similar CPU performance. 
2576 Cinelerra load balances on a first come first serve basis.  If the last
2577 segment is dispatched to the slowest node, all the fastest nodes may
2578 end up waiting for the slowest node to finish while they themselves
2579 could have rendered it faster.
2585 @node COMMAND LINE RENDERING
2586 @subsection COMMAND LINE RENDERING
2588 The command line rendering facility consists of a way to load the
2589 current set of batch rendering jobs and process them without a GUI. 
2590 This is useful if you're planning on crashing X repeatedly or want to
2591 do rendering on the other side of a low bandwidth network.  You might
2592 have access to a supercomputer in India but still be stuck in America,
2593 exhiled you might say.  A command line interface is ideal for this.
2595 To perform rendering from the command line, first run Cinelerra in
2596 graphical mode.  Go to @b{file->batch render}.  Create the batches you
2597 intend to render in the batch window and close the window.  This saves
2598 the batches in a file.  Set up the desired renderfarm attributes in
2599 @b{settings->preferences} and exit Cinelerra.  These settings are used
2600 the next time command line rendering is used.
2602 On the command line run 
2604 @b{cinelerra -r}
2606 to processes the current batch jobs without a GUI.  Setting up all the
2607 parameters for this operation is hard.  That's why the command line
2608 aborts if any output files already exist.
2610 Other parameters exist for specifying alternative files for the
2611 preferences and the batches.  Attempting to use anything but the
2612 defaults is very involved so it hasn't been tested.
2618 @node NAVIGATING THE PROJECT
2619 @chapter NAVIGATING THE PROJECT
2621 The thing you want to do most of the time is get to a certain time and
2622 place in the media.  Internally the media is organized into tracks. 
2623 Each track extends across time.  Navigation involves both getting to a
2624 track and getting to a certain time in the track.
2628 @menu
2629 * NAVIGATING THE PROGRAM WINDOW::
2630 * NAVIGATING THE VIEWER AND COMPOSITOR::
2631 * NAVIGATING THE RESOURCES::
2632 * USING THE TRANSPORT CONTROLS::
2633 * USING BACKGROUND RENDERING::
2634 @end menu
2638 @node NAVIGATING THE PROGRAM WINDOW
2639 @section NAVIGATING THE PROGRAM WINDOW
2641 The program window contains many features for navigation and displays
2642 the timeline as it is structured in memory: tracks stacked vertically
2643 and extending across time horizontall.  The horizontal scroll bar
2644 allows you to scan across time.  The vertical scroll bar allows you to
2645 scan across tracks.
2647 Below the timeline you'll find the zoom panel.  The zoom panel contains
2648 values for @b{sample zoom}, @b{amplitude}, @b{track zoom}, and
2649 @b{curve zoom}.  These values in addition to the scrollbars are the
2650 main tools for positioning the timeline.
2659 @sp 1
2661 @image{zoompanel}
2664 Changing the @b{sample zoom} causes the amount of time visible to
2665 change.  @b{If your mouse has a wheel and it works in X11 go over
2666 the tumblers and use the wheel to zoom in and out.}
2668 The @b{amplitude} only affects audio.  It determines how big the
2669 waveform is if the waveform is drawn.
2671 The @b{track zoom} affects all tracks.  It determines the height of
2672 each track.  If you change the track zoom the amplitude zoom
2673 compensates so  audio waveforms look proportional.
2675 The @b{curve zoom} affects the curves in all the tracks.  It
2676 determines the amplitude and offset of the curves.  The tumbler affects
2677 curve amplitude but the only way to change curve offset is to use the
2678 @b{fit curves} button.  @image{fit_curves,,,,}
2681 In addition to the graphical tools, you'll probably more often use the
2682 keyboard to navigate.  Use @b{PAGE UP} and @b{PAGE DOWN} to
2683 scroll up and down the tracks.
2685 Use the @b{LEFT} and @b{RIGHT} arrows to move across time in
2686 small increments.  You'll often need to scroll beyond the end of the
2687 timeline but scrollbars won't let you do it.  Instead use the
2688 @b{RIGHT} arrow to scroll past the end of timeline.
2690 Use the @b{HOME} and @b{END} keys to instantly go to the
2691 beginning or end of the timeline.  In @b{I-beam} mode, hold down
2692 shift while pressing @b{HOME} or @b{END} to select the region of
2693 the timeline between the insertion point and the key pressed.
2695 Use the @b{UP} and @b{DOWN} arrows to change the sample zoom by a
2696 power of 2.
2698 @b{CTRL-UP} and @b{CTRL-DOWN} cause the amplitude zoom to change.
2700 @b{CTRL-PGUP} and @b{CTRL-PGDOWN} cause the track zoom to change.
2702 @b{ALT-UP} and @b{ALT-DOWN} cause the curve amplitude to change.
2706 @menu
2707 * THE INSERTION POINT::
2708 * THE IN/OUT POINTS::
2709 * USING LABELS IN THE PROGRAM WINDOW::
2710 @end menu
2724 @node THE INSERTION POINT
2725 @subsection THE INSERTION POINT
2727 By default you'll see a flashing insertion point in the program window
2728 the first time you boot it up.  This is where new media is pasted onto
2729 the timeline.  It's also the starting point of all playback
2730 operations.  When rendering, it defines the region of the timeline to
2731 be rendered.
2733 The insertion point is normally moved by clicking inside the timebar. 
2734 Any region of the timebar not obscured by labels and in/out points is a
2735 hotspot for repositioning the insertion point.
2737 @sp 1
2738 @image{main_timebar,,,,}
2739 @b{The main timebar}
2741 The insertion point also can be moved by clicking in the timeline
2742 itself, but not always.  The insertion point has two modes of
2743 operation: 
2745 @itemize
2746 @item
2747 drag and drop mode 
2749 @item
2750 cut and paste mode
2752 @end itemize
2754 The mode of operation is determined by selecting the arrow or the
2755 i-beam in the buttonbar.
2757 @sp 1
2758 @image{editing_mode,,,,}
2759 @b{The editing mode buttons}
2761 If the arrow is highlighted it enables @b{drag and drop} mode.  In
2762 drag and drop mode, clicking in the timeline doesn't reposition the
2763 insertion point.  Instead it selects an entire edit.  Dragging in the
2764 timeline repositions the edit, snapping it to other edit boundaries. 
2765 This is normally useful for reordering audio playlists and moving
2766 effects around.
2768 If the i-beam is highlighted it enables @b{cut and paste mode}.  In
2769 cut and paste mode clicking in the timeline repositions the insertion
2770 point.  Dragging in the timeline highlights a region.  The highlighted
2771 region becomes the playback range during the next playback operation,
2772 the rendered range during the next render operation, and the region
2773 affected by cut and paste operations.
2775 @b{Shift-clicking} in the timeline extends the highlighted region.
2777 @b{Double-clicking} in the timeline selects the entire edit the
2778 cursor is over.
2780 It should be noted that when moving the insertion point and selecting
2781 regions, the positions are either aligned to frames or aligned to
2782 samples.  When editing video you'll want to align to frames.  When
2783 editing audio you'll want to align to samples.  This is set in
2784 @b{settings->align cursor on frames}.
2786 If the highlighted region is the region affected by cut and paste
2787 operations, how do I cut and paste in @b{drag and drop} mode?  In
2788 this case you need to set @b{in/out points} to define an affected region.
2794 @node THE IN/OUT POINTS
2795 @subsection THE IN/OUT POINTS
2797 In both editing modes you can set in/out points.  The in/out points
2798 define the affected region.  In drag and drop mode they are the only
2799 way to define an affected region.  In both cut and paste mode and drag
2800 and drop mode the highlighted area overrides the in/out points.  If a
2801 highlighted area and in/out points are set, the highlighted area is
2802 affected by editing operations and the in/out points are ignored.  If
2803 no region is highlighted, the in/out points are used.
2805 Normally, in/out points do not affect the playback region.  Only if you
2806 hold down CTRL while issuing a playback command do the in/out points
2807 determine the playback region.
2809 To set in/out points go to the timebar and position the insertion point
2810 somewhere.  Hit the @image{in_point_button} @b{in point button}.  Go
2811 to a position after the in point and hit the @image{out_point_button}
2812 @b{out point button}.
2814 @sp 1
2815 @image{inout_points} @b{Timebar with in/out points set}.
2817 Select either the in point or the out point and the insertion point
2818 jumps to that location.  After selecting an in point, if you hit the
2819 @b{in point button} the in point will be deleted.  After selecting
2820 an out point, if you hit the @b{out point button} the out point will
2821 be deleted.
2823 If you select a region somewhere else while in/out points already
2824 exist, the existing points will be repositioned when you hit the in/out
2825 buttons.
2827 @b{Shift-clicking} on an in/out point extends the highlighted region
2828 to that point.
2830 Instead of using the button bar you can use the @b{[} and @b{]}
2831 keys to toggle in/out points.
2833 The insertion point and the in/out points allow you to define an
2834 affected region but they don't let you jump to exact points on the
2835 timeline very easily.  For this purpose there are labels.
2841 @node USING LABELS IN THE PROGRAM WINDOW
2842 @subsection USING LABELS IN THE PROGRAM WINDOW
2844 Labels are an easy way to set exact locations on the timeline you want
2845 to jump to.  When you position the insertion point somewhere and hit
2846 the @image{label_button} @b{label button} a new label appears on the
2847 timeline.  
2849 @sp 1
2850 @image{timebar_label} @b{Timebar with a label on it}
2852 No matter what the zoom settings are, clicking on the label positions
2853 the insertion point exactly where you set it.  Hitting the label button
2854 again when a label is selected deletes it.
2856 @b{Shift-clicking} on a label extends the highlighted region.
2858 @b{Double-clicking} between two labels highlights the region between
2859 the labels.
2861 Hitting the @b{l} key has the same effect as the label button.
2863 If you hit the label button when a region is highlighted, two labels
2864 are toggled at each end of the highlighted region.  If one end already
2865 has a label, then the existing label is deleted and a label is created
2866 at the opposite end.
2868 Labels can reposition the insertion point when they are selected but
2869 they can also be traversed with the @image{label_traversal} @b{label
2870 traversal} buttons.  When a label is out of view, the label traversal
2871 buttons reposition the timeline so the label is visible.  There are
2872 keyboard shortcuts for label traversal, too.
2874 @b{CTRL-LEFT} repositions the insertion point on the previous label.
2876 @b{CTRL-RIGHT} repositions the insertion point on the next label.
2878 With label traversal you can quickly seek back and forth on the
2879 timeline but you can also select regions.
2881 @b{SHIFT-CTRL-LEFT} extends the highlighted region to the previous
2882 label.
2884 @b{SHIFT-CTRL-RIGHT} extends the highlighted region to the next label.
2886 Manually hitting the label button or @b{l} key over and over again
2887 to delete a series of labels can get tedious.  For deleting a set of
2888 labels, first highlight a region and second use the @b{Edit->Clear
2889 labels} function.  If in/out points exist, the labels between the
2890 in/out points are cleared and the highlighted region ignored.
2899 @node NAVIGATING THE VIEWER AND COMPOSITOR
2900 @section NAVIGATING THE VIEWER AND COMPOSITOR
2902 The navigation features of the Viewer and Compositor behave very
2903 similarly.  Each has a timebar and slider below the video output.  The
2904 timebar and slider are critical for navigation.
2906 @sp 1
2908 @image{timebarslider,,,,}
2910 The timebar represents the entire time covered by the program.  When
2911 you define labels and in/out points it defines those, too.  Finally the
2912 timebar defines a region known as the @b{preview region}.
2914 The @b{preview region} is the region of the timeline which the
2915 slider effects.  The slider only covers the time covered by the preview
2916 region.  By using a preview region inside the entire program and using
2917 the slider inside the preview region you can quickly and precisely seek
2918 in the compositor and viewer.
2920 When you replace the current project with a file the preview region
2921 automatically resizes to cover the entire file.  When you append data
2922 or change the size of the current project, the preview region stays the
2923 same size and shrinks.  Therefore, you need to resize the preview
2924 region.
2926 Load a file and then slide around it using the compositor slider.  The
2927 insertion point in the main window follows the compositor.  Move the
2928 pointer over the compositor's timebar until it turns into a left resize
2929 pointer.  The click and drag right.  The preview region should have
2930 changed and the slider resized proportionally.
2932 Go to the right of the timebar until a right resize pointer appears. 
2933 Drag left so the preview region shrinks.
2935 Go to the center of the preview region in the timebar and drag it
2936 around to convince yourself if can be moved.
2939 @sp 1
2941 @image{previewregion,,,,}
2943 @b{Preview region in compositor}
2945 If you go to the slider and slide it around with the preview region
2946 shrunk, you'll see the slider only affects the preview region.  The
2947 timebar and slider in the viewer window work exactly the same.
2949 Labels and in/out points are fully supported in the viewer and
2950 compositor.  The only difference between the viewer and compositor is
2951 the compositor reflects the state of the program while the viewer
2952 reflects the state of a clip but not the program.
2954 When you hit the @b{label button} in the compositor, the label
2955 appears both in the compositor timebar and the program timebar.
2957 When you select a label or in/out point in the compositor, the program
2958 window jumps to that position.
2960 @sp 1
2961 @image{viewer_labels} @b{Labels and in/out points in the viewer}.
2963 In the viewer and compositor, labels and in/out points are displayed in
2964 the timebar.  Instead of displaying just a region of the program, the
2965 timebar displays the entire program here.
2969 Like the Program window, the Compositor has a zoom capability.  First,
2970 the pulldown menu on the bottom of the compositor window has a number
2971 of zoom options.  When set to @b{Auto} the video is zoomed to match
2972 the compositor window size as closely as possible.  When set to any
2973 other percentage, the video is zoomed a power of 2 and scrollbars can
2974 be used to scroll around the output.  When the video is zoomed bigger
2975 than the window size, not only do scrollbars scan around it but
2976 @b{middle mouse button} dragging in the video output scans around
2977 it.  This is exactly when The Gimp does.
2979 Furthermore, the zoom @image{magnify} toggle causes the Compositor
2980 window to enter zoom mode.  In zoom mode, clicking in the video output
2981 zooms in while @b{ctrl-clicking} in the video output zooms out.  If
2982 you have a wheel mouse, rotating the wheel zooms in or out too.
2984 Zooming in or out with the zoom tool does not change the rendered
2985 output, mind you.  It's merely for scrutinizing video or fitting it in
2986 the desktop.
2993 @node NAVIGATING THE RESOURCES
2994 @section NAVIGATING THE RESOURCES
2996 The resource window is divided into two areas.  One area lists folders
2997 and another area lists folder contents.  Going into the folder list and
2998 clicking on a folder updates the contents area with the contents of
2999 that folder.
3001 The folder and contents can be displayed as icons or text.
3003 @b{Right clicking} in the folder or contents area brings up a menu
3004 containing formatting options.  Select @b{Display text} to display a
3005 text listing.  Select @b{Sort items} to sort the contents of the
3006 folder alphabetically.
3015 @node USING THE TRANSPORT CONTROLS
3016 @section USING THE TRANSPORT CONTROLS
3018 Transport controls are just as useful in navigation as they are in
3019 playing back footage, hence they are described here in the navigation
3020 section.  Each of the Viewer, Compositor, and Program windows has a
3021 transport panel.
3023 @sp 1
3024 @image{transport_panel} @b{The transport panel}.
3026 The transport panel is controlled by the keyboard as well as the
3027 graphical interface.  For each of the operations it performs, the
3028 starting position is the position of the insertion point in the Program
3029 window and the slider in the Compositor window.  The ending position is
3030 either the end or start of the timeline or the end or start of the
3031 selected region if there is one.
3033 The orientation of the end or start depends on the direction of
3034 playback.  If it's forward the end position is the end of the selected
3035 region.  If it's backward the end position is the start of the selected
3036 region.
3038 The insertion point moves to track playback.  When playback stops, the
3039 insertion point stays where playback stopped.  Thus, by playing back
3040 you change the position of the insertion point.
3042 The keyboard interface is usually the fastest and has more speeds.  The
3043 transport keys are arranged in a sideways @b{T} on the number pad.
3045 @itemize
3047 @item
3048 @b{+} Fast reverse
3049 @item
3050 @b{6} Normal reverse
3051 @item
3052 @b{5} Slow reverse
3053 @item
3054 @b{4} Frame reverse
3055 @item
3056 @b{1} Frame forward
3057 @item
3058 @b{2} Slow forward
3059 @item
3060 @b{3} Normal forward
3061 @item
3062 @b{Enter} Fast forward
3063 @item
3064 @b{0} Stop
3065 @item
3066 @b{Spacebar} Normal forward
3067 @end itemize
3069 Hitting any key on the keyboard twice pauses it.
3071 When using frame advance functions the behavior may seem odd.  If you
3072 frame advance forward and then frame advance backward, the displayed
3073 frame doesn't change.  This is because the playback position isn't the
3074 frame but the time between two frames.  The rendered frame is the area
3075 that the playback position crosses.  When you increment the time
3076 between two frames by one and decrement it by one, you cross the same
3077 frame both times and so the same frame is displayed.
3079 The transport behavior changes if you hold down CTRL when issuing any
3080 of the transport commands.  This causes the starting point to be the in
3081 point if playing forward and the out point if playing backward.  If
3082 playing forward, the out point becomes the ending point and if playing
3083 backward, the in point becomes the ending point.  If no in/out points
3084 are specified, the behavior falls back to using the insertion point and
3085 track boundaries as the starting and ending points.
3089 @node USING BACKGROUND RENDERING
3090 @section USING BACKGROUND RENDERING
3094 Background rendering allows impossibly slow effects to play back in
3095 realtime shortly after the effect is pasted in the timeline.  It
3096 continuously renders temporary output.  When renderfarm is enabled,
3097 background rendering uses the renderfarm continuously.  This way, any
3098 size video can be seen in realtime merely by creating a fast enough
3099 network with enough nodes.
3101 Background rendering is enabled in settings->preferences->performance. 
3102 It has one interactive function: @b{settings->set background render}.  This
3103 sets the point where background rendering begins to where the in point
3104 is.  If any video exists, a red bar appears in the time bar showing
3105 what has been background rendered.
3107 It's often useful to insert an effect or a transition and then select
3108 settings->set background render right before the effect to preview it
3109 in full framerates.
3113 @node EDITING
3114 @chapter EDITING
3117 Editing comprises both the time domain and the track domain.  Since the
3118 timeline consists of a stack of tracks, you need to worry about how to
3119 sort and create tracks in addition to what time certain media appears
3120 on a track.
3122 In the time domain, Cinelerra offers many ways to approach the editing
3123 process.  The three main methods are two screen editing, drag and drop
3124 editing, and cut and paste editing.
3126 There are several concepts Cinelerra uses when editing which apply to
3127 all the methods.  The @b{timeline} is where all editing decisions are
3128 represented.  This is a stack of tracks in the center of the main
3129 window.  It can be scrolled up, down, left and right with the
3130 scrollbars on the right and bottom of it.  It can also be scrolled up
3131 and down with a mouse wheel.
3133 The @b{active region} is the range of time which is affected by editing
3134 commands on the timeline.  The active region is determined first by the
3135 presence of in/out points in the timeline.  If those don't exist the
3136 highlighted region is used.  If no highlighted region exists the
3137 insertion point is used as the start of the active region.  Some
3138 commands treat all the space to the right of the insertion point as
3139 active, like @b{Render}, while others treat the active length as 0 if no
3140 end point for the active region is defined.
3142 Finally, editing decisions never affect source material.  This is
3143 @b{non destructive editing} and it became popular with audio because it
3144 was much faster than if you had to copy all the media affected by an
3145 edit.  Editing only affects pointers to source material, so if you want
3146 to have a media file at the end of your editing session which
3147 represents the editing decisions, you need to @b{render} it.
3148 @xref{RENDERING FILES}.
3150 Every track on the timeline has a set of attributes on
3151 the left, the most important of which is the @b{arm track}
3152 attribute.
3156 @menu
3157 * THE PATCHBAY::           Enabling different features on different tracks
3158 * NUDGING TRACKS::         Move entire tracks horizontally
3159 * PANNING TRACKS::         Changing the audio output channels
3160 * AUTOMATIC TRACK PANNING::  Panning tracks to common speaker arrangements
3161 * STANDARD AUDIO MAPPINGS::  Making audio panning that works on other players.
3162 * MANIPULATING TRACKS::    Moving whole tracks around
3163 * TWO SCREEN EDITING::     Using two video windows to edit
3164 * DRAG AND DROP EDITING::  Dragging objects to edit
3165 * CUT AND PASTE EDITING::  Editing media like text
3166 * TRIMMING::               Changing in and out points
3167 @end menu
3170 @node THE PATCHBAY
3171 @section THE PATCHBAY
3174 On the left of the timeline is a region affectionately known as the
3175 patchbay.  The patchbay enables features specific to each track.  All
3176 tracks have a text area for naming the track.
3178 All tracks have an @b{expander} @image{expandpatch_checked} for viewing
3179 more options and for viewing the effects on the track.  Click on the
3180 expander to expand or collapse the track.  If it's pointing sideways,
3181 the track is collapsed.  If it's pointing down, the track is expanded. 
3182 The effects appear below the media for the track if they exist.
3184 All tracks have the following row of toggles for several features.
3186 @sp 1
3187 @image{track_attributes}
3188 @b{Track attributes}
3191 If the toggle is colored, it is enabled.  If the toggle is the
3192 background color of most of the windows, it is disabled.  Click on the
3193 toggle to enable or disable the feature.  Several mouse operations
3194 speed up the configuration of several tracks at a time.
3196 Click on an attribute and drag across adjacent tracks to copy the same
3197 attribute to those tracks.
3199 Hold down @b{shift} while clicking a track's attribute to enable the
3200 attribute in the current track and toggle the attribute in all the
3201 other tracks.
3203 Hold down @b{shift} while clicking an attribute.  Click until all the
3204 tracks except the selected one are disabled.  Then drag the cursor over
3205 the adjacent track to enable the attribute in the adjacent track.
3208 The other attributes affect the output of the track.
3210 @itemize
3212 @item
3214 @b{Play track} determines whether the track is rendered or not.  If
3215 it's off, the track is not rendered.  However, if the track is chained
3216 to any other tracks, the other tracks perform all the effects in the
3217 chained track, regardless of play status.
3218 @sp 1
3220 @item
3222 @b{Arm track} determines whether the track is armed or not.   Only the
3223 @b{armed tracks} are affected by editing operations.  Make sure you
3224 have enough armed destination tracks when you paste or splice material
3225 or some tracks in the material will get left out.
3227 In addition to restricting editing operations, the armed tracks in
3228 combination with the active region determine where material is inserted
3229 when loading files.  If the files are loaded with one of the insertion
3230 strategies which doesn't delete the existing project, the armed tracks
3231 will be used as destination tracks.
3233 Press @b{Tab} while the cursor is anywhere over a track to toggle the
3234 track arming status.
3236 Press @b{Shift-Tab} while the cursor is over a track to toggle the
3237 arming status of every other track.
3239 @item
3241 @b{Gang fader} causes the fader to track the movement of whatever other
3242 fader you're adjusting.  A fader is only ganged if the @b{arm track} is
3243 also on.  This is normally used to adjust audio levels on all the
3244 tracks simultaneously.  Gang also causes @b{Nudge} parameters to
3245 synchronise across all the ganged tracks.
3248 @sp 1
3250 @item
3252 @b{Draw media} determines if picons or waveforms are drawn on the
3253 track.  By default, some file formats load with this off while other
3254 file formats load with it on.  This depends on whether the file format
3255 takes a long time to draw on the timeline.  Merely set it to on if you
3256 want to see picons for any file format.
3257 @sp 1
3259 @item
3261 @b{Mute track} causes the output to be thrown away once the track is
3262 completely rendered.  This happens whether or not @b{play track} is
3263 on.  If the track is part of an effect chain, the output of the effect
3264 chain track is overlayed on the final output even though it's routed
3265 back to another track.  Mute track is used to keep the effect chain
3266 track from overlapping the output of the source track.
3267 @sp 1
3269 @item
3271 @b{Fader} All tracks have a fader, but the units of each fader depend
3272 on whether it's audio or video.  Click and drag the fader to fade the
3273 track in and out.  If it is ganged to other tracks of the same media
3274 type, with the @b{arm} option enabled, the other faders should follow.
3276 Hold down @b{shift} and drag a fader to center it on 0.
3278 @end itemize
3282 @node NUDGING TRACKS
3283 @section NUDGING TRACKS
3285 Each track has a nudge textbox in its patchbay.  You may have to expand
3286 the track to see it.  These are views of the patchbays when expanded.
3288 @image{apatches}
3290 Pan and nudge for an audio track.
3292 @image{vpatches}
3294 Overlay mode and nudge for a video track.
3297 The nudge is the amount the track is shifted left or right during
3298 playback.  The track is not displayed shifted on the timeline, but it
3299 is shifted when it's played back.  This is useful for synchronizing
3300 audio with video, creating fake stereo, or compensating for an effect
3301 which shifts time, all without tampering with any edits.
3303 Merely enter in the amount of time to shift by to instantly shift the
3304 track.  Negative numbers make the track play later.  Positive numbers
3305 make the track play sooner.  The nudge units are either @b{seconds} or
3306 the native units for the track.  Select the units by @b{right clicking}
3307 on the nudge textbox and using the context sensitive menu.
3309 Nudge settings are ganged with the @b{Gang faders} toggle and the
3310 @b{Arm track} toggle.
3312 Use the mouse wheel over the nudge textbox to increment and decriment
3319 @node PANNING TRACKS
3320 @section PANNING TRACKS
3322 Audio tracks have a panning box in their patchbay.  It may have to be
3323 expanded to see it.  The panning box is shown here.
3325 @image{apatches}
3327 Pan and nudge for an audio track.
3329 Position the pointer in the panning box and click/drag to reposition
3330 the audio output among the speaker arrangement.  The loudness of each
3331 speaker is printed during the dragging operation.  The panning box uses
3332 a special algorithm to try to allow audio to be focused through one
3333 speaker or branched between the nearest speakers when more than 2
3334 speakers are used.
3338 @node AUTOMATIC TRACK PANNING
3339 @section AUTOMATIC TRACK PANNING
3342 Several convenience functions are provided for automatically setting
3343 the panning to several common standards.  They are listed in the
3344 @b{Audio} menu.  These functions only affect audio tracks with
3345 @b{recording} enabled.
3347 @b{Audio->Map 1:1} - This maps every track to its own channel and wraps
3348 around when all the channels are allocated.  It's most useful for
3349 making 2 tracks with 2 channels map to stereo and for making 6 tracks
3350 with 6 channels map to a 6 channel soundcard.
3352 @b{Audio->Map 5.1:2} - This maps 6 tracks to 2 channels.  The project
3353 should have 2 channels when using this function.  Go to
3354 @b{Settings->format} to set the output channels to 2.  This is most
3355 useful for downmixing 5.1 audio to stereo.
3361 @node STANDARD AUDIO MAPPINGS
3362 @section STANDARD AUDIO MAPPINGS
3364 Although Cinelerra lets you map any audio track to any speaker, there
3365 are standard mappings you should use to ensure the media can be played
3366 back elsewhere.  Also, most audio encoders require the audio tracks to
3367 be mapped to standard speaker numbers or they won't work.
3369 In the @b{channel position} widget @xref{SETTING PROJECT ATTRIBUTES},
3370 the channels are numbered to correspond to the output tracks they are
3371 rendered to.  For stereo, the source of channel 1 needs to be the left
3372 track and the source of channel 2 needs to be the right track.
3374 For 5.1 surround sound, the sources of the 6 channels need to be in the
3375 order of center, front left, front right, back left, back right, low
3376 frequency effects.  If the right tracks aren't mapped to the right
3377 speakers, most audio encoders won't encode the right information if
3378 they encode anything at all.  The low frequency effects track
3379 specifically can't store high frequencies in most cases.
3385 @node MANIPULATING TRACKS
3386 @section MANIPULATING TRACKS
3388 Tracks in Cinelerra either contain audio or video.  There is no special
3389 designation for tracks other than the type of media they contain.  When
3390 you create a new project, it contains a certain mumber of default
3391 tracks.  You can still add or delete tracks from a number of menus. 
3392 The @b{Tracks} menu contains a number of options for dealing with
3393 multiple tracks simultaneously.  Each track itself has a popup menu
3394 which affects one track.
3396 Bring up the popup menu by moving over a track and right clicking.  The
3397 popup menu affects the track whether it's armed or not.
3399 @b{Move up} and @b{move down} moves the one track up or down in
3400 the stack.  @b{Delete track} deletes the track.
3402 Operations in the @b{Tracks} menu affect only tracks which are
3403 armed.
3405 @b{Move tracks up} and @b{Move tracks down} shift all the armed
3406 tracks up or down the stack.
3408 @b{Delete tracks} deletes the armed tracks.
3410 @b{Delete last track} deletes the last track, whether it's armed or
3411 not.  Holding down the @b{d} key quickly deletes all the tracks.
3413 @b{Concatenate tracks} is more complicated.  It takes every
3414 @b{playable} track and concatenates it to the end of the first
3415 @b{armed tracks}.  If there are two armed tracks followed by two
3416 playable tracks, the concatenate operation puts the two playable tracks
3417 after the two armed tracks.  If there are three playable tracks
3418 instead, two tracks are put after the armed tracks and a third track is
3419 put on the end of the first armed track.  The destination track wraps
3420 around until all the playable tracks are concatenated.
3422 Finally, you'll want to create new tracks.  The @b{Audio} and
3423 @b{Video} menus each contain an option to add a track of their
3424 specific type.  In the case of audio, the new track is put on the
3425 bottom of the timeline and the output channel of the audio track is
3426 incremented by one.  In the case of video, the new track is put on the
3427 top of the timeline.  This way, video has a natural compositing order. 
3428 New video tracks are overlayed on top of old tracks.
3438 @node TWO SCREEN EDITING
3439 @section TWO SCREEN EDITING
3441 This is the fastest way to construct a program out of movie files.  The
3442 idea consists of viewing a movie file in one window and viewing the
3443 program in another window.  Sections of the movie file are defined in
3444 one window and transferred to the end of the program in the other
3445 window.
3447 The way to begin a two screen editing session is to load some
3448 resources.  In @b{file->load} load some movies with the insertion
3449 mode @b{create new resources}.  You want the timeline to stay
3450 unchanged while new resources are brought in.  Go to the Resource
3451 Window and select the @b{media} folder.  The newly loaded resources
3452 should appear.  Drag a resource from the media side of the window over
3453 the Viewer window.
3455 There should be enough armed tracks on the timeline to put the sections
3456 of source material that you want.  If there aren't, create new tracks
3457 or arm more tracks.
3459 In the viewer window seek to the starting point of a clip you want to
3460 use.  Use either the @b{slider} or the @b{transport controls}. 
3461 Use the @b{preview region} to narrow down the search.  Set the
3462 starting point with the @image{in_point_button} @b{in point button}.
3464 Seek to the ending point of the clip you want to use.  Set the ending
3465 point with the @image{out_point_button} @b{out point button}.  The
3466 two points should now appear on the timebar and define a clip.
3468 There are several things you can do with the clip now.
3470 @itemize
3472 @item
3474 Splice @image{splice_button} inserts the clip in the timeline, pushing
3475 everything back.  If an @b{in point} or @b{out point} exists on
3476 the timeline it's inserted there, otherwise it's inserted after the
3477 insertion point.  After that, the insertion point moves to the end of
3478 the clip.  If there is no in/out point, the insertion point will be
3479 used as the next splice location.  This way you can continuously build
3480 up the program by splicing.
3482 @item
3484 Overwrite @image{overwrite_button} overwrites the region of the
3485 timeline with the clip.  If an @b{in point} or @b{out point}
3486 exists on the timeline it's overwritten there, otherwise it's
3487 overwritten after the insertion point.  If a region is highlighted or
3488 both in and out points exist the difference between the active region
3489 and the clip length is deleted.
3493 @item
3495 Create a clip @image{toclip_button} generates a new clip for the
3496 resource window containing the affected region but doesn't change the
3497 timeline.  Every clip has a title and a description.  These are
3498 optional.
3500 @item
3502 Copy behaves the same as in cut and paste editing.
3504 @end itemize
3506 Two screen editing can be done purely by keybard shortcuts.  When you
3507 move the pointer over any button a tooltip should appear, showing what
3508 key is bound to that button.  In the Viewer window, the number pad keys
3509 control the transport and the @b{[ ] v} keys perform in/out points
3510 and splicing.
3522 @node DRAG AND DROP EDITING
3523 @section DRAG AND DROP EDITING
3525 The answer is yes, you can you create a bunch of clips and drag them on
3526 the timeline.  You can also drag edits around the timeline.
3528 Load some files using @b{file->load}.  Set the insertion mode to
3529 @b{Create new resources}.  This loads the files into the Resource
3530 Window.  Create some audio and video tracks on the timeline using the
3531 video and audio menus.
3533 Open the @b{Media} folder in the resource window.  Drag a media file
3534 from the resource window to the timeline.  If the media has video, drag
3535 it onto a video track.  If the media is pure audio, drag it onto an
3536 audio track.
3538 Cinelerra fills out the audio and video tracks below the dragging
3539 cursor with data from the file.  This affects what tracks you should
3540 create initially and which track to drag the media onto.  If the media
3541 has one video track and two audio tracks, you'll need one video track
3542 and two audio tracks on the timeline and the media should be dragged
3543 over the first video track.  If the media has audio only you'll need
3544 one audio track on the timeline for every audio track in the media and
3545 the media should be dragged over the first audio track.
3547 When dragging, the media snaps to the start of track if the track is
3548 empty.  If there are edits on the track, the media snaps to the nearest
3549 edit boundary.
3551 You can also drag multiple files from the resource window.  Either draw
3552 a box around the files, use SHIFT, or use CTRL when selecting files. 
3553 When you drop the files in the timeline, they are concatenated.  The
3554 behavior of SHIFT and CTRL changes depending on if the resources are in
3555 text or icons.
3557 To display the resources as text or icons, right click inside the media
3558 list.  Select either @b{display icons} or @b{display text} to
3559 change the list format.
3561 When displaying text in the resource window @b{SHIFT-clicking} on
3562 media files extends the number of highlighted selections. 
3563 @b{CTRL-clicking} on media files in text mode selects additional
3564 files one at a time.
3566 When displaying icons in the resource window @b{SHIFT-clicking} or
3567 @b{CTRL-clicking} selects media files one at a time.
3569 In addition to dragging media files, if you create clips and open the
3570 @b{clip} folder you can drag clips on the timeline.
3572 In the timeline there is further dragging functionality.  To enable the
3573 dragging functionality of the timeline, select the arrow toggle
3574 @image{arrow}.  Move over an edit and drag it.  If more than one
3575 track is armed, Cinelerra will drag any edits which start on the same
3576 position as the edit the cursur is currently over.  During a dragging
3577 operation the edit snaps to the nearest boundary.
3579 Dragging edits around the timeline allows you to sort music playlists,
3580 sort movie scenes, and give better NAB demos but not much else.
3592 @node CUT AND PASTE EDITING
3593 @section CUT AND PASTE EDITING
3595 This is the traditional method of editing in audio editors.  In the
3596 case of Cinelerra, you either need to start a second copy of Cinelerra
3597 and copy from one copy to the other, copy from different tracks in the
3598 same copy, or load a media file into the Viewer and copy from there.
3600 Load some files onto the timeline.  To perform cut and paste editing
3601 select the @image{ibeam} i-beam toggle.  Select a region of the
3602 timeline and select the @image{cut} cut button to cut it.  Move the
3603 insertion point to another point in the timeline and select the
3604 @image{paste} paste button.  Assuming no in/out points are defined on
3605 the timeline this performs a cut and paste operation.
3607 If in/out points are defined, the insertion point and highlighted
3608 region are overridden by the in/out points for clipboard operations. 
3609 Thus, with in/out points you can perform cut and paste in drag and drop
3610 mode as well as cut and paste mode.
3612 When editing audio, it is customary to cut from one part of a waveform
3613 into the same part of another waveform.  The start and stop points of
3614 the cut are identical in each waveform and might be offset slightly,
3615 while the wave data is different.  It would be very hard to highlight
3616 one waveform to cut it and highlight the second waveform to paste it
3617 without changing the relative start and stop positions.
3619 One option for simplifying this is to open a second copy of Cinelerra,
3620 cutting and pasting to transport media between the two copies.  This
3621 way two highlighed regions can exist simultanously.
3623 Another option is to set in/out points for the source region of the
3624 source waveform and set labels for the destination region of the
3625 destination waveform.  Perform a cut, clear the in/out points, select
3626 the region between the labels, and perform a paste.
3630 A final operation in cut and paste editing is the @b{edit->clear}
3631 operation.  If a region is highlighted or in/out points exist, the
3632 affected region is cleared by @b{edit->clear}.  But if the insertion
3633 point is over an edit boundary and the edits on each side of the edit
3634 boundary are the same resource, the edits are combined into one edit
3635 comprised by the resource.  The start of this one edit is the start of
3636 the first edit and the end of this one edit is the end of the second
3637 edit.  This either results in the edit expanding or shrinking.
3643 @node TRIMMING
3644 @section TRIMMING
3646 With some edits on the timeline it's possible to do trimming.  By
3647 trimming you shrink or grow the edit boundaries by dragging them.  In
3648 either drag and drop mode or cut and paste mode, move the cursor over
3649 an edit boundary until it changes shape.  The cursor will either be an
3650 expand left or an expand right.  If the cursor is an expand left, the
3651 dragging operation affects the beginning of the edit.  If the cursor is
3652 an expand right, the dragging operation affects the end of the edit.
3654 When you click on an edit boundary to start dragging, the mouse button
3655 number determines which dragging behavior is going to be followed.  3
3656 possible behaviors are bound to mouse buttons in the interface
3657 preferences. @xref{INTERFACE}.
3659 The effect of each drag operation not only depends on the behavior
3660 button but whether the beginning or end of the edit is being dragged.
3661 When you release the mouse button, the trimming operation is performed.
3663 In a @b{Drag all following edits} operation, the beginning of the
3664 edit either cuts data from the edit if you move it forward or pastes
3665 new data from before the edit if you move it backward.  The end of the
3666 edit pastes data into the edit if you move it forward or cuts data from
3667 the end of the edit if you move it backward.  All the edits thereafter
3668 shift.  Finally, if you drag the end of the edit past the start of the
3669 edit, the edit is deleted.
3671 In a @b{Drag only one edit} operation, the behavior is the same when
3672 you drag the beginning or end of an edit.  The only difference is none
3673 of the other edits in the track shift.  Instead, anything adjacent to
3674 the current edit expands or shrinks to fill gaps left by the drag
3675 operation.
3677 In a @b{Drag source only} operation, nothing is cut or pasted.  If
3678 you move the beginning or end of the edit forward, the source reference
3679 in the edit shifts forward.  If you move the beginning or end of the
3680 edit backward, the source reference shifts backward.  Where the edit
3681 appears in the timeline remains the same but the source shifts.
3683 For all file formats besides still images, the extent of the trimming
3684 operation is clamped to the source file length.  Attempting to drag the
3685 start of the edit beyond the start of the source clamps it to the
3686 source start.
3688 In all trimming operations, all edits which start on the same position
3689 as the cursor when the drag operation begins are affected.  Unarm
3690 tracks to prevent edits from getting affected.
3699 @node USING EFFECTS
3700 @chapter USING EFFECTS
3702 It would be sufficient to perform all changes to the timeline using
3703 editing operations, but this isn't very extensible.  Certain timeline
3704 changes should produce a different effect in the output without
3705 involving a unique procedure to apply each change.  This is why we have
3706 effects.
3708 Effects fall into three categories, and each effect in a category is
3709 applied using the same procedure.
3712 @menu
3713 * REALTIME EFFECTS::
3714 * RENDERED EFFECTS::
3715 * TRANSITIONS::
3716 * LADSPA EFFECTS::
3717 @end menu
3721 @node REALTIME EFFECTS
3722 @section REALTIME EFFECTS
3724 These are layered under the track they apply to.  They process the
3725 track when the track is played back, with no permanent storage of the
3726 output except when the project is rendered.
3728 All the realtime effects are listed in the resource window, divided
3729 into two groups: audio effects and video effects.  Audio effects should
3730 be dragged from the resource window onto audio tracks.  Video effects
3731 should be dragged onto video tracks.
3733 If there is data on the destination track, the effect is applied to the
3734 entire track.  If there is no data on the track the effect is deleted. 
3735 Finally, if a region of the track is selected the effect is pasted into
3736 the region, regardless of whether there is data.
3738 Some of the effects don't process data but synthesize data.  In the
3739 case of a synthesis effect, you'll want to select a region of the
3740 track so the dragging operation pastes it without deleting it.
3742 When dragging more than one effect onto a track, you'll see the effects
3743 layering from top to bottom, on the bottom of the track.   When the
3744 track is played back, effects are processed from top to bottom.  The
3745 output of the top effect becomes the input of the bottom effect and so
3746 on and so forth.
3748 In addition to dragging from the resource window, effects may be
3749 applied to a track by a popup menu.  Right click on a track and select
3750 @b{Attach effect} from the popup.  The attach effect dialog gives
3751 you more control than pure dragging and dropping.  For one thing, the
3752 attach effect dialog lets you attach two more types of effects: shared
3753 effects and shared tracks.  Select a plugin from the @b{Plugins}
3754 column and hit @b{Attach} under the plugins column to attach it. 
3755 The effect is the same as if the effect was dragged from the resource
3756 window.
3758 When an effect exists under a track, it most often needs to be
3759 configured.  Go to the effect and right click on it to bring up the
3760 effect popup.  In the effect popup is a @b{show} option.  The show
3761 option causes the GUI for the effect to appear under the cursor.  Most
3762 effects have GUI's but some don't.  If the effect doesn't have a GUI,
3763 nothing pops up when the @b{show} option is selected.  When you
3764 tweek parameters in the effect GUI, the parameters normally effect the
3765 entire duration of the effect.
3768 @menu
3769 * REALTIME EFFECT TYPES::
3770 * EDITING REALTIME EFFECTS::
3771 @end menu
3775 @node REALTIME EFFECT TYPES
3776 @subsection REALTIME EFFECT TYPES
3778 The two other effect types supported by the Attach Effect dialog are
3779 recycled effects.  In order to use a recycled effect, three requiremenets
3780 must be met:
3782 @itemize
3784 @item
3785 There must be other effects in the timeline.
3787 @item
3789 The other effects must be of the same type as the track you're
3790 attaching an effect to.  If the track is an audio track, the effects
3791 must be audio effects.  If the track is a video track, the effects must
3792 be video effects.
3794 @item
3796 The insertion point or selected region must start inside the other effects.
3798 @end itemize
3800 In the case of a shared effect, these conditions must be true.  In the
3801 case of a shared track, there merely must be another track on the
3802 timeline of the same type as the track you're applying an effect to. 
3803 If you right clicked on a video track to attach an effect, there won't
3804 be anything in the @b{shared tracks} column if no other video track
3805 exists.  If you right clicked on an audio track there won't be anything
3806 in the shared track column if no other audio track exists.
3808 If shared effects or shared tracks are available, they appear in the
3809 @b{shared effects} and @b{shared tracks} columns.  The
3810 @b{attach} button under each column causes anything highlighted in
3811 the column to be attached under the current track.
3813 Shared effects and shared tracks allow very unique things to be done. 
3814 In the case of a shared effect, the shared effect is treated like a
3815 copy of the original effect except in the shared effect the GUI can't
3816 be brought up.  All configuration of the shared effect is determined by
3817 the GUI of the original effect and only the GUI of the original effect
3818 can be brought up.
3820 When a shared effect is played back, it's processed just like a normal
3821 effect except the configuration is copied from the original effect. 
3822 Some effects detect when they are being shared, like the reverb effects
3823 and the compressor.  These effects determine what tracks are sharing
3824 them and either mix the two tracks together or use one track to stage
3825 some value.  The reverb mixes tracks together to simulate ambience. 
3826 The compressor uses one of the sharing tracks as the trigger.
3828 When an original track has a @b{shared track} as one of its effects,
3829 the shared track itself is used as a realtime effect.  This is more
3830 commonly known as @b{bouncing tracks} but Cinelerra achieves the
3831 same operation by attaching shared tracks.  The fade and any effects in
3832 the shared track are applied to the original track.  Once the shared
3833 track has processed the data, the original track performs any effects
3834 which come below the shared track and then composites it on the output.
3836 In addition, once the shared track has processed the output of the
3837 original track like a realtime effect, the shared track mixes itself
3838 into the output with it's settings for pan, mode, and projector.  Thus,
3839 two tracks are mixing the same data on the output.  Most of the time
3840 you don't want the shared track to mix the same data as the original
3841 track on the output.  You want it to stop right before the mixing stage
3842 and give the data back to the original track.  Do this by enabling the
3843 @image{mutepatch_up} mute toggle next to each track for whom you don't
3844 want to mix on the output.
3846 Suppose you were making video and you did want the shared track to
3847 composite the original track's data on the output a second time.  In
3848 the case of video, the video from the shared track would always appear
3849 under the video from the original track, regardless of whether it was
3850 on top of the original track.  This is because shared tracks are
3851 composited in order of their attachment.  Since it's part of the original
3852 track it has to be composited before the original track is composited.
3860 @node EDITING REALTIME EFFECTS
3861 @subsection EDITING REALTIME EFFECTS
3863 Many operations exist for manipulating effects once they are in the
3864 timeline.  Because mixing effects and media is such complex business,
3865 the methods used in editing effects aren't as concise as cutting and
3866 pasting.  Some of the editing happens by dragging in/out points, some
3867 of the editing happens through popup menus, and some of it happens by
3868 dragging effects.
3870 Normally when you edit tracks, the effects follow the editing
3871 decisions.  If you cut from a track, the effect shrinks.  If you drag
3872 edit in/out points, the effect changes length.  This behavior can be
3873 disabled by selecting @b{Settings->edit effects} in the project
3874 window.  This decouples effects from editing operations, but what if
3875 you just want to edit the effects?
3877 Move the timeline cursor over the effect borders until it changes to a
3878 resize left or resize right icon.  In this state, if you drag the end
3879 of the effect, it performs an edit just like dragging the end of a
3880 track does.  
3882 The three editing behaviors of track trimming apply to effect trimming
3883 and they are bound to the mouse buttons that you set in @b{interface
3884 preferences}. @xref{INTERFACE}.  When you perform a trim edit on an
3885 effect, the effect boundary is moved by dragging on it.  Unlike track
3886 editing, the effect has no source length.  You can extend the end of an
3887 effect as much as desired without being limited.
3889 Also unlike track editing, the starting position of the drag operation
3890 doesn't bind the edit decision to media.  The media the effect is bound
3891 to doesn't follow effect edits.  Other effects; however, do follow
3892 editing decisions made on an effect.  If you drag the end of an effect
3893 which is lined up to effects on other tracks, the effects on the other
3894 tracks will be edited while the media stays the same.
3896 What happens if you trim the end of an effect in, leaving a lot of
3897 unaffected time near the end of the track?  When you drag an effect in
3898 from the Resource Window you can insert the effect in the portion of
3899 the row unoccupied by the trimming operation.  Realtime effects are
3900 organized into rows under the track.  Each row can have multiple
3901 effects.
3903 In some cases you'll want a trimming operation to change only one row
3904 of effects.  This can be achieved by first positioning the insertion
3905 point on the start or end of the effect.  Then press @b{shift} while
3906 beginning the trimming operation.  This causes the operation to change
3907 only one row of effects.
3909 In addition to trimming, you can move effects up or down.  Every track
3910 can have a stack of effects under it.  By moving an effect up or down
3911 you change the order in which effects are processed in the stack.  Go
3912 to an effect and right click to bring up the effect menu.  The
3913 @b{Move up} and @b{Move down} options move the effect up or down.
3915 When you're moving effects up or down, be aware that if they're shared
3916 as @b{shared effects}, any references will be pointing to a
3917 different effect after the move operation.
3919 Finally, there's dragging of effects.  Dragging effects works just like
3920 dragging edits.  You must select the @image{arrow} arrow to enter drag and
3921 drop mode before dragging effects.  The effects snap to media
3922 boundaries, effect boundaries, and tracks.  Be aware if you drag a
3923 reference to a shared effect, the reference will usually point to the
3924 wrong effect afterwards.
3926 Right click on an effect to bring up a menu for the effect.  Select
3927 @b{attach...} to change the effect or change the reference if it is
3928 a shared effect.
3937 @node RENDERED EFFECTS
3938 @section RENDERED EFFECTS
3941 Another type of effect is performed on a section of the track and the
3942 result stored somewhere before it is played back.  The result is
3943 usually pasted into the track to replace the original data.
3945 The rendered effects are not listed in the resource window but instead
3946 are accessed through the @b{Audio->Render effect} and
3947 @b{Video->Render effect} menu options.  Each of these menu options
3948 brings up a dialog for the rendered effect.  Rendered effects apply to
3949 only one type of track, either audio or video.  If no tracks of the
3950 type exist, an error pops up.
3952 A region of the timeline to apply the effect to must be defined before
3953 selecting @b{Render effect...}.  If no in/out points and no
3954 highlighted region exists, the entire region after the insertion point
3955 is treated as the affected region.  Otherwise, the region between the
3956 in/out points or the highlighted region is the affected region.
3958 Secondly, the tracks to apply the rendered affect to need to be
3959 @b{armed}.  All other tracks are ignored.
3961 Finally, the rendered affect processes certain track attributes when it
3962 reads its input data but not others.  Transitions in the affected track
3963 are applied.  Nudge is not and effects are not.  This allows the new
3964 data to be pasted into the existing position without changing the nudge
3965 value.
3967 In the render effect dialog is a list of all the realtime and all the
3968 rendered effects.  The difference here is that the realtime effects are
3969 rendered to disk and not applied under the track.  Highlight an effect
3970 in the list to designate it as the one being performed.
3972 Define a file to render the effect to in the @b{Select a file to
3973 render to} box.  The @image{magnify} magnifying glass allows file
3974 selection from a list.
3976 Select a file format which can handle the track type.  The
3977 @image{wrench} wrench allows configuration specific to the file format.
3979 There is also an option for creating a new file at each label.  If you
3980 have a CD rip on the timeline which you want to divide into different
3981 files, the labels would become dividing points between the files if
3982 this option were selected.  When the timeline is divided by labels, the
3983 effect is re-initialized at every label.  Normalize operations take the
3984 peak in the current file and not in the entire timeline.
3986 Finally there is an insertion strategy just like in the render dialog. 
3987 It should be noted that even though the effect applies only to audio or
3988 video, the insertion strategy applies to all tracks just like a
3989 clipboard operation.
3991 When you click @b{OK} in the effect dialog, it calls the GUI of the
3992 effect.  If the effect is also a realtime effect, a second GUI appears
3993 to prompt for acceptance or rejection of the current settings.  After
3994 accepting the settings, the effect is processed.
4009 @node TRANSITIONS
4010 @section TRANSITIONS
4012 When one edit ends and another edit begins, the default behaviour is to
4013 have the first edit's output immediately become the output of the
4014 second edit when played back.  Transitions are a way for the first
4015 edit's output to become the second edit's output with different
4016 variations.
4018 Cinelerra supports audio and video transitions, all of which are listed
4019 in the resource window.  Transitions may only apply to the matching
4020 track type.  Transitions under @b{audio transitions} can only apply
4021 to audio tracks.  Transitions under @b{video transitions} can only
4022 apply to video tracks.
4024 Load a video file and cut a section from the center so the edit point
4025 is visible on the timeline.  Go the resource window and click on the
4026 @b{Video transitions} folder.  Drag a transition from the transition
4027 list onto the second video edit on the timeline.  A box highlights over
4028 where the transition will appear.  Releasing it over the second edit
4029 applies the transition between the first and second edit.
4031 You can now scrub over the transition with the transport controls and
4032 watch the output in the @b{Compositor window}.  Scrubbing with the
4033 insertion point doesn't normally show transitions because the
4034 transition durations are usually too short.  The exact point in time
4035 when the transition takes effect isn't straightforward.  It starts when
4036 the second edit begins and lasts a certain amount of time into the
4037 second edit.  Therefore, the first asset needs to have enough data
4038 after the edit point to fill the transition into the second edit.
4040 Once the transition is in place, it can be edited similarly to an
4041 effect.  Move the pointer over the transition and right click to bring
4042 up the transition menu.  The @b{show} option brings up specific
4043 parameters for the transition in question if there are any.  The
4044 @b{length} option adjusts the length of the transition in seconds. 
4045 Once these two parameters are set, they are applied to future
4046 transitions until they are changed again.  Finally, the @b{detach}
4047 option removes the transition from the timeline.
4049 Dragging and dropping transitions from the Resource window to the
4050 Program window can be really slow and tiring.  Fortunately, once you
4051 drag a transition from the Resource window, the @b{U} and @b{u}
4052 keys will paste the same transition.  The @b{U} key pastes the last
4053 video transition and the @b{u} key pastes the last audio transition
4054 on all the recordable tracks.  If the insertion point or in point is
4055 over an edit, the beginning of the edit is covered by the transition.  
4057 It should be noted that when playing transitions from the timeline to a
4058 hardware accelerated video device, the hardware acceleration will
4059 usually be turned off momentarily during the transition and on after
4060 the transition in order to render the transition.  Using an
4061 unaccelerated video device for the entire timeline normally removes the
4062 disturbance.
4068 @node LADSPA EFFECTS
4069 @section LADSPA EFFECTS
4072 LADSPA effects are supported in realtime and rendered mode for audio. 
4073 The LADSPA plugins you get from the internet vary in quality.  Most
4074 can't be tweeked in realtime very easily and work better when
4075 rendered.  Some crash and some can only be applied to one track due to
4076 a lack of reentrancy.  Although Cinelerra implements the LADSPA
4077 interface as accurately as possible, multiple tracks of realtime,
4078 simultaneous processing go beyond the majority of LADSPA users.  LADSPA
4079 effects appear in the audio folder as the hammer and screwdriver, to
4080 signify that they are Plugins for Linux Audio Developers.
4082 LADSPA Effects are enabled merely by setting the @b{LADSPA_PATH}
4083 environment variable to the location of your LADSPA plugins or putting
4084 them in the @b{/usr/lib/cinelerra} directory.
4095 @node SETTING PROJECT ATTRIBUTES
4096 @chapter SETTING PROJECT ATTRIBUTES
4098 When you play media files in Cinelerra, the media files have a certain
4099 number of tracks, a certain frame size, a certain sample size, and so
4100 on and so forth.  No matter what the media file has; however, it is
4101 still played back according to the project attributes.  If an audio
4102 file's samplerate is different than the project attributes, it is
4103 resampled.  If a video file's frame size is different than the project
4104 attributes, it is composited on a black frame, either cropped or
4105 bordered with black.
4107 The project attributes are adjusted in @b{Settings->Set Format} and in
4108 to a more limited extent in @b{File->New}.  When you adjust project
4109 settings in @b{file->new} a new timeline is created with no data. 
4110 Every timeline created from this point uses the same settings.  When
4111 you adjust settings in @b{settings->format}, the timeline is not
4112 recreated with no data but every timeline created from this point uses
4113 the same settings.
4115 In addition to the traditional settings for sample rate, frame rate,
4116 frame size, Cinelerra uses some unusual settings like @b{channel
4117 positions, color model, and aspect ratio.}
4121 @menu
4122 * AUDIO CHANNEL POSITIONS::
4123 * COLOR MODEL::
4124 * ASPECT RATIO::
4125 @end menu
4131 @node AUDIO CHANNEL POSITIONS
4132 @section AUDIO CHANNEL POSITIONS
4134 The currently enabled audio channels and their positions in the user
4135 interface boxes are displayed in the channel position widget.
4137 @sp 2
4138 @image{channelpositions}
4139 @sp 2
4142 The channels are numbered.  When rendered, the output from channel 1 is
4143 rendered to the first output track in the file or the first soundcard
4144 channel of the soundcard.  Later channels are rendered to their
4145 successively numbered output tracks.
4147 The audio channel locations correspond to where in the panning widgets
4148 each of the audio outputs is.  The closer the panning position is to
4149 one of the audio outputs, the more signal that speaker gets.  Click on
4150 a speaker icon and drag to change the audio channel location.
4152 The speakers can be in any orientation.  A different speaker
4153 arrangement is stored for every number of audio channels since normally
4154 you don't want the same speaker arrangement for different numbers of
4155 channels.
4157 Channel positions is the only setting which doesn't affect the output
4158 necessarily.  Click on a speaker icon and drag to change the position
4159 of a channel.  It is merely a convenience so when more than 2 channels
4160 are used, the pan controls on the timeline can distinguish between
4161 them.  It has nothing to do with the actual arrangement of speakers.
4164 But different channels can be positioned very close together to make
4165 them have the same output.
4170 @node COLOR MODEL
4171 @section COLOR MODEL
4173 Color model is very important for video playback because video has the
4174 disadvantage of being very slow.  Although it isn't noticable, audio
4175 intermediates contain much more information than the audio on disk and
4176 the audio which is played.  Audio always uses the highest bandwidth
4177 intermediate because it's fast.
4179 Video intermediates must use the least amount of data for the required
4180 quality because it's slow, but video intermediates still use a higher
4181 bandwidth color model than video which is stored and video which is
4182 played.  This allows more processing to be done with less destruction
4183 of the original data.   
4185 The video is stored on disk in one colormodel, normally compressed
4186 using a YUV derivative.  When played back, Cinelerra decompresses it
4187 from the file format directly into the format of the output device.  If
4188 effects are processed, the decompression is into an intermediate
4189 colormodel first and the intermediate colormodel is then converted to
4190 the format of the output device.  The selection of intermediate
4191 colormodel determines how accurate and fast the effects are.
4193 Cinelerra colormodels are described using a certain packing order of
4194 components and a certain number of bits for each component.  The
4195 packing order is printed on the left and the bit allocation is printed
4196 on the right.
4198 @itemize
4199 @item
4201 @b{RGB-888} 
4203 This allocates 8 bits for the R, G, and B channels and no alpha. This
4204 is normally used for uncompressed media with low dynamic range.
4206 @item
4208 @b{RGBA-8888} 
4210 This allocates an alpha channel to the 8 bit RGB colormodel.  It's used
4211 for overlaying multiple tracks.
4213 @item
4215 @b{YUV-888} 
4217 This allocates 8 bits for Y, U, and V.  This is used for low dynamic
4218 range operations in which the media is compressed in the YUV color
4219 space.  Most compressed media is in YUV and this allows it to be
4220 processed fast with the least color degradation. 
4222 @item
4224 @b{YUVA-8888} 
4226 This allocates an alpha channel to the 8 bit YUV colormodel for
4227 transparency.
4229 @item
4231 @b{RGB-Float} 
4233 This allocates a 32 bit float for the R, G, and B channels and no
4234 alpha.  This is used for high dynamic range processing with no
4235 transparency.
4237 @item
4239 @b{RGBA-Float} This adds a 32 bit float for alpha to RGB-Float.  This
4240 is used for high dynamic range processing with transparency.
4242 @end itemize
4246 In order to do effects which involve alpha channels, a colormodel with
4247 an alpha channel must be selected.  These are RGBA8888, YUVA8888, and
4248 RGBA Float.  The 4 channel colormodels are notoriously slower than 3
4249 channel colormodels, with the slowest being RGBA Float.  Some effects,
4250 like fade, work around the need for alpha channels while other effects,
4251 like chromakey, require an alpha channel to do anything, so it's a good
4252 idea to try the effect without alpha channels to see if it works before
4253 settling on an alpha channel and slowing it down.
4255 The YUV colormodels are usually faster than RGB colormodels when using
4256 compressed footage.  They also destroy fewer colors than RGB
4257 colormodels.  If footage stored as JPEG or MPEG is processed many times
4258 in RGB, the colors will fade while they won't if processed in YUV.
4260 Years of working with high dynamic range footage have shown floating
4261 point RGB to be the best format for high dynamic range.  While 16 bit
4262 integers were used in the past, these were too lossy and slow for the
4263 amount of improvement.
4265 RGB float doesn't destroy information when used with YUV source
4266 footage.  It also supports brightness above 100%.  Be aware that some
4267 effects, like Histogram, still clip above 100% when in floating point.
4269 @node ASPECT RATIO
4270 @section ASPECT RATIO
4272 Aspect ratio determines the shape of the video output when using the
4273 X11 video output.  The numbers in each direction can be any floating
4274 point number.  When drawn on the screen, video pixels are stretched to
4275 match the aspect ratio.
4277 Some file formats, like MPEG video, write the project aspect ratio to
4278 the file.
4289 @node COMPOSITING
4290 @chapter COMPOSITING
4293 A large amount of Cinelerra's binary size is directed towards
4294 compositing.  When you remove the letterboxing from a widescreen show,
4295 you're compositing.  Changing the resolution of a show, making a split
4296 screen, and fading in and out among other things are all compositing
4297 operations in Cinelerra.  Cinelerra detects when it's in a compositing
4298 operation and plays back through the compositing engine only then. 
4299 Otherwise, it uses the fastest decoder available in the hardware.
4301 Compositing operations are done on the timeline and in the Compositor
4302 window.  Shortcuts exist in the Resource window for changing some
4303 compositing attributes.  Once some video files are on the timeline, the
4304 compositor window is a good place to try compositing.
4308 @menu
4309 * THE CAMERA AND PROJECTOR::
4310 * MASKS::
4311 * CROPPING::
4312 * SAFE REGIONS::
4313 * OVERLAY MODES::
4314 * TRACK AND OUTPUT SIZES::
4315 @end menu
4319 @node THE CAMERA AND PROJECTOR
4320 @section THE CAMERA AND PROJECTOR
4322 In the compositor window, the most important functions are the
4323 @image{camera} camera button and the @image{projector} projector
4324 button.  These control operation of the camera and projector.  Inside
4325 Cinelerra's compositing pipeline, the camera determines where in the
4326 source video the temporary is copied from.  The projector determines
4327 where in the output the temporary is copied to.  The temporary is a
4328 frame of video in Cinelerra's memory where all graphics processing is
4329 done.  Each track has a different temporary which is defined by the
4330 track size.  By resizing the tracks you can create splitscreens, pans,
4331 and zooms.
4333 @sp 2
4334 @image{compositing_pipeline}
4335 @sp 2
4336 @b{Visual representation of the compositing pipeline}.
4338 When editing the camera and projector in the compositing window, the
4339 first track with @b{record} enabled is the track affected.  Even if
4340 the track is completely transparent, it's still the affected track.  If
4341 multiple video tracks exist, the easiest way to select one track for
4342 editing is to @b{shift-click} on the record icon of the track.  This
4343 solos the track.
4345 When the @b{projector} button is enabled in the compositor window,
4346 you're in projector editing mode.  A guide box appears in the video
4347 window.  Dragging anywhere in the video window causes the guide box to
4348 move, hopefully along with the video.  @b{shift-dragging} anywhere
4349 in the video window causes the guide box to shrink and grow along with
4350 the video.  Once you've positioned the video with the projector, you're
4351 ready to master the camera.
4353 Select the @image{camera} camera button to enable camera editing mode. 
4354 In this mode, the guide box shows where the camera position is in
4355 relation to past and future camera positions but not where it is in
4356 relation to the source video.  Dragging the camera box in the
4357 compositor window doesn't move the box but instead moves the location
4358 of the video inside the box.
4360 For example, when you drag the camera left, the video moves right. 
4361 When you drag the camera up, the video moves down.  When you shift-drag
4362 the camera, the effect is the same as if you zoomed in or out of the
4363 source.  The intention of the camera is to produce still photo panning,
4364 while the intention of the projector is to composite several sources in
4365 the same scene.
4367 In the compositing window, there is a popup menu of options for the
4368 camera and projector.  Right click over the video portion of the
4369 compositing window to bring up the menu.
4371 @itemize
4373 @item Reset Camera causes the camera to return to the center position.
4375 @item Reset Projector causes the projector to return to the center.
4377 @end itemize
4380 The camera and projector have shortcut operations neither in the popup
4381 menu or represented in video overlays.  These are accessed in the
4382 @b{Tool window}.  Most operations in the Compositor window have a
4383 tool window which is enabled by activating the @image{toolwindow}
4384 question mark.
4386 In the case of the camera and projector, the tool window shows x, y,
4387 and z coordinates.  By either tumbling or entering text directly, the
4388 camera and projector can be precisely positioned.  9 justification
4389 types are also defined for easy access.  A popular justification
4390 operation is upper left projection after image reduction.  This is used
4391 when reducing the size of video with aspect ratio adjustment.
4393 The translation effect allows simultaneous aspect ratio conversion and
4394 reduction but is easier to use if the reduced video is put in the upper
4395 left of the temporary instead of in the center.  The track size is set
4396 to the original size of the video and the camera is centered.  The
4397 output size is set to the reduced size of the video.  Without any
4398 effects, this produces just the cropped center portion of the video in
4399 the output.
4401 The translation effect is dropped onto the video track.  The input
4402 dimensions of the translation effect are set to the original size and
4403 the output dimensions are set to the reduced size.  To put the reduced
4404 video in the center section that the projector shows would require
4405 offsetting @b{out x and out y} by a complicated calculation. 
4406 Instead, we leave @b{out x and out y} at 0 and use the projector's
4407 tool window.
4409 Merely by selecting @image{left_justify} left justify and
4410 @image{top_justify} top justify, the projector displays the reduced
4411 image from the top left corner of the temporary in the center of the
4412 output.
4419 @node MASKS
4420 @section MASKS
4422 Masks select a region of the video for either displaying or hiding. 
4423 Masks are also used in conjunction with another effect to isolate the
4424 effect to a certain region of the frame.  A copy of one video track may
4425 be delayed slightly and unmasked in locations where the one copy has
4426 interference but the other copy doesn't.  Color correction may be
4427 needed in one section of a frame but not another.  A mask can be
4428 applied to just a section of the color corrected track while the
4429 vanilla track shows through.  Removal of boom microphones, airplanes,
4430 and housewives are other mask uses.
4432 The order of the compositing pipeline affects what can be done with
4433 masks.  Mainly, masks are performed on the temporary after effects and
4434 before the projector.  This means multiple tracks can be bounced to a
4435 masked track and projected with the same mask.
4437 Our compositing pipeline graph now has a masking stage.  There are 8
4438 possible masks per track.  Each mask is defined separately, although
4439 they each perform the same operation, whether it's addition or
4440 subtraction.
4442 @sp 2
4443 @image{compositing_pipeline2}
4444 @sp 2
4445 @b{Compositing pipeline with masks}
4447 To define a mask, go into the Compositor window and enable the
4448 @image{mask} @b{mask} toggle.  Now go over the video and
4449 click-drag.  Click-drag again in another part of the image to create
4450 each new point of the mask.  While it isn't the conventional bezier
4451 curve behavior, this masking interface performs in realtime what the
4452 effect of the mask is going to be.  Creating each point of the mask
4453 expands a rubber band curve.  
4455 Once points are defined, they can be moved by @b{ctrl-dragging} in
4456 the vicinity of the corner.  This; however, doesn't smooth out the
4457 curve.  The in-out points of the bezier curve are accessed by
4458 @b{shift-dragging} in the vicinity of the corner.  Then
4459 @b{shift-dragging} near the in or out point causes the point to
4460 move.
4462 Finally, once you have a mask, the mask can be translated in one piece
4463 by @b{alt-dragging} the mask.  Mask editing in Cinelerra is
4464 identical to how The Gimp edits masks except in this case the effect of
4465 the mask is always on.
4467 The masks have many more parameters which couldn't be represented with
4468 video overlays.  These are represented in the tool window for masks. 
4469 Selecting the @image{toolwindow} question mark when the @image{mask}
4470 mask toggle is highlighted brings up the mask options.
4472 The @b{mode} of the mask determines if the mask removes data or
4473 makes data visible.  If the mode is subtractive, the mask causes video
4474 to disappear.  If the mode is additive, the mask causes video to appear
4475 and everything outside the mask to disappear.
4477 The @b{value} of the mask determines how extreme the addition or
4478 subtraction is.  In the subtractive mode, higher values subtract more
4479 alpha.  In the additive mode, higher values make the region in the mask
4480 brighter while the region outside the mask is always hidden.
4482 The mask number determines which one of the 8 possible masks we're
4483 editing.  Each track has 8 possible masks.  When you click-drag in the
4484 compositor window, you're only editing one of the masks.  Change the
4485 value of @b{mask number} to cause another mask to be edited.  The
4486 previous mask is still active but only the curve overlay for the
4487 currently selected mask is visible.
4489 When multiple masks are used, their effects are ORed together.  Every
4490 mask in a single track uses the same value and mode.
4492 The edges of a mask are hard by default but this rarely is desired. 
4493 The @b{feather} parameter determines how many pixels to feather the
4494 mask.  This creates softer edges but takes longer to render.
4496 Finally, there are parameters which affect one point on the current
4497 mask instead of the whole mask.  These are @b{Delete, x, y}.  The
4498 active point is defined as the last point dragged in the compositor
4499 window.  Any point can be activated merely by @b{ctrl-clicking} near
4500 it without moving the pointer.  Once a point is activated,
4501 @b{Delete} deletes it and @b{x, y} allow repositioning by numeric
4502 entry.
4507 @node CROPPING
4508 @section CROPPING
4512 Cropping changes the value of the output dimensions and the projector
4513 to reduce the visible picture area.  Enable the @image{crop} crop
4514 toggle and the @image{toolwindow} tool window in the @b{compositing
4515 window} to perform cropping.
4517 This draws a rectangle over the video.  Click-drag anywhere in the
4518 video to start a new rectangle.  Click-drag over any corner of the
4519 rectangle to reposition the corner.
4521 Alt-click in the cropping rectangle to translate the rectangle to any
4522 position without resizing it.
4524 The tool window allows text entry of the coordinates and executes the
4525 cropping operation.  When the rectangle is positioned, hit the @b{do
4526 it} button in the tool window to execute the cropping operation.
4533 @node SAFE REGIONS
4534 @section SAFE REGIONS
4536 On consumer displays the borders of the image are cut off and within
4537 the cutoff point is a region which isn't always square like it is in
4538 the compositor window.  The borders are intended for scratch room and
4539 vertical blanking data.  You can show where these borders are by
4540 enabling the @image{titlesafe} safe regions toggle.  Keep titles inside
4541 the inner rectangle and keep action inside the outer rectangle.
4550 @node OVERLAY MODES
4551 @section OVERLAY MODES
4553 Every video track has an overlay mode, accessible by expanding the
4554 track.  The overlay mode is a pulldown menu on the left under the
4555 fader.  When collapsed, it displays an icon representing the current
4556 overlay mode.
4558 Select the @image{expandpatch_checked} expand track toggle to view all
4559 the options for a video track if you can't see the overlay mode.  The
4560 overlay mode of video tracks is @b{normal} by default.  Select other
4561 modes by clicking the overlay button and selecting an item from the
4562 popup menu.
4564 Overlay modes are processed inside the projector stage of compositing. 
4565 The different modes are summarized below.
4567 @itemize
4569 @item
4571 @b{Normal} uses a traditional Porter-Diff equation to blend tracks with
4572 alpha.  When no alpha exists in the project color model, the new track
4573 always replaces the output.
4575 @item
4577 @b{Addition}  In this mode, whatever is in the output is added to the
4578 current track.  The result is blended based on the current track's
4579 alpha onto the output.
4581 @item
4583 @b{Subtraction} In this mode, the current track is subtracted from the
4584 output and the result is alpha blended onto the output.
4586 @item 
4588 @b{Multiply} is the most useful operation.  The current track is multiplied
4589 by the output and the result blended onto the output.  Usually a black
4590 and white image with no alpha channel or a white title on a black image
4591 is used as the current track.  With the multiply operation, only the
4592 output portions under the white area show.
4594 @item
4596 @b{Divide} divides the current track by the output and the result is
4597 blended into the output.  It usually results in overloaded levels.
4599 @item
4601 @b{Replace} does no blending and overwrites the output with the current
4602 track.
4604 @end itemize
4610 @node TRACK AND OUTPUT SIZES
4611 @section TRACK AND OUTPUT SIZES
4613 The size of the temporary and the size of the output in our compositing
4614 pipeline are independant and variable.  This fits into everything
4615 covered so far.  The camera's viewport is the temporary size.  Effects
4616 are processed in the temporary and are affected by the temporary size. 
4617 Projectors are rendered to the output and are affected by the output
4618 size.  If the temporary is smaller than the output, the temporary is
4619 bordered by blank regions in the output.  If the temporary is bigger
4620 than the output, the temporary is cropped.
4622 The temporary size is defined as the track size.  Each track has a
4623 different size.  Right click on a track to bring up the track's menu. 
4624 Select @b{Resize Track} to resize the track to any arbitrary size. 
4625 Alternatively you can select @b{Match output size} to make the track
4626 the same size as the output.
4628 The output size is set in either @b{New} when creating a new project
4629 or @b{Settings->Format}.  In the Resource window there is another
4630 way to change the output size.  Right click on a video asset and select
4631 @b{Match project size} to conform the output to the asset.  When new
4632 tracks are created, the track size always conforms to the output size
4633 specified by these methods.
4640 @node KEYFRAMES
4641 @chapter KEYFRAMES
4644 When you change the fade, camera, projector, or other parameters for a
4645 track, they stay by default the same for the entire durection of the
4646 timeline.   Setting static parameters isn't very useful sometimes. 
4647 Normally you need to move the camera around over time or change mask
4648 positions.  Masks need to follow objects.  We create dymanic changes by
4649 defining keyframes.  A keyframe is a certain point in time when the
4650 settings for one operation change.  In Cinelerra, there are keyframes
4651 for almost every compositing parameter and effect parameter.
4653 Whenever you adjust any parameter, the value is stored in a keyframe. 
4654 If the value is stored in a keyframe, why doesn't it always change? 
4655 The keyframe it is stored in by default is known as the @b{default
4656 keyframe}.  The default keyframe applies to the entire duration if no
4657 other keyframes are present.  The default keyframe is not drawn
4658 anywhere because it always exists.  The only way change occurs over
4659 time is if non-default keyframes are created.
4661 Display keyframes for any parameter by using the @b{view} menu.  A
4662 faster way to toggle multiple keyframe types is to bring up
4663 @b{window->overlays}.  This window allows toggling of every parameter
4664 in the view menu.  When keyframes are selected, they are drawn on the
4665 timeline over the tracks they apply to.
4667 Keyframes come in many forms: curves, toggles, modes, and so on. 
4668 How to handle the different types of keyframes is described here.
4670 @menu
4671 * CURVE KEYFRAMES::
4672 * TOGGLE KEYFRAMES::
4673 * AUTOMATIC KEYFRAMES::
4674 * COMPOSITOR KEYFRAMES::
4675 * EDITING KEYFRAMES::
4676 @end menu
4680 @node CURVE KEYFRAMES
4681 @section CURVE KEYFRAMES
4683 Many parameters are stored in bezier curves.  Go to @b{view->fade} or
4684 @b{view->...zoom} to show curves on the timeline for those parameters. 
4685 In either arrow editing mode or i-beam editing mode, move the cursor
4686 over the curves in the timeline until it changes shape.  Then merely by
4687 clicking and dragging on the curve you can create a keyframe at the
4688 position.
4690 After the keyframe is created, click drag on it again to reposition
4691 it.  When you click-drag a second keyframe on the curve, it creates a
4692 smooth ramp.  @b{ctrl-dragging} on a keyframe changes the value of
4693 either the input control or the output control.  This affects the
4694 sharpness of the curve.  While the input control and the output control
4695 can be moved horizontally as well as vertically, the horizontal
4696 movement is purely for legibility and isn't used in the curve value.
4698 You may remember that The Gimp and the Compositing masks all use
4699 @b{shift} to select control points so why does the timeline use
4700 @b{ctrl}?  When you @b{shift-drag} on a timeline curve, the
4701 keyframe snaps to the value of either the next or previous keyframe,
4702 depending on which exists.  This lets you set a constant curve value
4703 without having to copy the next or previous keyframe.
4705 @menu
4706 * NAVIGATING CURVE KEYFRAMES::
4707 @end menu
4710 @node NAVIGATING CURVE KEYFRAMES
4711 @subsection NAVIGATING CURVE KEYFRAMES
4713 There isn't much room on the timeline for a wide range of curve
4714 values.  You need to zoom the curves in and out vertically to have any
4715 variability.  This is done by 2 tools: the automation fit button
4716 @image{fitautos} and automation zoom menu @image{autozoom}.
4718 The automation fit button scales and offsets the vertical range so the
4719 selected curve area appears in the timeline.  If a region of the
4720 timeline is highlighted by the cursor, only that region is scaled. 
4721 In/out points don't affect the zoomed region.  @b{Alt-f} also performs
4722 automation fitting.
4724 The automation zoom menu manually changes the vertical scaling of the
4725 curves in multiples of 2.  Click on its tumbler to change the zoom. 
4726 @b{Alt-Up and Alt-Dn} change the automation zoom from the keyboard.
4729 @node TOGGLE KEYFRAMES
4730 @section TOGGLE KEYFRAMES
4732 Mute is the only toggle keyframe.  Mute keyframes determine where the
4733 track is processed but not rendered to the output.  Click-drag on these
4734 curves to create a keyframe.  Unlike curves, the toggle keyframe has
4735 only two values: on or off.  Ctrl and shift do nothing on toggle
4736 keyframes.
4743 @node AUTOMATIC KEYFRAMES
4744 @section AUTOMATIC KEYFRAMES
4746 You may have noticed when a few fade curves are set up, moving the
4747 insertion point around the curves causes the faders to reflect the
4748 curve value under the insertion point.  This isn't just to look cool. 
4749 The faders themselves can set keyframes in automatic keyframe mode. 
4750 Automatic keyframe mode is usually more useful than dragging curves.
4752 Enable automatic keyframe mode by enabling the automatic keyframe
4753 toggle @image{autokeyframe}.  In automatic keyframe mode, every time
4754 you tweek a keyframeable parameter it creates a keyframe on the
4755 timeline.  Since automatic keyframes affect many parameters, it's best
4756 enabled just before you need a keyframe and disabled immediately
4757 thereafter.
4759 It's useful to go into the @b{View} menu and make the desired
4760 parameter visible before performing a change.  The location where the
4761 automatic keyframe is generated is under the insertion point.  If the
4762 timeline is playing back during a tweek, several automatic keyframes
4763 will be generated as you change the parameter.
4765 When automatic keyframe mode is disabled, a similarly strange thing
4766 happens.  Adjusting a parameter adjusts the keyframe immediately
4767 preceeding the insertion point.  If two fade keyframes exist and the
4768 insertion point is between them, changing the fader changes the first
4769 keyframe.
4771 There are many parameters which can only be keyframed in automatic
4772 keyframe mode.  These are parameters for which curves would take up too
4773 much space on the track or which can't be represented easily by a
4774 curve.
4776 Effects are only keyframable in automatic mode because of the number of
4777 parameters in each individual effect.  
4779 Camera and projector translation can only be keyframed in automatic
4780 keyframe mode while camera and projector zoom can be keyframed with
4781 curves.  It is here that we conclude the discussion of compositing,
4782 since compositing is highly dependant on the ability to change over
4783 time.
4787 @node COMPOSITOR KEYFRAMES
4788 @section COMPOSITOR KEYFRAMES
4790 Camera and projector translation is represented by two parameters: x
4791 and y.  Therefore it is cumbersome to adjust with curves.  Cinelerra
4792 solves this problem by relying on automatic keyframes.  With a video
4793 track loaded, move the insertion point to the beginning of the track
4794 and enable automatic keyframe mode.
4796 Move the projector slightly in the compositor window to create a
4797 keyframe.  Then go forward several seconds.  Move the projector a long
4798 distance to create another keyframe and emphasize motion.  This creates
4799 a second projector box in the compositor, with a line joining the two
4800 boxes.  The joining line is the motion path.  If you create more
4801 keyframes, more boxes are created.  Once all the desired keyframes are
4802 created, disable automatic keyframe mode.
4804 Now when scrubbing around with the compositor window's slider, the
4805 video projection moves over time.  At any point between two keyframes,
4806 the motion path is read for all time before the insertion point and
4807 green for all time after the insertion point.  It's debatable if this
4808 is a very useful feature but it makes you feel good to know what
4809 keyframe is going to be affected by the next projector tweek.
4811 Click-drag when automatic keyframes are off to adjust the preceeding
4812 keyframe.  If you're halfway between two keyframes, the first projector
4813 box is adjusted while the second one stays the same.  Furthermore, the
4814 video doesn't appear to move in step with the first keyframe.  This is
4815 because, halfway between two keyframes the projector translation is
4816 interpolated.  In order to set the second keyframe you'll need to scrub
4817 after the second keyframe.
4819 By default the motion path is a straight line, but it can be curved
4820 with control points.  @b{Ctrl-drag} to set either the in or out
4821 control point of the preceeding keyframe.  Once again, we depart from
4822 The Gimp because @b{shift} is already used for zoom.  After the in
4823 or out control points are extrapolated from the keyframe,
4824 @b{Ctrl-dragging} anywhere in the video adjusts the nearest control
4825 point.  A control point can be out of view entirely yet still
4826 controllable.
4828 When editing the camera translation, the behavior of the camera boxes
4829 is slightly different.  Camera automation is normally used for still
4830 photo panning.  The current camera box doesn't move during a drag, but
4831 if multiple keyframes are set, every camera box except the current
4832 keyframe appears to move.  This is because the camera display shows
4833 every other camera position relative to the current one.
4835 The situation becomes more intuitive if you bend the motion path
4836 between two keyframes and scrub between the two keyframes.  The
4837 division between red and green, the current position between the
4838 keyframes, is always centered while the camera boxes move.
4845 @node EDITING KEYFRAMES
4846 @section EDITING KEYFRAMES
4848 Keyframes can be shifted around and moved between tracks on the
4849 timeline using similar cut and paste operations to editing media.  Only
4850 the keyframes selected in the @b{view} menu are affected by keyframe
4851 editing operations, however.
4853 The most popular keyframe editing operation is replication of some
4854 curve from one track to the other, to make a stereo pair.  The first
4855 step is to solo the source track's record @image{recordpatch_up} patch
4856 by @b{shift-clicking} on it.  Then either set in/out points or
4857 highlight the desired region of keyframes.  Go to @b{keyframes->copy
4858 keyframes} to copy them to the clipboard.  Solo the destination track's
4859 record @image{recordpatch_up} patch by @b{shift-clicking} on it and
4860 go to @b{keyframes->paste keyframes} to paste the clipboard.
4862 The media editing commands are mapped to the keyframe editing commands
4863 by using the @b{shift} key instead of just the keyboard shortcut.  
4865 This leads to the most complicated part of keyframe editing, the
4866 default keyframe.  Remember that when no keyframes are set at all,
4867 there is still a default keyframe which stores a global parameter for
4868 the entire duration.  The default keyframe isn't drawn because it
4869 always exists.  What if the default keyframe is a good value which you
4870 want to transpose between other non-default keyframes?  The
4871 @b{keyframes->copy default keyframe} and @b{keyframes->paste
4872 default keyframe} allow conversion of the default keyframe to a
4873 non-default keyframe.
4875 @b{Keyframes->copy default keyframe} copies the default keyframe to
4876 the clipboard, no matter what region of the timeline is selected.  The
4877 @b{keyframes->paste keyframes} function may then be used to paste
4878 the clipboard as a non-default keyframe.
4880 If you've copied a non-default keyframe, it can be stored as the
4881 default keyframe by calling @b{keyframes->paste default keyframe}. 
4882 After using paste default keyframe to convert a non-default keyframe
4883 into a default keyframe, you won't see the value of the default
4884 keyframe reflected until all the non-default keyframes are removed.
4886 Finally, there is a convenient way to delete keyframes besides
4887 selecting a region and calling @b{keyframes->clear keyframes}. 
4888 Merely click-drag a keyframe before its preceeding keyframe or after
4889 its following keyframe on the track.
4897 @node CAPTURING MEDIA
4898 @chapter CAPTURING MEDIA
4900 Ideally, all media would be stored on hard drives, CD-ROM, flash, or
4901 DVD and loading it into Cinelerra would be a matter of loading a file. 
4902 In reality, very few sources of media can be accessed like a filesystem
4903 but instead rely on tape transport mechanisms and dumb I/O mechanisms
4904 to transfer the data to computers.  These media types are imported into
4905 Cinelerra through the Record dialog.
4907 The first step in recording is to configure the input device.  In
4908 @b{Settings->preferences} are a number of recording parameters
4909 described in configuration @xref{RECORDING}.  These parameters apply to
4910 recording no matter what the project settings are, because the
4911 recording parameters are usually the maximum capability of the
4912 recording hardware while project settings come and go.
4914 Go to @b{File->record} to record a dumb I/O source.  This prompts
4915 for an output format much like rendering does.  Once that's done, the
4916 record window and the record monitor pop up.
4918 The record window has discrete sections.  While many parameters change
4919 depending on if the file has audio or video, the discrete sections are
4920 always the same.
4922 @itemize
4924 @item
4926 The output format area describes the format of the output file and the
4927 current position within it.
4930 @item
4932 The edit batch area lets you change parameters in the current batch.
4934 @item
4936 The transport controls start and stop recording different ways.
4938 @item
4940 The batch list displays all the defined batches.
4942 @item
4944 The confirmation area lets you determine how the output files are
4945 imported into the timeline and quit.
4947 @end itemize
4949 @image{recording}
4950 @sp 2
4951 @b{Recording window areas}
4954 Recording in Cinelerra is organized around batches.  A batch
4955 essentially defines a distinct output file for the recording.  For now
4956 you can ignore the batch concept entirely and record merely by hitting
4957 the record button @image{record}.
4959 The record button opens the current output file if it isn't opened and
4960 writes captured data to it.  Use the stop button to stop the
4961 recording.  Recording can be resumed with the record button without
4962 erasing the file at this point.  In the case of a video file, there is
4963 a single frame record button @image{singleframe} which records a single
4964 frame.
4966 When enough media is recorded, choose an insertion method from the
4967 @b{Insertion Strategy} menu and hit @b{close}.
4972 @menu
4973 * BATCHES::
4974 * EDITING TUNER INFORMATION::
4975 @end menu
4980 @node BATCHES
4981 @section BATCHES
4983 Now we come to the concept of batches.  Batches try to make the dumb
4984 I/O look more like a filesystem.  Batches are traditionally used to
4985 divide tape into different programs and save the different programs as
4986 different files instead of recording straight through an entire tape. 
4987 Because of the high cost of developing frame-accurate deck control
4988 mechanisms, the only use of batches now is recording different programs
4989 during different times of day.  This is still useful for recording TV
4990 shows or time lapse movies as anyone who can't afford proper appliances
4991 knows.
4993 The record window supports a list of batches and two recording modes:
4994 interactive and batch recording.  Interactive recording happens when
4995 the record button is pressed.  Interactive recording starts immediately
4996 and uses the current batch to determine everything except start time. 
4997 By default, the current batch is configured to behave like tape.
4999 Batch recording happens when the @b{start} button is pressed.  In
5000 batch recording, the @b{start time} is the time the batch starts
5001 recording.
5003 First, you'll want to create some batches.  Each batch has certain
5004 parameters and methods of adjustment.  
5009 @itemize
5011 @item 
5013 @b{On} determines whether the batch is included in batch recording
5014 operations.  Click the list row under @b{On} to enable or disable
5015 batches.
5018 @item 
5020 @b{Path} is the file the batch is going to be recorded to.  The
5021 filename specified in the record dialog is the name of the first batch,
5022 to simplify interactive recording, but the filename may be changed in
5023 the record window for any batch in the @b{edit batch} area.
5026 @item
5028 @b{News} shows whether the file exists or not.  This is a very
5029 important attribute since there is no confirmation dialog if the file
5030 exists.  The first time you hit record, the file is opened.  If the
5031 file exists at this point it's erased.  News says @b{File exists} if
5032 it exists and @b{OK} if it doesn't.  Every time you resume recording
5033 in the same batch, the news should say @b{Open}, indicating the file
5034 is already opened and won't be erased in the next record button press.
5036 If you change out of the current batch after recording, the file is
5037 closed.  Next time you change into the batch, the file will be erased.
5039 @item
5041 @b{Start time} is the 24 hour time of day the batch will start
5042 recording if in batch mode.  The start time may become a time of tape
5043 and reel number if deck control is implemented but for now it's a time
5044 of day.
5046 @item
5048 @b{Duration} is the length of the batch.  It only has meaning if the
5049 @b{Mode} of the batch is @b{Timed}.  Once the recording length
5050 reaches @b{duration} the recording stops, whether in interactive or
5051 batch mode.
5053 @item
5055 @b{Source} has meaning only when the capturing hardware has multiple
5056 sources.  Usually the source is a tuner channel or input.  When the
5057 current batch finishes and the next batch begins recording, the source
5058 is changed to what the next batch is set to.  This way multiple TV
5059 stations can be recorded at different times.
5062 @end itemize
5064 The record window has a notion of the @b{current batch}.  The
5065 current batch is not the same as the batch which is highlighted in the
5066 batch list.  The current batch text is colored red in the batch list. 
5067 The highlighted batch is merely displayed in the edit batch section for
5068 editing.
5070 By coloring the current batch red, any batch can be edited by
5071 highlighting it, without changing the batch to be recorded.
5073 All recording operations take place in the current batch.   If there
5074 are multiple batches, highlight the desired batch and hit
5075 @b{activate} to make it the current batch.  If the @b{start}
5076 button is pressed, the current batch flashes to indicate it's waiting
5077 for the start time in batch mode.  If the @b{record} button is
5078 pressed, the current batch is recorded immediately in interactive mode.
5080 In batch and interactive recording modes, when the current batch
5081 finishes recording the next batch is activated and performed.  All
5082 future recording is done in batch mode.  When the first batch finishes,
5083 the next batch flashes until its start time is reached.
5085 Interrupt either the batch or the interactive operation by hitting the
5086 stop button.
5088 Finally there is the @image{rewind} rewind button.  In either
5089 interactive or batch recording, the rewind button causes the current
5090 batch to close its file.  The next recording operation in the current
5091 batch deletes the file.
5098 @node EDITING TUNER INFORMATION
5099 @section EDITING TUNER INFORMATION
5102 Sometimes in the recording process and the configuration process,
5103 you'll need to define and select tuner channels to either record or
5104 play back to.  In the case of the Video4Linux and Buz recording
5105 drivers, tuner channels define the source.  When the Buz driver is also
5106 used for playback, tuner channels define the destination.  
5108 Defining tuner channels is accomplished by pushing the @image{channel}
5109 channel button.  This brings up the channel editing window.  In this
5110 window you add, edit, and sort channels.  Also, for certain video
5111 drivers, you can adjust the picture quality.
5113 The @b{add} operation brings up a channel editing box.  The title of
5114 the channel appears in the channel list.  The source of the channel is
5115 the entry in the physical tuner's frequency table corresponding to the
5116 title.  
5118 Fine tuning in the channel edit dialog adjusts the physical frequency
5119 slightly if the driver supports it.  The norm and frequency table
5120 together define which frequency table is selected for defining
5121 sources.  If the device supports multiple inputs, the input menu
5122 selects these.
5124 To sort channels, highlight the channel in the list and push @b{move
5125 up} or @b{move down} to move it.
5127 Once channels are defined, the @b{source} item in the record window
5128 can be used to select channels for recording.  The same channel
5129 selecting ability also exists in the record monitor window.  Be aware
5130 channel selections in the record monitor window and the record window
5131 are stored in the current batch.
5133 For some drivers an option to @b{swap fields} may be visible.  These
5134 drivers don't get the field order right every time without human
5135 intervention.  Toggle this to get the odd and even lines to record in
5136 the right order.
5141 @node IMPROVING PERFORMANCE
5142 @chapter IMPROVING PERFORMANCE
5145 Let's get one thing perfectly clear.  Linux is not a very good
5146 desktop.  It's a server.  Most of what you'll find on modern Linux
5147 distributions are faceless, network-only programs strategicly designed
5148 to counteract one Microsoft server feature or another and not to
5149 perform very well at user interaction.  There are a number of
5150 parameters on Linux, which ordinary people can adjust to make it behave
5151 more like a thoroughbred in desktop usage.
5154 @menu
5155 * DISABLING SWAP SPACE::
5156 * ENLARGING SOUND BUFFERS::
5157 * FREEING MORE SHARED MEMORY::
5158 * SPEEDING UP THE HARD DRIVE::
5159 * DISABLING CRON::
5160 * REDUCING USB MOUSE SENSITIVITY::
5161 * ASSORTED X TWEEKS::
5162 * SPEEDING UP THE FILE SYSTEM::
5163 * IMPROVING ZORAN VIDEO::
5164 @end menu
5166 @node DISABLING SWAP SPACE
5167 @section DISABLING SWAP SPACE
5169 On systems with lots of memory, Cinelerra sometimes runs better without
5170 a swap space.  If you have 4 GB of RAM, you're probably better off
5171 without a swap space.  If you have 512MB of RAM, you should keep the
5172 swap.  If you want to do recording, you should probably disable swap
5173 space in any case.  There's a reason for this.  Linux only allows half
5174 the available memory to be used.  Beyond that, it starts searching for
5175 free pages to swap, in order to cache more disk access.  In a 4 GB
5176 system, you start waiting for page swaps after using only 2 GB.  
5178 The question then is how to make Linux run without a swap space. 
5179 Theoretically it should be a matter of running
5181 @example
5182 swapoff -a
5183 @end example
5185 Unfortunately, without a swap space the @b{kswapd} tasklet normally
5186 spins at 100%.  To eliminate this problem, edit @b{linux/mm/vmscan.c}.
5187 In this file, put a line saying @b{return 0;} before it says 
5189 @example
5190         /*
5191          * Kswapd main loop.
5192          */
5193 @end example
5195 Then recompile the kernel.
5200 @node ENLARGING SOUND BUFFERS
5201 @section ENLARGING SOUND BUFFERS
5203 In order to improve realtime performance, the audio buffers for all the
5204 Linux sound drivers were limited from 128k to 64k.  For recording audio
5205 and video simultaneously and for most audio recording this causes
5206 dropouts.  Application of low latency and preemtible kernel patches
5207 make it possible to record more audio recordings but it doesn't improve
5208 recording video with audio.  This is where you need to hack the kernel.
5210 To see if your sound buffers are suitable, run the included
5211 @b{soundtest} program with nothing playing or recording.  This
5212 allocates the largest possible buffers and displays them.  If the
5213 @b{TOTAL BYTES AVAILABLE} is under 131072, you need to see about
5214 getting the buffers enlarged in the driver.  While many drivers differ,
5215 we have a hack for at least one driver.
5217 This only applies to the OSS version of the Soundblaster Live driver. 
5218 Since every sound card and every sound driver derivative has a
5219 different implementation you'll need to do some searching for other
5220 sound cards.  Edit @b{linux/drivers/sound/emu10k1/audio.c}
5222 Where is says
5224 @example
5225 if (bufsize >= 0x10000)
5226 @end example
5228 change it to say
5230 @example
5231 if (bufsize > 0x40000)
5232 @end example
5236 Where is says
5238 @example
5239                 for (i = 0; i < 8; i++)
5240                         for (j = 0; j < 4; j++)
5241 @end example
5243 change it to say
5245 @example
5246                 for (i = 0; i < 16; i++)
5247                         for (j = 0; j < 4; j++)
5248 @end example
5252 In @b{linux/drivers/sound/emu10k1/hwaccess.h}
5254 Change
5256 @b{#define MAXBUFSIZE   65536} 
5258 to 
5260 @b{#define MAXBUFSIZE   262144} 
5262 Finally, in @b{linux/drivers/sound/emu10k1/cardwi.h}
5264 @b{#define WAVEIN_MAXBUFSIZE         65536}
5268 @b{#define WAVEIN_MAXBUFSIZE         262144}
5270 Then recompile the kernel modules.
5277 @node FREEING MORE SHARED MEMORY
5278 @section FREEING MORE SHARED MEMORY
5280 The Linux kernel only allows 32MB of shared memory to be allocated by
5281 default.  This needs to be increased to do anything useful.  Run the
5282 following command:
5284 @b{echo "0x7fffffff" > /proc/sys/kernel/shmmax}
5290 @node SPEEDING UP THE HARD DRIVE
5291 @section SPEEDING UP THE HARD DRIVE
5293 This is a very popular command sequence among Linux gurus, which is not
5294 done by default on Linux distributions.
5296 @b{hdparm -c3 -d1 -u1 -k1 /dev/hda}
5298 @b{-c3} puts the hard drive into 32 bit I/O with sync.  This normally
5299 doesn't work due to inept kernel support for most IDE controllers.  If
5300 you get lost interrupt or SeekComplete errors, quickly use @b{-c0}
5301 instead of @b{-c3} in your command.
5303 @b{-d1} enables DMA of course.  This frees up the CPU partially during
5304 data transfers.
5306 @b{-u1} allows multiple interrupts to be handled during hard drive
5307 transactions.  This frees up even more CPU time.
5309 @b{-k1} prevents Linux from resetting your settings in case of a
5310 glitch.
5316 @node DISABLING CRON
5317 @section DISABLING CRON
5319 Linux runs some daily operations like compressing man pages.  These may
5320 be acceptable background tasks while compiling or word processing but
5321 not while playing video.  Disable these operations by editing
5322 @b{/etc/rc.d/init.d/anacron}.
5324 Put @b{exit} before the first line not beginning in @b{#}.
5326 In @b{/etc/rc.d/init.d/crond} put @b{exit} before the first line not
5327 beginning in @b{#}.  Then make like Win 2000 and reboot.
5329 You can't use the @b{at} command anymore, but who uses that command
5330 anyways?
5340 @node REDUCING USB MOUSE SENSITIVITY
5341 @section REDUCING USB MOUSE SENSITIVITY
5343 Gamers like high resolution mice, but this can be painful for precisely
5344 positioning the mouse on a timeline or video screen.  XFree86 once
5345 allowed you to reduce PS/2 mouse sensitivity using commands like
5346 @b{xset m 1 1} but you're out of luck with USB mice or KVM's.
5348 We have a way to reduce USB mouse sensitivity but it requires editing
5349 the kernel source code.  Even though USB mice have been supported for
5350 years, the kernel source code for USB mice is constantly being
5351 rewritten.  These instructions were relevant for 2.6.12.3.  Edit
5352 @b{/usr/src/linux/drivers/input/mousedev.c}.  
5354 After the line saying 
5356 @example
5357 struct mousedev_hw_data @{
5358 @end example
5363 @example
5364 #define DOWNSAMPLE_N 100
5365 #define DOWNSAMPLE_D 350
5366 int x_accum, y_accum;
5367 @end example
5369 Next, the section which says something like:
5371 @example
5372 switch (code) @{
5373         case REL_X:     mousedev->packet.dx += value; break;
5374         case REL_Y:     mousedev->packet.dy -= value; break;
5375         case REL_WHEEL: mousedev->packet.dz -= value; break;
5377 @end example
5379 must be replaced by
5381 @example
5383         switch (code) @{
5384                 case REL_X:
5385                         mousedev->packet.x_accum += value * DOWNSAMPLE_N;
5386                         mousedev->packet.dx += (int)mousedev->packet.x_accum / (int)DOWNSAMPLE_D;
5387                         mousedev->packet.x_accum -= ((int)mousedev->packet.x_accum / (int)DOWNSAMPLE_D) * (int)DOWNSAMPLE_D;
5388                         break;
5389                 case REL_Y:
5390                         mousedev->packet.y_accum += value * DOWNSAMPLE_N;
5391                         mousedev->packet.dy -= (int)mousedev->packet.y_accum / (int)DOWNSAMPLE_D;
5392                         mousedev->packet.y_accum -= ((int)mousedev->packet.y_accum / (int)DOWNSAMPLE_D) * (int)DOWNSAMPLE_D;
5393                         break;
5394                 case REL_WHEEL: mousedev->packet.dz -= value; break;
5395         @}
5399 @end example
5401 Change the value of @b{DOWNSAMPLE_N} to change the mouse sensitivity.
5410 @node ASSORTED X TWEEKS
5411 @section ASSORTED X TWEEKS
5414 XFree86 by default can't display Cinelerra's advanced pixmap rendering
5415 very fast.  The X server stalls during list box drawing.  Fix this by
5416 adding a line to your XF86Config* files.
5418 In the @b{Section "Device"} area, add a line saying:
5420 @b{Option "XaaNoOffscreenPixmaps"}
5422 and restart the X server.
5426 Screen blanking is really annoying, unless you're fabulously rich and
5427 can afford to leave your monitor on 24 hours a day without power saving
5428 mode.  In @b{/etc/X11/xinit/xinitrc} put 
5430 @example
5431 xset s off
5432 xset s noblank
5433 @end example
5435 before the first @b{if} statement.
5437 How about those windows keys which no Linux distribution even thinks to
5438 use.  You can make the window keys provide ALT functionality by editing
5439 @b{/etc/X11/Xmodmap}.  Append the following to it.
5441 @example
5442 keycode 115 = Hyper_L
5443 keycode 116 = Hyper_R
5444 add mod4 = Hyper_L
5445 add mod5 = Hyper_R
5446 @end example
5448 The actual changes to a window manager to make it recognize window keys
5449 for ALT are complex.  In @b{FVWM} at least, you can edit
5450 @b{/etc/X11/fvwm/system.fvwm2rc} and put
5452 @example
5453 Mouse 0 T A move-and-raise-or-raiselower
5454 #Mouse 0 W M move
5455 Mouse 0 W 4 move
5456 Mouse 0 W 5 move
5457 Mouse 0 F A resize-or-raiselower
5458 Mouse 0 S A resize-or-raiselower
5459 @end example
5461 in place of the default section for moving and resizing.  Your best
5462 performance is going to be on FVWM.  Other window managers seem to slow
5463 down video with extra event trapping and aren't as efficient in layout.
5475 @node SPEEDING UP THE FILE SYSTEM
5476 @section SPEEDING UP THE FILE SYSTEM
5478 You'll often store video on an expensive, gigantic disk array separate
5479 from your boot disk.  You'll thus have to manually install an EXT
5480 filesystem on this disk array, using the @b{mke2fs} command.  By far
5481 the fastest file system is 
5483 @example
5485 mke2fs -i 65536 -b 4096 my_device
5486 tune2fs -r0 -c10000 my_device
5488 @end example
5490 This has no journaling, reserves as few blocks as possible for
5491 filenames, and accesses the largest amount of data per block possible.
5492 A slightly slower file system, which is easier to recover after power
5493 failures is
5495 @example
5497 mke2fs -j -i 65536 -b 4096 my_device
5498 tune2fs -r0 -c10000 my_device
5500 @end example
5502 This adds a journal which slows down the writes but makes us immune to
5503 power failures.
5511 @node IMPROVING ZORAN VIDEO
5512 @section IMPROVING ZORAN VIDEO
5514 Video recorded from the ZORAN inputs is normally unaligned or not
5515 completely encoded on the right.  This can be slightly compensated by
5516 adjusting parameters in the driver sourcecode.
5518 In @b{/usr/src/linux/drivers/media/video/zr36067.c} the structures
5519 defined near line 623 affect alignment.  At least for NTSC, the 2.4.20
5520 version of the driver could be improved by changing 
5522 @example
5523 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 16 @};
5524 @end example
5528 @example
5529 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 17 @};
5530 @end example
5533 In @b{/usr/src/linux/drivers/media/video/bt819.c} more structures near
5534 line 76 affect alignment and encoding.
5536 For NTSC 
5538 @example
5539 @{858 - 24, 2, 523, 1, 0x00f8, 0x0000@},
5540 @end example
5542 could be changed to 
5543 @example
5544 @{868 - 24, 2, 523, 1, 0x00f8, 0x0000@},
5545 @end example
5547 Adjusting these parameters may or may not move your picture closer to
5548 the center.  More of the time, they'll cause the driver to lock up
5549 before capturing the first frame.
5552 @subsection NEW IN 2.6.5
5554 In the 2.6 kernels, the video subsystem was rewritten again from
5555 scratch.  To adjust the Zoran parameters go to
5556 @b{drivers/media/video/zoran_card.c} and look for a group of lines like
5558 @example
5559 static struct tvnorm f50sqpixel = @{ 944, 768, 83, 880, 625, 576, 16 @};
5560 static struct tvnorm f60sqpixel = @{ 780, 640, 51, 716, 525, 480, 12 @};
5561 static struct tvnorm f50ccir601 = @{ 864, 720, 75, 804, 625, 576, 18 @};
5562 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 16 @};
5564 static struct tvnorm f50ccir601_lml33 = @{ 864, 720, 75+34, 804, 625, 576, 18 @};
5565 static struct tvnorm f60ccir601_lml33 = @{ 858, 720, 57+34, 788, 525, 480, 16 @};
5567 /* The DC10 (57/16/50) uses VActive as HSync, so HStart must be 0 */
5568 static struct tvnorm f50sqpixel_dc10 = @{ 944, 768, 0, 880, 625, 576, 0 @};
5569 static struct tvnorm f60sqpixel_dc10 = @{ 780, 640, 0, 716, 525, 480, 12 @};
5571 /* FIXME: I cannot swap U and V in saa7114, so i do one
5572  * pixel left shift in zoran (75 -> 74)
5573  * (Maxim Yevtyushkin <max@@linuxmedialabs.com>) */
5574 static struct tvnorm f50ccir601_lm33r10 = @{ 864, 720, 74+54, 804, 625, 576, 18 @};
5575 static struct tvnorm f60ccir601_lm33r10 = @{ 858, 720, 56+54, 788, 525, 480, 16 @};
5576 @end example
5578 These seem to control the image position.  At least for the LML33 the
5579 following definition for @b{f60ccir601_lml33} does the trick.
5581 @example
5582 static struct tvnorm f60ccir601_lml33 = @{ 858, 720, 67+34, 788, 525, 480, 13 @};
5583 @end example
5590 @node TROUBLESHOOTING
5591 @chapter TROUBLESHOOTING
5594 @menu
5595 * BUZ DRIVER CRASHES::
5596 * DRAGGING IN AND OUT POINTS DOESN'T WORK::
5597 * LOCKING UP WHEN LOADING FILES::
5598 * SYNCHRONIZATION LOST WHILE RECORDING::
5599 * APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK::
5600 @end menu
5602 @node BUZ DRIVER CRASHES
5603 @section BUZ DRIVER CRASHES
5605 First, Zoran capture boards must be accessed using the @b{Buz} video
5606 driver in @b{Preferences->Recording} and @b{Preferences->Playback}. 
5607 Some performance tweeks are available in another section. 
5608 @xref{IMPROVING PERFORMANCE}.
5610 Once tweeked, the Buz driver seems to crash if the number of recording
5611 buffers is too high.  Make sure @b{Preferences->Recording->Frames to
5612 buffer in device} is below 10.
5615 @node DRAGGING IN AND OUT POINTS DOESN'T WORK
5616 @section DRAGGING IN AND OUT POINTS DOESN'T WORK
5619 Sometimes there will be two edits really close together.  The point
5620 selected for dragging may be next to the indended edit on an edit too
5621 small to see at the current zoom level.  Zoom in horizontally.
5625 @node LOCKING UP WHEN LOADING FILES
5626 @section LOCKING UP WHEN LOADING FILES
5629 The most common reason loading files locks up is because the codec
5630 isn't supported.  Another reason is because Cinelerra is building
5631 picons for the Resources window.  If you load a large number of images,
5632 it needs to decompress every single image to build a picon.  Go into
5633 settings->preferences->interface and disable @b{Use thumbnails in
5634 resource window} to skip this process.
5640 @node SYNCHRONIZATION LOST WHILE RECORDING
5641 @section SYNCHRONIZATION LOST WHILE RECORDING
5643 If the framerate of the recording is much lower than the framerate of
5644 the source, the video will accumulate in the recording buffers over
5645 time while the audio and video are well out of sync.  Decrease the
5646 @b{number of frames to buffer in the device} in
5647 @b{preferences->recording} so the excess frames are dropped instead of
5648 buffered.
5650 @node APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK
5651 @section APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK
5653 The linearize effect uses the pow function while the blur effect uses a
5654 number of exp functions in the math library.  For some reason, using
5655 the pow function breaks later calls to the exp functions in the math
5656 library.  You need to apply linearize after blur to get it to work.
5667 @node SECRETS OF CINELERRA
5668 @chapter SECRETS OF CINELERRA
5670 In this section, you'll find ways to apply Cinelerra to common
5671 problems.  Other sections are arranged in order of the tools and what
5672 the tools are used for.  This section is arranged in order of the
5673 problems and what tools are used to solve the problems.
5675 @menu
5676 * DOLBY PRO LOGIC ENCODING::
5677 * ANALOG TV CLEANING::
5678 * DEFEATING INTERLACING::
5679 * MAKING VIDEO LOOK LIKE FILM::
5680 * CLEARING OUT HAZE::
5681 * MAKING A DVD::
5682 * MAKING A RINGTONE::
5683 * TIME STRETCHING AUDIO::
5684 * PITCH SHIFTING AUDIO::
5685 @end menu
5688 @node DOLBY PRO LOGIC ENCODING
5689 @section DOLBY PRO LOGIC ENCODING
5691 Dolby pro logic is an easy way to output 6 channel audio from a 2
5692 channel soundcard with degraded but useful results.  Rudimentary Dolby
5693 pro logic encoding can be achieved with clever usage of the effects.
5695 Create 2 audio tracks with the same audio.  Apply @b{invert audio} to
5696 one track.  The signal comes out of the back speakers.
5698 Create a single audio track with monaural audio of a different source. 
5699 Center it in the @b{pan} control.  The signal comes out of the center
5700 speaker.
5702 Create other tracks with different signals and pan them left or right
5703 to put signals in the front left or right speaker.
5705 Finally, if a copy of the signal in the back speakers is desired in any
5706 single front speaker, the signal in the back speakers must be delayed
5707 by at least 0.05 seconds and a single new track should be created.  Pan
5708 the new track to orient the signal in the front speakers.
5710 If the same signal is desired in all the speakers except the center
5711 speaker, delay the back speakers by 0.5 seconds and delay either the
5712 front left or front right by 0.2 seconds.
5714 If you want to hear something from the subwoofer, create a new track,
5715 select a range, drop a synthesizer effect, and set the frequency below
5716 60 Hz.  The subwoofer merely plays anything below around 60Hz.
5718 Other tricks you can perform to separate the speakers are parametric
5719 equalization to play only selected ranges of frequencies through
5720 different speakers and lowpass filtering to play signals through the
5721 subwoofer.
5726 @node ANALOG TV CLEANING
5727 @section ANALOG TV CLEANING
5730 Unless you live in a rich nation like China or are a terrorist, you
5731 probably record analog TV more than you record digital TV.  The picture
5732 quality on analog TV is horrible but you can do things in Cinelerra to
5733 make it look more like it did in the studio.
5735 First, when capturing the video, capture it in the highest resolution
5736 possible.  For Europeans it's 720x576 and for Americans it's 720x480. 
5737 Don't bother adjusting the brightness or contrast in the recording
5738 monitor, although maxing out the color is useful.  Capture it using
5739 MJPEG or uncompressed Component Video if possible.  If those are too
5740 demanding, then capture it using JPEG.  RGB should be a last resort.
5742 Now on the timeline use @b{Settings->Format} to set a YUV colorspace. 
5743 Drop a @b{Downsample} effect on the footage.  Set it for 
5745 @example
5746 Horizontal:        2
5747 Horizontal offset: 0
5748 Vertical:          2
5749 Vertical offset:   0
5751       red
5752   x   green
5753   x   blue
5754       alpha
5755 @end example
5757 Use the camera tool to shift the picture up or down a line to remove
5758 the most color interference from the image.  This is the difference
5759 we're looking for:
5761 @sp 1
5763 @image{cleaning1}
5765 If you have vertical blanking information or crawls which constantly
5766 change in each frame, block them out with the @b{Mask} tool.  This
5767 improves compression ratios.
5769 This is about all you can do without destroying more data than you
5770 would naturally lose in compression.  The more invasive cleaning
5771 techniques involve deinterlacing.
5777 @node DEFEATING INTERLACING
5778 @section DEFEATING INTERLACING
5781 Interlacing is done on most video sources because it costs too much to
5782 build progressive scanning cameras and progressive scanning CRT's. 
5783 Many a consumer has been dissapointed to spend 5 paychecks on a
5784 camcorder and discover what horrible jagged images it produces on a
5785 computer monitor.
5787 As for progressive scanning camcorders, forget it.  Cost factors are
5788 probably going to keep progressive scanning cameras from ever equalling
5789 the spatial resolution of interlaced cameras.  Interlacing is here to
5790 stay.  That's why they made deinterlacing effects in Cinelerra.
5792 We don't believe there has ever been a perfect deinterlacing effect. 
5793 They're either irreversible or don't work.  Cinelerra cuts down the
5794 middle by providing deinterlacing tools that are irreversible sometimes
5795 and don't work sometimes but are neither one or the other.
5797 @b{Line Doubling}
5799 This one is done by the @b{Deinterlace} effect when set to @b{Odd
5800 lines} or @b{Even lines}.  When applied to a track it reduces the
5801 vertical resolution by 1/2 and gives you progressive frames with
5802 stairstepping.  This is only useful when followed by a scale effect
5803 which reduces the image to half its size.
5805 @b{Line averaging}
5807 The @b{Deinterlace} effect when set to @b{Average even lines} or
5808 @b{Average odd lines} does exactly what line doubling does except
5809 instead of making straight copies of the lines it makes averages of the
5810 lines.  This is actually useful for all scaling.
5812 There's an option for adaptive line averaging which selects which lines
5813 to line average and which lines to leave interlaced based on the
5814 difference between the lines.  It doesn't work.
5816 @b{Inverse Telecine}
5818 This is the most effective deinterlacing tool when the footage is an
5819 NTSC TV broadcast of a film.  @xref{INVERSE TELECINE}.
5822 @b{Time base correction}
5824 The first three tools either destroy footage irreversibly or don't work
5825 sometimes.  @b{Time base correction} is last because it's the perfect
5826 deinterlacing tool.  It leaves the footage intact.  It doesn't reduce
5827 resolution, perceptually at least.  It doesn't cause jittery timing.
5829 The @b{Frames to Fields} effect converts each frame to two frames, so
5830 it must be used on a timeline whose project frame rate is twice the
5831 footage's frame rate.  In the first frame it puts a line averaged copy
5832 of the even lines.  In the second frame it puts a line averaged copy of
5833 the odd lines.  When played back at full framerates it gives the
5834 illusion of progressive video with no loss of detail.
5836 Best of all, this effect can be reversed with the @b{Fields to frames}
5837 effect.  That one combines two frames of footage back into the one
5838 original interlaced frame of half the framerate.
5840 Be aware that frames to fields inputs frames at half the framerate as
5841 the project.  Effects before frames to fields process at the reduced
5842 framerate.
5844 Unfortunately, the output of @b{Frames to Fields} can't be compressed
5845 as efficiently as the original because it introduces vertical twitter
5846 and a super high framerate.
5848 Interlaced 29.97fps footage can be made to look like film by applying
5849 @b{Frames to Fields} and then reducing the project frame rate of the
5850 resulting 59.94fps footage to 23.97fps.  This produces no timing jitter
5851 and the occasional odd field gives the illusion of more detail than
5852 there would be if you just line averaged the original.
5855 @b{HDTV exceptions}
5857 1920x1080 HDTV is encoded a special way.  If it's a broadcast of
5858 original HDTV film, an inverse telecine works fine.  If it's a
5859 rebroadcast of a 720x480 source, you need to use a time base and line
5860 doubling algorithm to deinterlace it, @xref{1080 TO 480}.
5865 @node MAKING VIDEO LOOK LIKE FILM
5866 @section MAKING VIDEO LOOK LIKE FILM
5871 Video sweetening is constantly getting better.  Lately the best thing
5872 you can do for dirt cheap consumer camcorder video is to turn it into
5873 progressive 24fps output.  While you can't really do that, you can get
5874 pretty close for the money.  Mind you, this procedure can degrade high
5875 quality video just as easily as it improves low quality video.  It
5876 should only be used for low quality video.
5878 @itemize
5880 @item
5882 Step 1 - Set project framerate to twice the video framerate.
5884 @item
5886 Step 2 - Apply a @b{Sharpen} effect.  Set it to sharpness: 25, no
5887 interlacing, and horizontal only.
5889 @item
5891 Step 3 - Drop a @b{Frame to Fields} effect on the same track.  Set
5892 Average Empty Rows on and play through the video a few times to figure
5893 out which field is first.  If the wrong field is first, the motion is
5894 shaky.  Secondly, any editing in the doubled frame rate may now screw
5895 up the field order.  We're still figuring out the easiest way to
5896 support warnings for field glitches but for now you need to go back to
5897 the normal framerate to do editing or play test to make sure the fields
5898 are right.
5901 @item
5903 Step 4 - Render just the video to the highest quality file possible.
5905 @item
5907 Step 5 - Import the video back to a new track.  Set the project
5908 framerate to 24.  The new track should now display more filmish and
5909 sharper images than the original footage.
5911 @end itemize
5913 This entire procedure could be implemented in one nonrealtime effect,
5914 but the biggest problem with that is you'll most often want to keep the
5915 field based output and the 24fps output for posterity.  A nonrealtime
5916 effect would require all that processing just for the 24fps copy. 
5917 Still debating that one.
5927 @node CLEARING OUT HAZE
5928 @section CLEARING OUT HAZE
5930 Let's face it, if you're employed you live in Silicon Valley.  As such
5931 you probably photograph a lot of haze and never see blue sky ever. 
5932 Even if you can afford to briefly go somewhere where there is blue sky,
5933 horizon shots usually can stand for more depth.  This is what the
5934 @b{gradient effect} is for.
5936 Drop the gradient effect on hazy tracks.  Set the following parameters:
5938 @example
5939 Angle: 0
5940 Inner radius: 0
5941 Outer radius: 40
5942 Inner color: blue 100% alpha
5943 Outer color: blue 0% alpha
5944 @end example
5946 It's important to set the 0% alpha color to blue even though it's 0%
5947 alpha.  The color of the outer alpha is still interpolated with the
5948 inner color.  This is a generally applicable setting for the gradient. 
5949 Some scenes may work better with orange or brown for an evening feel.
5957 @node MAKING A DVD
5958 @section MAKING A DVD
5960 @b{A single chapter DVD}
5962 Make a single chapter DVD by rendering video to an MPEG video file. 
5963 The video should be 720x480, 29.97fps.  The aspect ratio should be 16x9
5964 or 4x3.
5966 Use the YUV 4:2:0 color model and DVD preset.  Set the bitrate to the
5967 desired bitrate.  It's not clear exactly what other parameters the MPEG
5968 encoder uses in the DVD preset but we've enabled the following:
5970 @example
5971 Derivative: MPEG-2
5972 Fixed bitrate
5973 I frame distance: 15
5974 P frame distance: 0
5975 Sequence start codes in every GOP
5976 @end example
5978 Render the audio to an AC3 audio file.  Any bitrate can be used.
5980 @b{Dvdrtools} must be downloaded to generate the actual DVD
5981 filesystem.  The actual usage of dvdrtools changes frequently but
5982 currently it involves the mkisofs and ifogen programs.  Mkisofs is
5983 built automatically in dvdrtools but ifogen may have to be built
5984 manually by entering the @b{video} directory and running @b{make
5985 ifogen}.  Mkisofs and ifogen must be put into /usr/bin manually.
5987 Also, the @b{mplex} program from @b{mjpegtools} must be installed.  The
5988 mjpegtools package is built in the hvirtual distribution and the mplex
5989 utility may be extracted from there.
5991 Given the files audio.ac3 and video.m2v, rendered by Cinelerra, the
5992 following commands pack them into a dvd readable by commercial
5993 appliances.
5995 @example
5996 mplex -M -f 8 -o final.mpg audio.ac3 video.m2v
5997 mkdir -p dvd/VIDEO_TS
5998 ifogen final.mpg -o dvd
5999 ifogen -T -o dvd
6000 mkisofs -dvd-video -udf -o dvd.iso dvd/
6001 @end example
6003 dvd.iso can be burned directly to a DVD with the following:
6005 @example
6006 dvdrecord -ignsize -dao -v dev=0,0,0 fs=67108864 dvd.iso
6007 @end example
6009 The argument to dev= is determined by running @b{dvdrecord -scanbus}
6010 and picking the right 3 digit device number.  This also requires
6011 interfacing the DVD drive through the scsi modules @b{ide-scsi, cdrom,
6012 sg}.
6021 @node MAKING A RINGTONE
6022 @section MAKING A RINGTONE
6024 This is how we made ringtones for the low end Motorola V180's and it'll
6025 probably work with any new phone.  Go to @b{File->Load files...} and
6026 load a sound file with Insertion strategy: @b{Replace current
6027 project}.  Go to @b{Settings->Format} change @b{Channels} to 1 and
6028 @b{Samplerate} to 16000 or 22050.
6030 Either highlight a region of the timeline or set in/out points to use
6031 for the ringtone.  To improve sound quality on the cell phone, you need
6032 the maximum amplitude in as many parts of the sound as possible.  Right
6033 click on track Audio 1 and select @b{Attach effect..}.  Highlight the
6034 @b{Compressor} effect and hit @b{Attach} in the attachment popup.
6036 Make sure the insertion point or highlighted area is in the region with
6037 the Compressor effect. Right click on track Audio 2 and select
6038 @b{Attach effect..}.  Highlight @b{Audio 1: Compressor} and hit
6039 @b{Attach}.  Click the Audio1 Compressor's magnifying glass
6040 @image{magnify} to bring up the compressor GUI.
6042 Set the following parameters:
6044 @example
6045 Reaction secs: @b{-0.1}
6046 Decay secs: @b{0.1}
6047 Trigger Type: @b{Total}
6048 Trigger: @b{0}
6049 Smooth only: @b{No}
6050 @end example
6053 Click @b{Clear} to clear the graph.  Click anywhere in the
6054 grid area and drag a new point to 0 Output and -50 Input.  The graph
6055 should look like this.
6057 @sp 1
6058 @image{compress}
6060 Go to @b{File->Render}.  Specify the name of an mp3 file to output to. 
6061 Set the file format to @b{MPEG Audio}.  Click the wrench @image{wrench}
6062 for Audio and set @b{Layer} to @b{III} and @b{Kbits per second} to
6063 @b{24} or @b{32}.  Check @b{Render audio tracks} and uncheck @b{Render
6064 video tracks}.  Hit OK to render the file.
6066 The resulting .mp3 file must be uploaded to a web server.  Then, the
6067 phone's web browser must download the .mp3 file directly from the URL.
6068 There also may be a size limit on the file.
6076 @node TIME STRETCHING AUDIO
6077 @section TIME STRETCHING AUDIO
6079 It may appear that time stretching audio is a matter of selecting a
6080 region of the audio tracks, enabling recording for the desired tracks,
6081 going to @b{Audio->Render Effect}, and applying @b{Time Stretch}.  In
6082 actuality there are 3 audio effects for time stretching: @b{Time
6083 Stretch}, @b{Resample}, and @b{Asset info dialog}.
6085 Time Stretch applies a fast fourier transform to try to change the
6086 duration without changing the pitch, but this introduces windowing
6087 artifacts to the audio.  It's only useful for large changes in time
6088 because obvious changes in duration make windowing artifacts less
6089 obtrusive.
6091 For smaller changes in duration, in the range of 5%, @b{Resample}
6092 should be used.  This changes the pitch of the audio but small enough
6093 changes aren't noticable.  Resample doesn't introduce any windowing
6094 artifacts, so this is most useful for slight duration changes where the
6095 listener isn't supposed to know what's going on.
6097 Another way to change duration slightly is to go to the @b{Resources}
6098 window, highlight the @b{media} folder, right click on an audio file,
6099 click on @b{Info}.  Adjust the sample rate in the @b{Info} dialog to
6100 adjust the duration.  This method also requires left clicking on the
6101 right boundary of the audio tracks and dragging left or right to
6102 correspond to the length changes.
6105 @node PITCH SHIFTING AUDIO
6106 @section PITCH SHIFTING AUDIO
6108 Like the time stretching methods, there are three pitch shifting
6109 methods: @b{Pitch shift}, @b{Resample}, and @b{Asset info dialog}. 
6110 Pitch shift is a realtime effect which can be dragged and dropped onto
6111 recordable audio tracks.  Pitch shift uses a fast fourier transform to
6112 try to change the pitch without changing the duration, but this
6113 introduces windowing artifacts.
6115 Because the windowing artifacts are less obtrusive in audio which is
6116 obvously pitch shifted, Pitch shift is mainly useful for extreme pitch
6117 changes.  For mild pitch changes, use @b{Resample} from the
6118 @b{Audio->Render Effect} interface.  Resample can change the pitch
6119 within 5% without a noticable change in duration.
6121 Another way to change pitch slightly is to go to the @b{Resources}
6122 window, highlight the @b{media} folder, right click on an audio file,
6123 click on @b{Info}.  Adjust the sample rate in the @b{Info} dialog to
6124 adjust the pitch.  This method also requires left clicking on the right
6125 boundary of the audio tracks and dragging left or right to correspond
6126 to the length changes.
6135 @node SECRETS OF CINELERRA EFFECTS
6136 @chapter SECRETS OF CINELERRA EFFECTS
6138 Most effects in Cinelerra can be figured out just by using them and
6139 tweeking.  Here are brief descriptions of effects which you might not
6140 utilize fully by mere experimentation.
6143 @menu
6144 * 1080 TO 480::       How to convert HDTV into SD
6145 * CHROMA KEY::        Create transparency based on color similarities.
6146 * COMPRESSOR::        How to reduce the dynamic range of audio.
6147 * DECIMATE::          How to reduce frame rates by eliminating similar frames.
6148 * DEINTERLACE::       How to convert interlaced video to progressive video.
6149 * DIFFERENCE KEY::    Create transparency based on color differences.
6150 * FIELDS TO FRAMES::  How to recover interlaced video from bobbed video
6151 * FREEZE FRAME::      How to stop action in the timeline.
6152 * HISTOGRAM::         How to change the mapping of different brightness values.
6153 * INVERSE TELECINE::  How to convert pulled down frames to progressive frames.
6154 * INTERPOLATE VIDEO:: How to create the illusion of higher framerates.
6155 * LINEARIZE::         Fix gamma in raw camera images
6156 * LIVE AUDIO::        Pass audio from the soundcard directly to the timeline.
6157 * LIVE VIDEO::        Pass video from the capture card directly to the timeline.
6158 * LOOP::              How to loop regions of the timeline.
6159 * MOTION::            The art of motion tracking.
6160 * REFRAMERT::         Changing the number of frames in a sequence.
6161 * REFRAME::           Changing the number of frames in a sequence with rendering.
6162 * RESAMPLE::          Change the number of samples in a sequence with rendering.
6163 * REVERSE VIDEO/AUDIO:: How to play regions in reverse.
6164 * THRESHOLD::         How to get monochrome out of a region of the image.
6165 * TIME AVERAGE::      How to add trail patterns or increase still image quality.
6166 * TITLER::            How to add text to a track from inside Cinelerra.
6167 * VIDEO SCOPE::       How to view the dynamic range of intensity and hue.
6168 @end menu
6173 @node 1080 TO 480
6174 @section 1080 TO 480
6177 Most TV broadcasts are recieved with a 1920x1080 resolution but
6178 originate from a 720x480 source at the studio.  It's a waste of space
6179 to compress the entire 1920x1080 if the only resolvable details are
6180 720x480.  Unfortunately resizing 1920x1080 video to 720x480 isn't as
6181 simple as shrinking it.
6183 At the TV station the original 720x480 footage was first converted to
6184 fields of 720x240.  Each field was then scaled up to 1920x540.  The two
6185 1920x540 fields were finally combined with interlacing to form the
6186 1920x1080 image.  This technique allows a consumer TV to display the
6187 resampled image without extra circuitry to handle 720x480 interlacing
6188 in a 1920x1080 image.
6190 If you merely deinterlaced the 1920x1080 images, you would end up with
6191 resolution of 720x240.  The @b{1080 to 480} effect properly extracts
6192 two 1920x540 size fields from the image, resizes them separately, and
6193 combines them again to restore a 1920x480 interlaced image.  The
6194 @b{scale} effect must then be applied to reduce the horizontal size to
6195 960 or 720 depending on the original aspect ratio.
6197 The tracks to which @b{1080 to 480} is applied need to be at 1920x1080
6198 resolution.  The project settings in @b{settings->format} should be at
6199 least 720x480 resolution.
6201 The effect doesn't know if the first row in the 1920x1080 image belongs
6202 to the first row of the 720x480 original.  You have to specify what the
6203 first row is in the effect configuration.
6205 The output of this effect is a small image in the middle of the
6206 original 1920x1080 frame.  Use the projector to center the output image
6207 in the playback.
6209 Finally, once you have 720x480 interlaced video you can either apply
6210 @b{frames to fields} of @b{inverse telecine} to further recover original
6211 progressive frames.
6219 @node CHROMA KEY
6220 @section CHROMA KEY
6223 This effect erases pixels which match the selected color.  They are
6224 replaced with black if there is no alpha channel and transparency if
6225 there is an alpha channel.  The selection of color model is important
6226 to determine the behavior.
6228 Chroma key uses either the lightness or the hue to determine what is
6229 erased.  @b{Use value} singles out only the lightness to determine
6230 transparency.  Select a center color to erase using the @b{Color}
6231 button.  Alternatively a color can be picked directly from the output
6232 frame by first using the @b{color picker} in the compositor window and
6233 then selecting the @b{Use color picker} button.  This sets the chroma
6234 key color to the current color picker color.
6236 Be aware that the output of the chroma key is fed back to the
6237 compositor, so selecting a color again from the compositor will use the
6238 output of the chroma key effect.  The chroma key should be disabled
6239 when selecting colors with the color picker.
6242 If the lightness or hue is within a certain threshold it's erased. 
6243 Increasing the threshold determines the range of colors to be erased. 
6244 It's not a simple on/off switch, however.  As the color approaches the
6245 edge of the threshold, it gradually gets erased if the slope is high or
6246 is rapidly erased if the slope is low.  The slope as defined here is
6247 the number of extra values flanking the threshold required to go from
6248 opaque to transparent.
6250 Normally threshold is very low when using a high slope.  The two
6251 parameters tend to be exclusive because slope fills in extra threshold.
6253 The slope tries to soften the edges of the chroma key but it doesn't
6254 work well for compressed sources.  A popular softening technique is to
6255 use a maximum slope and chain a blur effect below the chroma key effect
6256 to blur just the alpha.
6266 @node COMPRESSOR
6267 @section COMPRESSOR
6269 Contrary to computer science experience, the audio compressor does not
6270 reduce the amount of data required to store the audio.  The audio
6271 compressor reduces the dynamic range of the audio.  In Cinelerra the
6272 compressor actually performs the function of an expander and
6273 compressor.
6275 The compressor works by calculating the maximum sound level within a
6276 certain time period of the current position.  The maximum sound level
6277 is taken as the input sound level.  For every input sound level there
6278 is an output sound level specified by the user.  The gain at the
6279 current position is adjusted so the maximum sound level in the time
6280 range is the user specified value.
6282 The compressor has a graph which correlates every input sound level to
6283 an output level.  The horizontal direction is the input sound level in
6284 dB.  The vertical direction is the ouptut sound level in dB.  The user
6285 specifies output sound levels by creating points on the graph.  Click
6286 in the graph to create a point.  If 2 points exist, drag one point
6287 across another point to delete it.  The most recent point selected has
6288 its vales displayed in textboxes for more precise adjustment.
6290 To make the compressor reduce the dynamic range of the audio, make all
6291 the output values greater than the input values except 0 db.  To make
6292 the compressor expand the dynamic range of the audio, make all the
6293 output values except 0 db less than the input values.  The algorithm
6294 currently limits all sound levels above 0 db to 0 db so to get an
6295 overloaded effect put a gain effect before the compressor to reduce all
6296 the levels and follow it with another gain effect to amplify all the
6297 levels back over 0 db.
6299 @b{Reaction secs:} This determines where in relation to the current
6300 position the maximum sound level is taken and how fast the gain is
6301 adjusted to reach that peak.  It's notated in seconds.  If it's
6302 negative the compressor reads ahead of the current position to get the
6303 future peak.  The gain is ramped to that peak over one reaction time. 
6304 This allows it to hit the desired output level exactly when the input
6305 peak occurs at the current position.
6307 If the reaction time is positive the compressor scans only the current
6308 position for the gain and ramps gain over one reaction time to hit the
6309 desired output level.  It hits the output level exactly one reaction
6310 time after detecting the input peak.
6312 @b{Decay secs:} If the peak is higher than the current level, the
6313 compressor ramps the gain up to the peak value.  Then if a future peak
6314 is less than the current peak it ramps the gain down.  The time taken
6315 to ramp the gain down can be greater than the time taken to ramp the
6316 gain up.  This ramping down time is the decay seconds.
6318 @b{Trigger type:}  The compressor is a multichannel effect.  Several
6319 tracks can share one compressor.  How the signal from many tracks is
6320 interpreted is determined by the trigger type.
6322 The @b{Trigger} trigger type uses the value supplied in the @b{Trigger}
6323 textbox as the number of the track to use as input for the compressor. 
6324 This allows a track which isn't even heard to determine the loudness of
6325 the other tracks.
6327 The @b{Maximum} trigger takes the loudest track and uses it as the
6328 input for the compressor.
6330 The @b{Total} trigger type adds the signals from all the tracks and
6331 uses the total as the input for the compressor.  This is the most
6332 natural sounding compression and is ideal when multiple tracks are
6333 averaged into single speakers.
6337 @b{Trigger:} The compressor is a multichannel effect.  Several tracks
6338 can share one compressor.  Normally only one track is scanned for the
6339 input peak.  This track is specified by the @b{Trigger}.  By sharing
6340 several tracks and playing with the trigger value, you can make a sine
6341 wave on one track follow the amplitude of a drum on another track for
6342 example.
6344 @b{Smooth only:} For visualizing what the compressor is doing to the
6345 soundlevel, this option causes it to replace the soundwave with just
6346 the current peak value.  It makes it very easy to see how @b{reaction
6347 secs} affects the detected peak values.
6355 @node DECIMATE
6356 @section DECIMATE
6358 This effect drops frames from a track which are most similar in order
6359 to reduce the frame rate.  This is usually applied to a DVD to convert
6360 the 29.97 fps video to the 23.97 fps film rate but this decimate effect
6361 can take any input rate and convert it to any lower output rate.
6363 The output rate of @b{decimate} is the project frame rate.  The input
6364 rate is set in the @b{decimate} user interface.  To convert 29.97fps
6365 progressive video to 23.97fps film, apply a decimate effect to the
6366 track.  Set the decimate input rate to 29.97 and the project rate to
6367 23.97.
6369 Be aware every effect layered before decimate processes video at the
6370 decimate input rate and every effect layered after decimate processes
6371 video at the project frame rate.  Computationally intensive effects
6372 should come below decimate.
6381 @node DEINTERLACE
6382 @section DEINTERLACE
6384 The deinterlace effect has evolved over the years to deinterlacing and
6385 a whole lot more.  In fact two of the deinterlacing methods, @b{Inverse
6386 Telecine} and @b{Frames to Fields}, are separate effects.  The
6387 deinterlace effect offers several variations of line replication to
6388 eliminate comb artifacts in interlaced video.  It also has some line
6389 swapping tools to fix improperly captured video or make the result of a
6390 reverse effect display fields in the right order.
6399 @node DIFFERENCE KEY
6400 @section DIFFERENCE KEY
6402 The differency key creates transparency in areas which are similar
6403 between 2 frames.  The Difference key effect must be applied to 2
6404 tracks.  One track contains the action in front of a constant
6405 background and another track contains the background with nothing in
6406 front of it.  Apply the difference key to the track with the action and
6407 apply a shared copy of it to the track with the background.  The track
6408 with the background should be muted and underneath the track with the
6409 action and the colormodel should have an alpha channel.
6411 Pixels which are different between the background and action track are
6412 treated as opaque.  Pixels which are similar are treated as
6413 transparent.  Change @b{threshold} in the differency key window to make
6414 more pixels which aren't the same color transparent. Change @b{slope}
6415 to change the rate at which the transparency tapers off as pixels get
6416 more different.
6418 The slope as defined here is the number of extra values flanking the
6419 threshold required to go from opaque to transparent.  A high slope is
6420 more useful with a low threshold because slope fills in extra
6421 threshold.
6423 @b{Use value} causes the intensity of pixels to be compared instead of
6424 the color.
6426 Applying a blur to the top track with just the alpha channel blurred
6427 can soften the transparency border.
6433 @node FIELDS TO FRAMES
6434 @section FIELDS TO FRAMES
6436 This effects reads frames at twice the project framerate, combining 2
6437 input frames into a single interlaced output frame.  Effects preceeding
6438 @b{fields to frames} process frames at twice the project frame rate. 
6439 Each input frame is called a field.
6441 @b{Fields to frames} needs to know what field corresponds to what lines
6442 in the output frame.  The easiest way to figure it out is to try both
6443 options in the window.  If the input fields are the result of a line
6444 doubling process like @b{frames to fields}, the wrong setting results
6445 in blurrier output.  If the input fields are the result of a standards
6446 conversion process like @b{1080 to 480}, the wrong setting won't make
6447 any difference.
6449 The debobber which converts 720x480 interlaced into 1920x1080
6450 interlaced or 1280x720 progressive seems to degrade the vertical
6451 resolution to the point that it can't be recovered.
6459 @node FREEZE FRAME
6460 @section FREEZE FRAME
6462 In its simplest form, highlight a region of the track to freeze, drop
6463 the freeze frame effect on the highlighted region, and the lowest
6464 numbered frame in the affected area will play throughout the entire
6465 region.  
6467 Freezeframe has an @b{enabled} option which can be keyframed.  Regions
6468 of a freeze frame effect which are enabled repeat the lowest numbered
6469 frame since the last keyframe.  This has unique possibilities.
6471 If a freeze frame effect has a keyframe in the middle of it set to
6472 @b{enabled}, the frame in the middle is repeated in the entire effect.
6474 If a freeze frame effect has several keyframes, each set to
6475 @b{enabled}, every time a keyframe is encountered the frame under it
6476 becomes the frozen one.
6478 If a freeze frame effect alternates between @b{enabled} and
6479 @b{disabled}, each time an @b{enabled} keyframe is encountered the
6480 frame under it is replicated until the next @b{disabled} keyframe.  The
6481 disabled regions play through.
6488 @node HISTOGRAM
6489 @section HISTOGRAM
6492 This shows the number of occurances of each color on a histogram plot.
6494 It is always performed in floating point RGB regardless of
6495 the project colorspace.  The histogram has two sets of transfer
6496 parameters: the input transfer and the output transfer.
6498 4 histograms are possible in the histogram viewer.  The red, green,
6499 blue histograms show the input histograms for red, green, blue and
6500 multiply them by an input transfer to get the output red, green, blue. 
6501 Then the output red, green, blue is scaled by an output transfer.  The
6502 scaled red, green, blue is converted into a value and plotted on the
6503 value histogram.  The value histogram thus changes depending on the
6504 settings for red, green, blue.  The value transfers are applied
6505 uniformly to R, G, B after their color transfers are applied.
6507 Select which transfer to view by selecting one of the channels on the
6508 top of the histogram.
6511 The input transfer is defined by a graph overlaid on the histogram. 
6512 The horizontal direction corresponds to every possible input color. 
6513 The vertical direction corresponds to the output color for every input
6514 color.  Video entering the histogram is first plotted on the histogram
6515 plot, then it is translated so output values now equal the output
6516 values for each input value on the input graph.
6518 The input graph is edited by adding and removing any number of points. 
6519 Click and drag anywhere in the input graph to create a point and move
6520 it.  Click on an existing point to make it active and move it.  The
6521 active point is always indicated by being filled in.  The active
6522 point's input and output color are given in text boxes on top of the
6523 window.  The input and output color of the point can be changed through
6524 these text boxes.
6526 Points can be deleted by first selecting a point and then dragging it
6527 to the other side of an adjacent point.  They can also be deleted by
6528 selecting them and hitting @b{delete}.
6531 After the input transfer, the image is processed by the output
6532 transfer.  The output transfer is simply a minimum and maximum to scale
6533 the input colors to.  Input values of 100% are scaled down to the
6534 output's maximum.  Input values of 0% are scaled up to the output
6535 minimum.
6538 Input values below 0 are always clamped to 0 and input values above
6539 100% are always clamped to 100%.  Click and drag on the output
6540 gradient's triangles to change it.  It also has textboxes to enter
6541 values into.
6543 Enable the @b{automatic} toggle to have the histogram calculate an
6544 automatic input transfer for the red, green, blue but not the value. 
6545 It does this by scaling the middle 99% of the pixels to take 100% of
6546 the histogram width.  The number of pixels permitted to pass through is
6547 set by the @b{Threshold} textbox.  A threshold of 0.99 scales the input
6548 so 99% of the pixels pass through.  Smaller thresholds permit fewer
6549 pixels to pass through and make the output look more contrasty.
6551 Automatic input transfer is calculated for the R, G, and B channels but
6552 not the value.
6555 @b{PLOT HISTOGRAM}
6557 @b{SPLIT OUTPUT}
6566 @node INVERSE TELECINE
6567 @section INVERSE TELECINE
6569 This is the most effective deinterlacing tool when the footage is a
6570 video transfer of a film.  Here the film was converted from 24fps to
6571 60fps.  Then the 60fps was downsampled to 30fps by extracting odd and
6572 even lines and interlacing the lines.  The IVTC effect is primarily a
6573 way to convert interlaced video to progressive video.  It undoes three
6574 patterns of interlacing.
6576 @example
6577   A AB BC CD D
6578   AB CD CD DE EF
6579   Automatic
6580 @end example
6582 The first two options are fixed patterns and affected by the @b{pattern
6583 offset} and @b{odd field first} parameters.  The last option creates
6584 several combinations of lines for each frame and picks the most
6585 progressive combination.  It's a brute force algorithm.
6587 This technique doesn't rely on a pattern like other techniques and is
6588 less destructive but the timing is going to be jittery because of the
6589 lack of a frame rate reduction.  In order to smooth out the timing, you
6590 need to follow inverse telecine with a decimate effect.
6596 @node INTERPOLATE VIDEO
6597 @section INTERPOLATE VIDEO
6600 The interpolate video effect tries to create the illusion of a higher
6601 frame rate from source footage of very low framerates by averaging
6602 frames over time.  It averages two input frames for each output frame. 
6603 The input frames are at different times, resulting in a dissolve for
6604 all output frames between the input frames.  There are two ways of
6605 specifying the input frames.  You can specify an input frame rate which
6606 is lower than the project frame rate.  This causes input frames to be
6607 taken at even intervals,
6609 You can also specify keyframe locations as the positions of the input
6610 frames.  In this mode the output frame rate is used as the input frame
6611 rate and you just create keyframes wherever you want to specify an
6612 input frame.
6617 @node LINEARIZE
6618 @section LINEARIZE
6621 Raw camera images store colors in a logarithmic scale.  The blacks in
6622 these images are nearly 0 and the whites are supposed to be infinity. 
6623 The graphics card and most video codecs store colors in a linear scale
6624 but Cinelerra keeps raw camera images in their original logarithmic
6625 scale when it renders them.  This is necessary because the raw image
6626 parser can't always decode the proper gamma values for the images.  It
6627 also does its processing in 16 bit integers, which takes away a lot of
6628 information.
6630 The linearize effect converts the logarithmic colors to linear colors
6631 through a gamma value and a maximum value.  The gamma value determines
6632 how steep the output curve is and the maximum value is where 1.0 in the
6633 output corresponds to maximum brightness in the input.
6635 The linearize effect has 2 more parameters to simplify gamma
6636 correction.  The @b{automatic} option causes it to calculate @b{max}
6637 from the histogram of the image.  Use this when making a preview of a
6638 long list of images since it changes for every image.
6640 The @b{use color picker} option uses the value currently in the color
6641 picker to set the @b{max} value.  Note that every time you pick a color
6642 from the compositor window, you need to hit @b{use color picker} to
6643 apply the new value.
6652 @node LIVE AUDIO
6653 @section LIVE AUDIO
6655 This effect reads audio directly from the soundcard input.  It replaces
6656 any audio on the track so it's normally applied to an empty track. 
6659 To use Live Audio, highlight a horizontal region of an audio track or
6660 define in and out points.  Then drop the Live Audio effect into it. 
6661 Create extra tracks and attach shared copies of the first Live Audio
6662 effect to the other tracks to have extra channels recorded.
6664 Live Audio uses the sound driver selected in
6665 @b{Settings->Preferences->Playback->Audio Out} for recording, but
6666 unlike recording it uses the @b{playback buffer size} as the recording
6667 buffer size and it uses the @b{project sample rate} as the sampling
6668 rate.
6670 These settings are critical since some sound drivers can't record in
6671 the same sized buffer they play back in.  Live audio has been most
6672 reliable when ALSA is the recording driver and the playback fragment
6673 size is 2048.
6675 Drop other effects after Live Audio to process soundcard input in
6676 realtime.  
6678 Now the bad news.  With live audio there is no readahead so effects
6679 like compressor will either delay if they have readahead enabled or
6680 playback will underrun.  
6682 Another problem is sometimes the recording clock on the soundcard is
6683 slightly slower than the playback clock.  The recording eventually
6684 falls behind and playback sounds choppy.
6686 Finally, live audio doesn't work in reverse.
6692 @node LIVE VIDEO
6693 @section LIVE VIDEO
6695 This effect reads video directly from the capture card input.  It
6696 replaces any video on the track so it's normally applied to an empty
6697 track.  The configuration for the capture card is taken from the
6698 recording preferences.  Go to @b{Settings->Preferences->Recording} to
6699 set up the capture card.
6701 Go to the @b{Video In} section where it says @b{Record driver}.  It
6702 must be set to either @b{Video4Linux2} or @b{IEC 61883}.  Other video
6703 drivers haven't been tested with Live Video and probably won't work.
6705 For live video, the selection for @b{File Format} and @b{Video} needs
6706 to be set to a format the timeline can use.  The file format must be
6707 @b{Quicktime for Linux} and video recording must be enabled for it. 
6708 Click on the wrench @image{wrench} to set the video compression.
6710 The video compression depends on the recording driver.  For the
6711 @b{Video4Linux2} recording driver, the compression must be @b{Motion
6712 JPEG A}.  For the @b{IEC 61883} driver, the compression must be
6713 @b{DV}.  This gets the driver to generate output in a colormodel that
6714 the timeline can use.
6716 Some cards provide color and channel settings.  Live video takes the
6717 color settings from the values set in the @b{Video In} window.  Go to
6718 @b{File->Record} to bring up the recording interface and the Video In
6719 window.  Values set in the @b{Video in} window are used by @b{Live
6720 Video}.  Any channels the capture card supports need to be configured
6721 in the @b{Video in} interface since the same channels are used by the
6722 @b{Live Video} effect.
6724 With the video recording configured, highlight a horizontal region of a
6725 video track or define in and out points.  Then drop the Live Video
6726 effect into it.  Drop other effects after Live Video to process the
6727 live video in realtime.  For best results, you should use OpenGL and a
6728 video card which supports GL shading language.  Go to
6729 @b{Settings->Preferences->Playback->Video Out} to enable the OpenGL
6730 driver.
6732 Only one Live Video effect can exist at any time on the timeline.  It
6733 can't be shared by more than one track.
6742 @node LOOP
6743 @section LOOP
6745 Sections of audio or video can be looped by dropping a @b{loop} effect
6746 on them.  Contrary to the the @b{settings->loop playback} option, the
6747 loop effects can be rendered where the @b{settings->loop playback}
6748 option can not be.  The loop effects are also convenient for short
6749 regions.
6751 The loop effects have one option: the number of @b{frames} or
6752 @b{samples} to loop.  This specifies the length of the region to loop
6753 starting from either the beginning of the effect or the latest
6754 keyframe.  The region is replicated for the entire effect.
6756 Every time a keyframe is set in a loop effect, the keyframe becomes the
6757 beginning of the region to loop.  Setting several keyframes in
6758 succession causes several regions to loop.  Setting a single keyframe
6759 causes the region after the keyframe to be looped throughout the
6760 effect, no matter where the keyframe is.  The end of an effect can be
6761 looped from the beginning by setting the keyframe near the end.
6772 @node MOTION
6773 @section MOTION
6775 The motion tracker is almost a complete application in itself.  The
6776 motion tracker tracks two types of motion: translation and rotation. 
6777 It can track both simultaneously or one only.  It can do 1/4 pixel
6778 tracking or single pixel tracking.  It can stabilize motion or cause
6779 one track to follow the motion of another track.
6781 Although the motion tracker is applied as a realtime effect, it usually
6782 must be rendered to see useful results.  The effect takes a long time
6783 to precisely detect motion.
6785 The motion tracker works by using one region of the frame as the region
6786 to track.  It compares this region between 2 frames to calculate the
6787 motion.  This region can be defined anywhere on the screen.  Once the
6788 motion between 2 frames has been calculated, a number of things can be
6789 done with that motion vector.  It can be scaled by a user value and
6790 clamped to a maximum range.  It can be thrown away or accumulated with
6791 all the motion vectors leading up to the current position.
6793 To save time the motion result can be saved for later reuse, recalled
6794 from a previous calculation, or discarded.
6796 The motion tracker has a notion of 2 tracks, the master layer and the
6797 target layer.  The master layer is where the comparison between 2
6798 frames takes place.  The target layer is where motion is applied either
6799 to track or compensate for the motion in the master layer.
6801 The intricacies of motion tracking are enough to sustain entire
6802 companies and build careers around.  The motion tracker in Cinelerra
6803 isn't as sophisticated as some world class motion trackers but it's
6804 enough to sweeten some camcorder footage.
6806 Here is a brief description of the motion tracking parameters:
6808 @itemize
6809 @item
6810 @b{Track translation:} Enables translation operations.  
6811 The motion tracker tracks X and Y motion in the master layer and 
6812 adjusts X and Y motion in the target layer.
6814 @item
6816 @b{Translation block size:} For the translation operations, a block is
6817 compared to a number of neighboring blocks to find the one with the
6818 least difference.  The size of the block to search for is given by this
6819 parameter.
6821 @item
6823 @b{Translation search radius:} The size of the area to scan for the
6824 translation block.
6826 @item
6828 @b{Translation search steps:} Ideally the search operation would
6829 compare the  translation block with every other pixel in the
6830 translation search radius.  To  speed this operation up, a subset of
6831 the total positions is searched.   Then the search area is narrowed and
6832 rescanned by the same number of search steps until the motion is known
6833 to 1/4 pixel accuracy.
6835 @item
6837 @b{Block X, Y:} These coordinates determine the center of the
6838 translation  block based on percentages of the width and height of the
6839 image.  The center of the block should be part of the image which is
6840 visible at all times.
6842 @item 
6844 @b{Maximum absolute offset:} The amount of motion detected by the
6845 motion  tracker is unlimited if this is 100.  If it's under 100 the
6846 amount of motion is limited by that percentage of the image size.
6848 @item
6850 @b{Settling speed:} The motion detected between every frame can be
6851 accumulated to form an absolute motion vector.  If the settling speed
6852 is 100 the absolute vector is added to the next frame.  If the settling
6853 speed is less than 100 the absolute vector is downscaled by the
6854 settling amount before being added to the next frame.
6856 @item
6858 @b{Track rotation:} Enables rotation operations.  The motion tracker
6859 tracks rotation in the master layer and adjusts rotation in the target
6860 layer.
6862 @item
6864 @b{Rotation block size:} For rotation operations a single block is
6865 compared to equally sized blocks, each rotated by a different amount. 
6866 This is the size of the rotation block.
6868 @item
6870 @b{Rotation search radius:} This is the maximum angle of rotation from
6871 the starting frame the rotation scanner can detect.  The rotation scan
6872 is from this angle counterclockwise to this angle clockwise.  Thus the
6873 rotation search radius is half the total range scanned.
6875 @item
6877 @b{Rotation search steps:} Ideally every possible angle would be tested
6878 to get the rotation.  To speed up the rotation search, the rotation
6879 search radius is divided into a finite number of angles and only those
6880 angles compared to the starting frame.  Then the search radius is
6881 narrowed and an equal number of angles is compared in the smaller
6882 radius until the highest possible accuracy is achieved.
6884 Normally you need one search step for every degree scanned.  Since the
6885 rotation scanner scans the rotation search radius in two directions,
6886 you need two steps for every degree in the search radius to search the
6887 complete range.
6889 @item
6891 @b{Draw vectors:} When translation is enabled, 2 boxes are drawn on the
6892 frame.  One box represents the translation block.  Another box outside
6893 the translation block represents the extent of the translation search
6894 radius.  In the center of these boxes is an arrow showing the
6895 translation between the 2 master frames.
6897 When rotation is enabled a single box the size of the rotation block is
6898 drawn rotated by the amount of rotation detected.
6900 @item
6902 @b{Track single frame:} When this option is used the motion between a
6903 single starting frame and the frame currently under the insertion point
6904 is calculated.  The starting frame is specified in the @b{Frame number}
6905 blank.  The motion calculated this way is taken as the absolute motion
6906 vector.  The absolute motion vector for each frame replaces the
6907 absolute motion vector for the previous frame.  Settling speed has no
6908 effect on it since it doesn't contain any previous motion vectors. 
6909 Playback can start anywhere on the timeline since there is no
6910 dependance on previous results.
6912 @item
6914 @b{Track previous frame:} Causes only the motion between the previous
6915 frame and the current frame to be calculated.  This is added to an
6916 absolute motion vector to get the new motion from the start of the
6917 sequence to the current position.  After every frame processed this
6918 way, the block position is shifted to always cover the same region of
6919 the image.  Playback must be started from the start of the motion
6920 effect in order to accumulate all the necessary motion vectors.
6922 @item
6924 @b{Previous frame same block:} This is useful for stabilizing jerky
6925 camcorder footage.  In this mode the motion between the previous frame
6926 and the current frame is calculated.  Instead of adjusting the block
6927 position to reflect the new location of the image, like Track Previous
6928 Frame does, the block position is unchanged between each frame.  Thus a
6929 new region is compared for each frame.
6931 @item
6933 @b{Master layer:} This determines the track which supplies the starting
6934 frame and ending frame for the motion calculation.  If it's @b{Bottom}
6935 the bottom track of all the tracks sharing this effect is the master
6936 layer.  The top track of all the tracks is the target layer.
6938 @item
6940 @b{Calculation:} This determines whether to calculate the motion at all
6941 and whether to save it to disk.  If it's @b{Don't Calculate} the motion
6942 calculation is skipped.  If it's @b{Recalculate} the motion calculation
6943 is performed every time each frame is rendered.  If it's @b{Save} the
6944 motion calculation is always performed but a copy is also saved.  If
6945 it's @b{Load}, the motion calculation is loaded from a previous save
6946 calculation.  If there is no previous save calculation on disk, a new
6947 motion calculation is performed.
6949 @item
6951 @b{Action:} Once the motion vector is known this determines whether to
6952 move the target layer opposing the motion vector or following the
6953 motion vector.  If it's @b{Do Nothing} the target layer is untouched. 
6954 If it's @b{Track...} the target layer is moved by the same amount as
6955 the master layer.  This is useful for matching titles to objects in the
6956 frame.  If it's @b{Stabilize...} the target layer is moved opposite to
6957 the motion vector.  This is useful for stabilizing an object in the
6958 frame.  The motion operations can be accurate to single pixels or
6959 subpixels by changing the action setting.
6965 @end itemize
6969 @menu
6970 * SECRETS OF MOTION TRACKING::
6971 * 2 PASS MOTION TRACKING::
6972 * USING BLUR TO IMPROVE MOTION TRACKING::
6973 * USING HISTOGRAM TO IMPROVE MOTION TRACKING::
6974 @end menu
6977 @node SECRETS OF MOTION TRACKING
6978 @subsection SECRETS OF MOTION TRACKING
6980 Since it is a very slow effect, there is a method to applying the
6981 motion tracker to get the most out of it.  First disable playback for
6982 the track to do motion tracking on.  Then drop the effect on a region
6983 of video with some motion to track.  Then rewind the insertion point to
6984 the start of the region.  Set @b{Action} -> @b{Do Nothing}.  Set
6985 @b{Calculation} -> @b{Don't calculate}.  Enable @b{Draw vectors}. Then
6986 enable playback of the track to see the motion tracking areas.
6988 Enable which of @b{translation motion} or @b{rotation motion} vectors
6989 you want to track.  By watching the compositor window and adjusting the
6990 @b{Block x,y} settings, center the block on the part of the image you
6991 want to track.  Then set search radius, block size, and block
6992 coordinates for translation and rotation.
6994 Once this is configured, set the calculation to @b{Save coords} and do
6995 test runs through the sequence to see if the motion tracker works and
6996 to save the motion vectors.  Once this is done, disable playback for
6997 the track, disable @b{Draw vectors}, set the motion action to perform
6998 on the target layer and change the calculation to @b{Load coords}. 
6999 Finally enable playback for the track.
7001 When using a single starting frame to calculate the motion of a
7002 sequence, the starting frame should be a single frame with the least
7003 motion to any of the other frames.  This is rarely frame 0.  Usually
7004 it's a frame near the middle of the sequence.  This way the search
7005 radius need only reach halfway to the full extent of the motion in the
7006 sequence.
7008 If the motion tracker is used on a render farm, @b{Save coords} and
7009 @b{previous frame} mode won't work.  The results of the save coords
7010 operation are saved to the hard drives on the render nodes, not the
7011 master node.  Future rendering operations on these nodes will process
7012 different frames and read the wrong coordinates from the node
7013 filesystems.  The fact that render nodes only visualize a portion of
7014 the timeline also prevents @b{previous frame} from working since it
7015 depends on calculating an absolute motion vector starting on frame 0.
7017 @node 2 PASS MOTION TRACKING
7018 @subsection 2 PASS MOTION TRACKING
7020 The method described above is 2 pass motion tracking.  One pass is used
7021 just to calculate the motion vectors.  A second pass is used to apply
7022 the motion vectors to the footage.  This is faster than a single pass
7023 because errors in the motion vector calculation can be discovered
7024 quickly.
7026 This also allows the motion tracking to use a less demanding colormodel
7027 like RGB888 in the scanning step and a more demanding colormodel like
7028 RGB Float in the action step.  The scanning step takes much longer than
7029 action.
7031 This suffers the disadvantage of not being practical for extremely long
7032 sequences where some error is acceptable and the picture quality is
7033 lousy to begin with, like stabilizing camcorder footage.
7035 The slower method is to calculate the motion vectors and apply them
7036 simultaneously.  This method can use one track as the motion vector
7037 calculation track and another track as the target track for motion
7038 vector actions.  This is useful for long sequences where some error is
7039 acceptable.
7042 @node USING BLUR TO IMPROVE MOTION TRACKING
7043 @subsection USING BLUR TO IMPROVE MOTION TRACKING
7045 With extremely noisy or interlaced footage, applying a blur effect
7046 before the motion tracking can improve accuracy.  Either save the
7047 motion vectors in a @b{tracking pass} and disable the blur for the
7048 @b{action pass} or apply the blur just to the @b{master layer}.
7051 @node USING HISTOGRAM TO IMPROVE MOTION TRACKING
7052 @subsection USING HISTOGRAM TO IMPROVE MOTION TRACKING
7054 A histogram is almost always applied before motion tracking to clamp
7055 out noise in the darker pixels.  Either save the motion vectors in a
7056 @b{tracking pass} and disable the histogram for the @b{action pass} or
7057 apply the histogram just to the @b{master layer}.
7067 @node REFRAMERT
7068 @section REFRAMERT
7071 ReframeRT changes number of frames in a sequence of video directly from
7072 the timeline.  It has 2 modes, selected by the 2 toggles in the GUI.
7074 @b{Stretch} mode multiplies the current frame number of its output by
7075 the scale factor to arrive at the frame to read from its input.  If its
7076 current output frame is #55 and the scale factor is 2, frame #110 is
7077 read from its input.  The stretch mode has the effect of changing the
7078 length of output video by the inverse of the scale factor.  If the
7079 scale factor is greater than 1, the output will end before the end of
7080 the sequence on the timeline.  If it's less than 1, the output will end
7081 after the end of the sequence on the timeline.  The ReframeRT effect
7082 must be lengthened to the necessary length to accomodate the scale
7083 factor.  Change the length of the effect by clicking on the endpoint of
7084 the effect and dragging.
7086 Although stretch mode changes the number of the frame read from its
7087 input, it doesn't change the frame rate of the input.  Effects before
7088 ReframeRT assume the same frame rate as ReframeRT.
7090 @b{Downsample} mode doesn't change the length of the output sequence. 
7091 It multiplies the frame rate of the output by the scale factor to
7092 arrive at a frame rate rate to read the input.  This has the effect of
7093 replicating the input frames so that they only change at the scaled
7094 frame rate when sent to the output.  It doesn't change the length of
7095 the sequence.  If the scale factor is 0.5 and the output frame rate is
7096 30 fps, only 15 frames will be shown per second and the input will be
7097 read at 15 fps.  Downsample is only useful for scalefactors below 1,
7098 hence the name downsample.
7100 Downsample mode changes the frame rate of the input as well as the
7101 number of the frame to read, so effects before ReframeRT see the frame
7102 rate * the scale factor as their frame rate.  If the scale factor is 2
7103 and the output frame rate is 30, the input frame rate will be 60 and
7104 the input frame number will by doubled.  This won't normally do
7105 anything but some input effects may behave differently at the higher
7106 frame rate.
7111 @node REFRAME
7112 @section REFRAME
7114 This does exactly the same thing as @b{ReframeRT} in @b{Stretch} mode. 
7115 It multiplies the output frame number by the scale factor to arrive at
7116 the input frame number and changes the length of the sequence.  Unlike
7117 ReframeRT, this must run from the @b{Video} menu and render its output.
7119 Be aware @b{Reframe} doesn't write the scaled frame rate as the frame
7120 rate of the rendered file.  It produces a file of scaled length and
7121 equal frame rate as the project.  The new length is 1/scale factor as
7122 big as the original sequence.
7131 @node RESAMPLE
7132 @section RESAMPLE
7134 This multiplies the number of each output sample by a scale factor to
7135 arrive at the number of the input sample.  The output file's sample
7136 rate is set to the project sample rate but its length is changed to
7137 reflect the scaled number of samples.  It also filters the resampled
7138 audio to remove aliasing.
7140 If the scale factor is 2, every 2 input samples will be reduced to 1
7141 output sample and the output file will have half as many samples as the
7142 input sequence.  If it's 0.5, every 0.5 input samples will be stretched
7143 to 1 output sample and the output file will have twice as many samples
7144 as the input sequence.
7155 @node REVERSE VIDEO/AUDIO
7156 @section REVERSE VIDEO/AUDIO
7158 Media can be reversed on the timeline in realtime.  This isn't to be
7159 confused with using the reverse playback on the transport.  The reverse
7160 effects reverse the region covered by the effect regardless of the
7161 transport direction.  Apply @b{reverse audio} to an audio track and
7162 play it backwards.  The sound plays forward.
7164 The region to be reversed is first determined by what part of the track
7165 the effect is under and second by the locations of keyframes in the
7166 effect.  The reverse effects have an @b{enabled} option which allows
7167 you to set keyframes.  This allows may possibilities.
7169 Every @b{enabled} keyframe is treated as the start of a new reversed
7170 region and the end of a previous reversed region.  Several @b{enabled}
7171 keyframes in succession yield several regions reversed independant of
7172 each other.  An @b{enabled} keyframe followed by a @b{disabled}
7173 keyframe yields one reversed region followed by a forward region.
7175 Finally, be aware when reversing audio that the waveform on the
7176 timeline doesn't reflect the actual reversed output.
7184 @node THRESHOLD
7185 @section THRESHOLD
7187 Threshold converts the image to pure luminance.  Then luminance values
7188 below and above the threshold range are converted to black and
7189 luminance values inside the threshold range are converted to white. 
7190 The threshold window shows a histogram of luminance values for the
7191 current frame.  Click dragging inside the histogram creates a range to
7192 convert to white.  Shift-clicking extends one border of this range. 
7193 Values for the threshold range can also be specified in the text boxes.
7195 This effect is basically a primitive luminance key.  A second track
7196 above the track with the threshold effect can be multiplied, resulting
7197 in only the parts of the second track within the threshold being
7198 displayed.
7206 @node TIME AVERAGE
7207 @section TIME AVERAGE
7209 Time average is one effect which has many uses besides creating nifty
7210 trail patterns of moving objects.  It's main use is reducing noise in
7211 still images.  Merely point a video camera at a stationary subject for
7212 30 frames, capture the frames, and average them using TIME AVERAGE and
7213 you'll have a super high quality print.  In floating point colormodels, time
7214 average can increase the dynamic range of lousy cameras.
7216 Inside the time average effect is an accumulation buffer and a
7217 divisor.  A number of frames are accumulated in the accumulation buffer
7218 and divided by the divisor to get the average.
7220 Because the time average can consume enourmous amounts of memory, it is
7221 best applied by first disabling playback for the track, dropping the
7222 time average in it, configuring time average for the desired number of
7223 frames, and re-enabling playback for the track.
7225 @b{Frames to average:} This determines the number of frames to be
7226 accumulated in the accumulation buffer.  For extremely large
7227 integrations it's easier to edit the EDL in a text editor and put in
7228 the number of frames.
7230 @b{Accumulate:} This outputs the accumulation buffer without dividing it.
7232 @b{Average:} This causes the accumulation buffer to be divided before
7233 being output.  This results in the average of all the frames.
7235 @b{Inclusive Or:} This causes the accumulation buffer to be replaced by
7236 any pixels which aren't transparent.  In combination with motion
7237 tracking it allows entire sequences to be combined to form panoramas.
7239 @b{Reprocess frame again:} If an effect before the time average is
7240 adjusted the time average normally doesn't reread the accumulation
7241 buffer to get the change.  This forces it to reread the accumulation
7242 buffer when other effects change.
7244 @b{Disable subtraction:} In order to represent the accumulation of only
7245 the specified number of frames, the time average retains all the
7246 previous frames in memory and subtracts them out as it plays forward. 
7247 It would run out of memory if it had to accumulate thousands of
7248 frames.  By disabling subtraction the previous frames are not stored in
7249 memory and only the average function is affected by the frame count.
7258 @node TITLER
7259 @section TITLER
7261 While it is possible to add text to movies by importing still images
7262 from The Gimp and compositing them, the Titler allows you to add text
7263 from within Cinelerra.  
7265 The titler has standard options for @b{font, size, and style}.  The
7266 best font is a generic, normal font like Arial in a large size.
7268 The titler also has options you'll only find in moving pictures.  The
7269 @b{Justify} operation justifies the text relative to the entire frame. 
7270 Once justified, the @b{X and Y} offset is applied.  This allows text to
7271 be justified while at the same time letting you push it within the
7272 title safe region.
7274 The @b{motion type} scrolls the text in any of the four directions. 
7275 When using this, the text may dissappear.  Move the insertion point
7276 along the timeline until the text is far enough along the animation to
7277 reappear.  The text scrolls on and scrolls off.
7279 Setting @b{loop} causes the text to scroll completely off and repeat. 
7280 Without @b{loop} the text scrolls off and never reappears.
7282 The speed of the animation is determined by @b{speed}  Set it higher to
7283 speed up the animation.
7285 @b{Drop shadow} draws a black copy of the text to the bottom right of
7286 the original text.  Useful when drawing text over changing video to
7287 keep the border always visible.
7289 In addition to the scrolling, @b{Fade in/Fade out} are a second type of
7290 animation.  If the fade seconds are 0, no fading is done.
7292 @b{Color} picks the color to draw the text in.  Usually white is the
7293 only practical color.
7295 @b{Stamp timecode} replaces the text with the current position on the
7296 timeline in seconds and frames.
7298 @menu
7299 * ADDING FONTS TO THE TITLER:: How to add fonts to the titler
7300 * THE TITLE-SAFE REGION::      How to keep text visible on output
7301 @end menu
7303 @node ADDING FONTS TO THE TITLER
7304 @subsection ADDING FONTS TO THE TITLER
7306 The X Window system originally didn't have a suitable font renderer for
7307 video.  It also is restricted to the current bit depth.  It doesn't
7308 have a convenient way to know which fonts work with the suitable font
7309 renderer in the desired bit depth.  The easiest way we've found to
7310 support fonts in the titler is to have a directory for them at
7311 @b{/usr/lib/cinelerra/fonts}.
7313 The titler supports mainly @b{TTF}, true type fonts.  It supports
7314 others but TTF are the most reliable.  To add true type fonts, copy the
7315 @b{.TTF} files to the @b{/usr/lib/cinelerra/fonts} directory.  In that
7316 directory run @b{ttmkfdir && mv fonts.scale fonts.dir} and restart
7317 Cinelerra.  The new fonts should appear.  The usage of ttmkfdir changes
7318 frequently so this technique might not work.
7321 @node THE TITLE-SAFE REGION
7322 @subsection THE TITLE-SAFE REGION
7324 If the video is displayed on a consumer TV, the outer border is going
7325 to be cropped by 5% on each side.  Moreover, text which is too close to
7326 the edge looks sloppy.  Make sure when adding titles to have the
7327 @b{title-safe} @image{titlesafe} tool active in the @b{compositor} window.
7328 The text shouldn't cross the inner rectangle.
7338 @node VIDEO SCOPE
7339 @section VIDEO SCOPE
7341 The video scope plots two views of the image.  One view plots the
7342 intensity of each pixel against horizontal position.  They call this
7343 the WAVEFORM.  Another view translates hue to angle and saturation to
7344 radius for each pixel.  They call this the VECTORSCOPE.
7346 The vectorscope is actually very useful for determining if an image is
7347 saturated.  When adjusting saturation, it's important to watch the
7348 vectorscope to make sure pixels don't extend past the 100 radius.
7350 The waveform allows you to make sure image data extends from complete
7351 black to complete white while adjusting the brightness/contrast.
7353 Some thought is being given to having a video scope for recording. 
7354 Unfortunately, this would require a lot of variations of the video
7355 scope for all the different video drivers.
7361 @node PLUGIN AUTHORING
7362 @chapter PLUGIN AUTHORING
7364 The plugin API in Cinelerra dates back to 1997, before the LADSPA and
7365 before VST became popular.  It's fundamentally the same as it was in
7366 1997, with minor modifications to handle keyframes and GUI feedback. 
7367 The GUI is not abstracted from the programmer.  This allows the
7368 programmer to use whatever toolkit they want and allows more
7369 flexibility in appearance but it costs more.
7371 There are several types of plugins, each with a common procedure of
7372 implementation and specific changes for that particular type.  The
7373 easiest way to implement a plugin is to take the simplest existing one
7374 out of the group and rename the symbols.  
7378 @menu
7379 * INTRODUCING THE PULL METHOD:: The current paradigm for plugin writing
7380 * COMMON PLUGIN FUNCTIONS:: What all effects have to do.
7381 * REALTIME PLUGINS:: What realtime effects have to do.
7382 * NONREALTIME PLUGINS:: What rendered effects have to do.
7383 * AUDIO PLUGINS:: What audio effects have to do.
7384 * VIDEO PLUGINS:: What video effects have to do.
7385 * TRANSITION PLUGINS:: What transitions have to do.
7386 * PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK:: How to use currently playing data to draw the GUI.
7387 * USING OPENGL:: How to use hardware to speed up operations.
7388 * PLUGIN QUERIES:: How plugins get information about the data to be processed.
7389 @end menu
7394 @node INTRODUCING THE PULL METHOD
7395 @section INTRODUCING THE PULL METHOD
7397 Originally plugins were designed with the push method.  The push method
7398 is intuitive and simple.  A source pushes data to a plugin, the plugin
7399 does math operations on it, and the plugin pushes it to a destination. 
7400 For 6 years this was the way all realtime plugins were driven
7401 internally but it didn't allow you to reduce the rate of playback in
7402 realtime.  While plugins can still be designed as if they're pushing
7403 data, this is not the way they're processed internally anymore.
7405 The latest evolution in Cinelerra's plugin design is the pull method. 
7406 The rendering pipeline starts at the final output and the final steps
7407 in the rendering pipeline are reading the data from disk.  Every step
7408 in the rendering chain involves requesting data from the previous
7409 step.  When the rendering pipleline eventually requests data from a
7410 plugin chain, each plugin requests data from the plugin before it.
7412 This is less intuitive than the push method but is much more powerful. 
7413 Realtime plugins written using the pull method can change the rate data
7414 is presented to the viewer and the direction of playback.  The pull
7415 method allows plugins to take in data at a higher rate than they send
7416 it out.
7418 To get the power of rate independance, the pull method requires plugins
7419 to know more about the data than they needed to under the push method. 
7420 Plugins need to know what rate the project is at, what rate their
7421 output is supposed to be at and what rate their input is supposed to be
7422 at.  These different data rates have to be correlated for a plugin to
7423 configure itself properly.
7425 Keyframes for a plugin are stored relative to the project frame rate. 
7426 Queries from a plugin for for the current playback position are given
7427 relative to the project frame rate.  If the plugin's output was
7428 requested to be at twice the project frame rate, the positions need to
7429 be converted to the project rate for keyframes to match up.  Two
7430 classes of data rates were created to handle this problem.
7432 Rate conversions are done in terms of the @b{project rate} and the
7433 @b{requested rate}.  The project rate is identical for all plugins.  It
7434 is determined by the @b{settings->format} window.  The requested rate
7435 is determined by the downstream plugin requesting data from the current
7436 plugin.  The requested rate is arbitrary.  Exactly how to use these
7437 rates is described below.
7441 @node COMMON PLUGIN FUNCTIONS
7442 @section COMMON PLUGIN FUNCTIONS
7444 All plugins inherit from a derivative of PluginClient.  This
7445 PluginClient derivative implements most of the required methods in
7446 PluginClient, but users must still define methods for PluginClient. 
7447 The most commonly used methods are predefined in macros to reduce the
7448 typing yet still allow flexibility.
7450 The files they include depend on the plugin type.  Audio plugins
7451 include @b{pluginaclient.h} and video plugins include
7452 @b{pluginvclient.h}.  They inherit @b{PluginAClient} and
7453 @b{PluginVClient} respectively.
7455 Cinelerra instantiates all plugins at least twice when they are used in
7456 a movie.  Once instance is the GUI.  The other instance is the signal
7457 processor.  User input, through a complicated sequence, is propogated
7458 from the GUI instance to the signal processor instance.  If the signal
7459 processor wants to alter the GUI, it propogates data back to the GUI
7460 instance.  There are utility functions for doing all this.
7462 All plugins define at least three objects:
7464 @itemize
7466 @item
7468 @b{Processing object} - Contains pointers to all the other objects and
7469 performs the signal processing.  This object contains a number of
7470 queries to identify itself and is the object you register to register
7471 the plugin.
7474 @item
7476 @b{User interface object} - This is defined according to the programmer's
7477 discretion.  It can either use Cinelerra's toolkit or another toolkit. 
7478 It shows data on the screen and collects parameters from the user.
7480 Using Cinelerra's toolkit, the only user interface object a developer
7481 needs to worry about is the Window.  The window has pointers to a
7482 number of widgets, a few initialization methods, and a back pointer to
7483 the plugin's processing object.  The documentation refers to the usage
7484 of Cinelerra's toolkit.
7486 Depending on the user interface toolkit, a user interface thread may be
7487 created to run the user interface asynchronous of everything else. 
7488 Synchronizing the user interface to changes in the plugin's
7489 configuration is the most complicated aspect of the plugin, so the user
7490 interface thread and object are heavily supported by macros if you use
7491 Cinelerra's toolkit.
7494 @item
7496 @b{Configuration object} - This stores the user parameters and always
7497 needs interpolation, copying, and comparison functions.  Macros for the
7498 plugin client automatically call configuration methods to interpolate
7499 keyframes.
7501 @end itemize
7503 @menu
7504 * THE PROCESSING OBJECT::
7505 * THE CONFIGURATION OBJECT::
7506 * THE USER INTERFACE OBJECT::
7507 @end menu
7511 @node THE PROCESSING OBJECT
7512 @subsection THE PROCESSING OBJECT
7514 Load up a simple plugin like gain to see what this object looks like.
7515 The processing object should inherit from the intended PluginClient
7516 derivative.  Its constructor should take a PluginServer argument.
7518 @example
7519 MyPlugin(PluginServer *server);
7520 @end example
7522 In the implementation, the plugin must contain a registration line with
7523 the name of the processing object like
7525 @example
7526 REGISTER_PLUGIN(MyPlugin)
7527 @end example
7530 The constructor should contain 
7532 @example
7533 PLUGIN_CONSTRUCTOR_MACRO
7534 @end example
7536 to initialize the most common variables.
7539 The processing object should have a destructor containing
7541 @example
7542 PLUGIN_DESTRUCTOR_MACRO
7543 @end example
7545 to delete the most common variables.
7547 Another function which is useful but not mandatory is
7549 @example
7550 int is_multichannel();
7551 @end example
7553 It should return 1 if one instance of the plugin handles multiple
7554 tracks simultaneously or 0 if one instance of the plugin only handles
7555 one track.  The default is 0 if it is omitted.
7557 Multichannel plugins in their processing function should refer to a
7558 function called @b{PluginClient::get_total_buffers()} to determine the
7559 number of channels.
7564 To simplify the implementation of realtime plugins, a macro for
7565 commonly used members has been created for the class header, taking the
7566 configuration object and user interface thread object as arguments. 
7567 The macro definitions apply mainly to realtime plugins and are not
7568 useful in nonrealtime plugins.  Fortunately, nonrealtime plugins are
7569 simpler.
7571 @example
7572 PLUGIN_CLASS_MEMBERS(config_name, thread_name)
7573 @end example
7575 The commonly used members in PLUGIN_CLASS_MEMBERS are described below.
7577 @itemize
7579 @item
7580 int load_configuration();
7582 Loads the configuration based on surrounding keyframes and current
7583 position.  The class definition for load_configuration should contain 
7585 @example
7586 LOAD_CONFIGURATION_MACRO(plugin_class, config_class)
7587 @end example
7589 to implement the default behavior for load_configuration.  This stores
7590 whatever the current configuration is inside the plugin's configuration
7591 object and returns 1 if the new configuration differs from the previous
7592 configuration.  The return value of load_configuration is used by
7593 another commonly used function, update_gui to determine if the GUI really needs to be updated.
7595 The plugin's configuration object is always called @b{config} inside
7596 PLUGIN_CLASS_MEMBERS.
7598 @item
7599 VFrame* new_picon();
7601 Creates a picon for display in the resource window.  Use
7603 @example
7604 #include "picon_png.h"
7605 NEW_PICON_MACRO(plugin_class)
7606 @end example
7608 to implement new_picon.  In addition, the user should create a
7609 @b{picon_png.h} header file from a PNG image using @b{pngtoh}. 
7610 @b{pngtoh} is compiled in the @b{guicast/ARCH} directory.
7612 The source PNG image should be called picon.png and can be any format
7613 supported by PNG.
7615 @item
7616 char* plugin_title();
7618 Returns a text string identifying the plugin in the resource window. 
7619 The string has to be unique.
7622 @item
7623 void update_gui(); 
7625 Should first load the configuration, test for a return of 1, and then
7626 redraw the GUI with the new parameters.  All the plugins using GuiCast
7627 have a format like
7629 @example
7630 void MyPlugin::update_gui()
7632         if(thread)
7633         @{
7634                 if(load_configuration())
7635                 @{
7636                         thread->window->lock_window();
7637 // update widgets here
7638                         thread->window->unlock_window();
7639                 @}
7640         @}
7642 @end example
7644 to handle concurrency and conditions of no GUI.
7646 @item
7647 int show_gui();
7649 Instantiate the GUI and switch the plugin to GUI mode.  This is implemented with
7651 @example
7652 SHOW_GUI_MACRO(plugin_class, thread_class)
7653 @end example
7655 @item
7656 int set_string();
7658 Changes the title of the GUI window to a certain string.  This is implemented with
7660 @example
7661 SET_STRING_MACRO(plugin_class)
7662 @end example
7665 @item
7666 void raise_window();
7668 Raises the GUI window to the top of the stack.  This is implemented with
7670 @example
7671 RAISE_WINDOW_MACRO(plugin_class)
7672 @end example
7676 @end itemize
7679 Iimportant functions the processing object must define are the
7680 functions which load and save configuration data from keyframes.  These
7681 functions are called by the macros so all you need to worry about is
7682 accessing the keyframe data.
7684 @example
7685 void save_data(KeyFrame *keyframe);
7686 void read_data(KeyFrame *keyframe);
7687 @end example
7689 The read data functions are only used in realtime plugins.  The read
7690 data functions translate the plugin configuration between the KeyFrame
7691 argument and the configuration object for the plugin.  The keyframes
7692 are stored on the timeline and can change for every project.
7694 Use an object called @b{FileXML} to do the translation and some
7695 specific commands to get the data out of the KeyFrame argument.  See
7696 any existing plugin to see the usage of KeyFrame and FileXML.
7699 @example
7700 int load_defaults();
7701 int save_defaults();
7702 @end example
7704 The load defaults functions are used in realtime and non-realtime
7705 plugins.  The load defaults functions translate the plugin
7706 configuration between a BC_Hash object and the plugin's
7707 configuration.  The BC_Hash object stores configurations in a discrete
7708 file on disk for each plugin but doesn't isolate different
7709 configurations for different projects.
7711 The function overriding @b{load_defaults} also needs to create the
7712 BC_Hash object.  See any existing plugin to see the usage of
7713 BC_Hash.
7715 Other standard members may be defined in the processing object,
7716 depending on the plugin type.
7721 @node THE CONFIGURATION OBJECT
7722 @subsection THE CONFIGURATION OBJECT
7724 The configuration object is critical for GUI updates, signal
7725 processing, and default settings in realtime plugins.  Be aware it is
7726 not used in nonrealtime plugins.  The configuration object inherits
7727 from nothing and has no dependancies.  It's merely a class containing
7728 three functions and variables specific to the plugin's parameters.
7730 Usually the configuration object starts with the name of the plugin
7731 followed by Config.
7733 @example
7734 class MyPluginConfig
7736 public:
7737         MyPluginConfig();
7738 @end example
7741 Following the name of the configuration class, we put in three
7742 required functions and the configuration variables.
7744 @example
7745         int equivalent(MyPluginConfig &that);
7746         void copy_from(MyPluginConfig &that);
7747         void interpolate(MyPluginConfig &prev, 
7748                 MyPluginConfig &next, 
7749                 int64_t prev_position, 
7750                 int64_t next_position, 
7751                 int64_t current_position);
7755         float parameter1;
7756         float parameter2;
7757         int parameter3;
7760 @end example
7763 Now you must define the three functions.  @b{Equivalent} is called by
7764 LOAD_CONFIGURATION_MACRO to determine if the local configuration
7765 parameters are identical to the configuration parameters in the
7766 arguement.  If equivalent returns 0, the LOAD_CONFIGURATION_MACRO 
7767 causes the GUI to redraw.  If equivalent returns 1, the
7768 LOAD_CONFIGURATION_MACRO doesn't redraw the GUI.
7770 Then there's @b{copy_from} which transfers the configuration values
7771 from the argument to the local variables.  This is once again used in
7772 LOAD_CONFIGURATION_MACRO to store configurations in temporaries.  Once 
7773 LOAD_CONFIGURATION_MACRO has replicated the configuration, it loads a
7774 second configuration.  Then it interpolates the two configurations to
7775 get the current configuration.  The interpolation function performs the
7776 interpolation and stores the result in the local variables.
7778 Normally the interpolate function calculates a previous and next
7779 fraction, using the arguments.
7781 @example
7782 void MyPluginConfig::interpolate(MyPluginConfig &prev, 
7783                 MyPluginConfig &next, 
7784                 int64_t prev_position, 
7785                 int64_t next_position, 
7786                 int64_t current_position)
7788         double next_scale = (double)(current_position - prev_position) / (next_position - prev_position);
7789         double prev_scale = (double)(next_position - current_position) / (next_position - prev_position);
7790 @end example
7792 Then the fractions are applied to the previous and next configuration
7793 variables to yield the current values.
7795 @example
7797         this->parameter1 = (float)(prev.parameter1 * prev_scale + next.parameter1 * next_scale);
7798         this->parameter2 = (float)(prev.parameter2 * prev_scale + next.parameter2 * next_scale);
7799         this->parameter3 = (int)(prev.parameter3 * prev_scale + next.parameter3 * next_scale);
7802 @end example
7804 Alternatively you can copy the values from the previous configuration
7805 argument if no interpolation is desired.
7807 This usage of the configuration object is the same in audio and video
7808 plugins.  In video playback, the interpolation function is called for
7809 every frame, yielding smooth interpolation.  In audio playback, the
7810 interpolation function is called only once for every console fragment
7811 and once every time the insertion point moves.  This is good enough for
7812 updating the GUI while selecting regions on the timeline but it may not
7813 be accurate enough for really smooth rendering of the effect.
7815 For really smooth rendering of audio, you can still use
7816 load_configuration when updating the GUI.  For process_buffer; however,
7817 ignore load_configuration and write your own interpolation routine
7818 which loads all the keyframes in a console fragment and interpolates
7819 every sample.  This would be really slow and hard to debug, yielding
7820 improvement which may not be audible.  Then of course, every country
7821 has its own wierdos.
7823 An easier way to get smoother interpolation is to reduce the console
7824 fragment to 1 sample.  This would have to be rendered and played back
7825 with the console fragment back over 2048 of course.  The Linux sound
7826 drivers can't play fragments of 1 sample.
7835 @node THE USER INTERFACE OBJECT
7836 @subsection THE USER INTERFACE OBJECT
7839 The user interface object at the very least consists of a pointer to a
7840 window and pointers to all the widgets in the window.  Using
7841 Cinelerra's toolkit, it consists of a @b{BCWindow} derivative and a
7842 @b{Thread} derivative.  The Thread derivative is declared in the plugin
7843 header using
7845 @example
7846 PLUGIN_THREAD_HEADER(plugin_class, thread_class, window_class)
7847 @end example
7849 Then it is defined using
7851 @example
7852 PLUGIN_THREAD_OBJECT(plugin_class, thread_class, window_class)
7853 @end example
7855 This, in combination with the SHOW_GUI macro does all the work in
7856 instantiating the Window.  This two class system is used in realtime
7857 plugins but not in nonrealtime plugins.  Nonrealtime plugins create and
7858 destroy their GUI in their @b{get_parameters} function and there's no
7859 need for a Thread.
7861 Now the window class must be declared in the plugin header.  It's
7862 easiest to implement the window by copying an existing plugin and
7863 renaming the symbols.  The following is an outline of what happens. 
7864 The plugin header must declare the window's constructor using the
7865 appropriate arguments.
7867 @example
7869 #include "guicast.h"
7871 class MyPluginWindow : public BC_Window
7873 public:
7874         MyPluginWindow(MyPluginMain *plugin, int x, int y);
7876 @end example
7878 This becomes a window on the screen, positioned at x and y.
7880 It needs two methods
7882 @example
7883         int create_objects();
7884         int close_event();
7885 @end example
7887 and a back pointer to the plugin
7889 @example
7890         MyPlugin *plugin;
7891 @end example
7894 The constructor's definition should contain extents and flags causing
7895 the window to be hidden when first created.  The create_objects member
7896 puts widgets in the window according to GuiCast's syntax.  A pointer to
7897 each widget which you want to synchronize to a configuration parameter
7898 is stored in the window class.  These are updated in the @b{update_gui}
7899 function you earlier defined for the plugin.  The widgets are usually
7900 derivatives of a GuiCast widget and they override functions in GuiCast
7901 to handle events.  Finally create_objects calls 
7903 @example
7904         show_window();
7905         flush();
7906 @end example
7908 to make the window appear all at once.
7910 The close_event member should be implemented using
7912 @example
7913 WINDOW_CLOSE_EVENT(window_class)
7914 @end example
7916 Every widget in the GUI needs to detect when its value changes.  In
7917 GuiCast the @b{handle_event} method is called whenever the value
7918 changes.  In @b{handle_event}, the widget then needs to call
7919 @b{plugin->send_configure_change()} to propogate the change to any
7920 copies of the plugin which are processing data.
7930 @node REALTIME PLUGINS
7931 @section REALTIME PLUGINS
7933 Realtime plugins should use PLUGIN_CLASS_MEMBERS to define the basic
7934 set of members in their headers.  All realtime plugins must define an
7936 @example
7937 int is_realtime()
7938 @end example
7940 member returning 1.  This causes a number of methods to be called
7941 during live playback and the plugin to be usable on the timeline.
7943 Realtime plugins must override a member called
7945 @example
7946 process_buffer 
7947 @end example
7949 This function takes different arguments depending on if the plugin
7950 handles video or audio.  See an existing plugin to find out which usage
7951 applies.
7953 The main features of the process_buffer function are a buffer to store
7954 the output, the starting position of the output, and the requested
7955 output rate.  For audio, there's also a size argument for the number of
7956 samples.
7958 The starting position of the output buffer is the lowest numbered
7959 sample on the timeline if playback is forward and the highest numbered
7960 sample on the timeline if playback is reverse.  The direction of
7961 playback is determined by one of the plugin queries described below.
7963 The position and size arguments are all relative to the frame rate and
7964 sample rate passed to process_buffer.  This is the requested data rate
7965 and may not be the same as the project data rate.
7967 The process_realtime function should start by calling
7968 @b{load_configuration}.  The LOAD_CONFIGURATION_MACRO returns 1 if the
7969 configuration changed.
7971 After determining the plugin's configuration, input media has to be
7972 loaded for processing.  Call
7974 @example
7975 read_frame(VFrame *buffer, 
7976                 int channel, 
7977                 int64_t start_position,
7978                 double frame_rate)
7979 @end example
7983 @example
7984 read_samples(double *buffer,
7985                 int channel,
7986                 int sample_rate,
7987                 int64_t start_position,
7988                 int64_t len)
7989 @end example
7991 to request input data from the object which comes before this plugin. 
7992 The read function needs a buffer to store the input data in.  This can
7993 either be a temporary you create in the plugin or the output buffer
7994 supplied to process_buffer if you don't need a temporary.
7996 It also needs a set of position arguments to determine when you want to
7997 read the data from.  The start position, rate, and len passed to a read
7998 function need not be the same as the values recieved by the
7999 process_buffer function.  This way plugins can read data at a different
8000 rate than they output data.
8002 The channel argument is only meaningful if this is a multichannel
8003 plugin.  They need to read data for each track in the
8004 get_total_buffers() value and process all the tracks.  Single channel
8005 plugins should pass 0 for channel.
8008 Additional members are implemented to maintain configuration in
8009 realtime plugins.  Some of these are also needed in nonrealtime
8010 plugins.
8012 @itemize
8013 @item
8014 void read_data(KeyFrame *keyframe);
8016 Loads data from a keyframe into the plugin's configuration.  Inside the
8017 keyframe is an XML string.  It's most easily parsed by creating a
8018 @b{FileXML} object.  See an existing plugin to see how the read_data
8019 function is implemented.
8021 Read data loads data out of the XML object and stores values in the
8022 plugin's configuration object.  Since configuration objects vary from
8023 plugin to plugin, these functions can't be automated.
8025 @item
8026 void save_data(KeyFrame *keyframe);
8028 Saves data from the plugin's configuration to a keyframe.  Inside the
8029 keyframe you'll put an XML string which is normally created by a
8030 FileXML object.  See an existing plugin to see how the save_data
8031 function is implemented.
8033 Save data saves data from the plugin's configuration object into the
8034 XML object.
8036 @item
8037 int load_defaults();
8039 Another way the plugin gets parameters is from a defaults file.  The
8040 load and save defaults routines use a BC_Hash object to parse the
8041 defaults file.  The defaults object is created in @b{load_defaults} and
8042 destroyed in the plugin's destructor.  See an existing plugin to see
8043 how the BC_Hash object is used.
8045 @item
8046 int save_defaults();
8048 Saves the configuration in the defaults object.
8050 @end itemize
8057 @node NONREALTIME PLUGINS
8058 @section NONREALTIME PLUGINS
8060 Some references for non-realtime plugins are @b{Normalize} for audio
8061 and @b{Reframe} for video.
8063 Like realtime plugins, @b{load_defaults} and @b{save_defaults} must be
8064 implemented.  In nonrealtime plugins, these are not just used for
8065 default parameters but to transfer values from the user interface to
8066 the signal processor.  There doesn't need to be a configuration class
8067 in nonrealtime plugins.
8069 Unlike realtime plugins, the LOAD_CONFIGURATION_MACRO can't be used in
8070 the plugin header.  Instead, the following methods must be defined.
8072 The nonrealtime plugin should contain a pointer to a defaults object.
8074 @example
8076 BC_Hash *defaults;
8078 @end example
8080 It should also have a pointer to a MainProgressBar.
8082 @example
8084 MainProgressBar *progress;
8085 @end example
8087 The progress pointer allows nonrealtime plugins to display their
8088 progress in Cinelerra's main window.
8090 The constructor for a nonrealtime plugin can't use
8091 PLUGIN_CONSTRUCTOR_MACRO but must call @b{load_defaults} directly.
8093 The destructor, likewise, must call @b{save_defaults} and @b{delete
8094 defaults} directly instead of PLUGIN_DESTRUCTOR_MACRO.
8096 @itemize
8098 @item
8099 VFrame* new_picon();
8101 char* plugin_title();
8103 The usage of these is the same as realtime plugins.
8105 @item
8106 int is_realtime();
8108 This function must return 0 to indicate a nonrealtime plugin.
8110 @item
8112 int get_parameters();
8114 Here, the user should create a GUI, wait for the user to hit an OK
8115 button or a cancel button, and store the parameters in plugin
8116 variables.  This routine must return 0 for success and 1 for failure. 
8117 This way the user can cancel the effect from the GUI.
8119 Unlike the realtime plugin, this GUI need not run asynchronously of the
8120 plugin.  It should block the get_parameters function until the user
8121 selects OK or Cancel.
8123 @item
8124 int load_defaults();
8126 This should create a defaults object and load parameters from the
8127 defaults object into plugin variables.
8129 @item
8130 int save_defaults();
8132 This should save plugin variables to the defaults object.
8135 @item
8136 int start_loop();
8138 If @b{get_parameters} returned 0 for success, this is called once to
8139 give the plugin a chance to initialize processing.  The plugin should
8140 instantiate the progress object with a line like
8142 @example
8144 progress = start_progress("MyPlugin progress...", 
8145         PluginClient::get_total_len());
8147 @end example
8149 The usage of @b{start_progress} depends on whether the plugin is
8150 multichannel or single channel.  If it's multichannel you always call
8151 start_progress.  If it's single channel, you first need to know whether
8152 the progress bar has already started in another instance of the plugin.
8154 If @b{PluginClient::interactive} is 1, you need to start the progress
8155 bar.  If it's 0, the progress bar has already been started.
8157 The PluginClient defines @b{get_total_len()} and @b{get_source_start()}
8158 to describe the timeline range to be processed.  The units are either
8159 samples or frames and in the project rate.
8161 @item
8162 int process_loop
8164 This is called repeatedly until the timeline range is processed.  It
8165 has either a samples or frames buffer for output and a reference to
8166 write_length to store the number of samples processed.  If this is an
8167 audio plugin, the user needs to call @b{get_buffer_size()} to know how
8168 many samples the output buffer can hold.
8170 The plugin must use @b{read_samples} or @b{read_frame} to read the
8171 input.  These functions are a bit different for a non realtime plugin
8172 than they are for a realtime plugin.
8174 They take a buffer and a position relative to the start of the
8175 timeline, in the timeline's rate.  Then you must process it and put the
8176 output in the buffer argument to process_loop.  write_length should
8177 contain the number of samples generated if it's audio.
8179 Finally, process_loop must test @b{PluginClient::interactive} and
8180 update the progress bar if it's 1.
8182 @example
8183 progress->update(total_written);
8184 @end example
8186 returns 1 or 0 if the progress bar was cancelled.  If it's 1,
8187 process_loop should return 1 to indicate a cancellation.  In addition
8188 to progress bar cancellation, @b{process_loop} should return 1 when the
8189 entire timeline range is processed.
8191 @item
8192 int stop_loop();
8194 This is called after process_loop processes its last buffer.  
8196 If PluginClient::is_interactive is 1, this should call
8197 @b{stop_progress} in the progress bar pointer and delete the pointer. 
8198 Then it should delete any objects it created for processing in
8199 @b{start_loop}.
8202 @end itemize
8206 @node AUDIO PLUGINS
8207 @section AUDIO PLUGINS
8209 The simplest audio plugin is Gain.  The processing object should
8210 include @b{pluginaclient.h} and inherit from @b{PluginAClient}.  Realtime audio plugins need to
8211 define 
8213 @example
8214 int process_buffer(int64_t size, 
8215                 double **buffer,
8216                 int64_t start_position,
8217                 int sample_rate);
8218 @end example
8220 if it's multichannel or 
8222 @example
8223 int process_buffer(int64_t size, 
8224                 double *buffer,
8225                 int64_t start_position,
8226                 int sample_rate);
8227 @end example
8229 if it's single channel.  These should return 0 on success and 1 on
8230 failure.  In the future, the return value may abort failed rendering.
8232 The processing function needs to request input samples with 
8234 @example
8235 int read_samples(double *buffer,
8236                 int channel,
8237                 int sample_rate,
8238                 int64_t start_position,
8239                 int64_t len);
8240 @end example
8242 It always returns 0.  The user may specify any desired sample rate and
8243 start position.
8245 Nonrealtime audio plugins need to define
8247 @example
8248 int process_loop(double *buffer, int64_t &write_length);
8249 @end example
8251 for single channel or
8253 @example
8254 int process_loop(double **buffers, int64_t &write_length);
8255 @end example
8257 for multi channel.  Non realtime plugins use a different set of
8258 read_samples functions to request input data.  These are fixed to the
8259 project sample rate.
8263 @node VIDEO PLUGINS
8264 @section VIDEO PLUGINS
8269 The simplest video plugin is Flip.  The processing object should
8270 include @b{pluginvclient.h} and inherit from @b{PluginVClient}. 
8271 Realtime video plugins need to define 
8273 @example
8274 int process_buffer(VFrame **frame,
8275         int64_t start_position,
8276         double frame_rate);
8277 @end example
8279 if it's multichannel or 
8281 @example
8282 int process_buffer(VFrame *frame,
8283         int64_t start_position,
8284         double frame_rate);
8285 @end example
8287 if it's single channel.  
8289 The nonrealtime video plugins need to define
8291 @example
8292 int process_loop(VFrame *buffer);
8293 @end example
8295 for single channel or
8297 @example
8298 int process_loop(VFrame **buffers);
8299 @end example
8301 for multi channel.  The amount of frames generated in a single
8302 process_loop is always assumed to be 1, hence the lack of a
8303 write_length argument.  Returning 0 causes the rendering to continue. 
8304 Returning 1 causes the rendering to abort.
8306 A set of read_frame functions exist for requesting input frames in
8307 non-realtime video plugins.  These are fixed to the project frame rate.
8310 @node TRANSITION PLUGINS
8311 @section TRANSITION PLUGINS
8316 The simplest video transition is @b{wipe} and the simplest audio
8317 transition is @b{crossfade}.  These use a subset of the default class
8318 members of realtime plugins, but so far no analogue to
8319 PLUGIN_CLASS_MEMBERS has been done for transitions.
8321 The processing object for audio transitions still inherits from
8322 PluginAClient and for video transitions it still inherits from
8323 PluginVClient.
8325 Transitions may or may not have a GUI.  If they have a GUI, they must
8326 also manage a thread like realtime plugins.  Do this with the same
8327 PLUGIN_THREAD_OBJECT and PLUGIN_THREAD_HEADER macros as realtime
8328 plugins.  Since there is only one keyframe in a transition, you don't
8329 need to worry about updating the GUI from the processing object like
8330 you do in a realtime plugin.
8332 If the transition has a GUI, you can use PLUGIN_CONSTRUCTOR_MACRO and 
8333 PLUGIN_DESTRUCTOR_MACRO to initialize the processing object.  You'll
8334 also need a BC_Hash object and a Thread object for these macros.
8336 Since the GUI is optional, overwrite a function called @b{uses_gui()}
8337 to signifiy whether or not the transition has a GUI.  Return 1 if it
8338 does and 0 if it doesn't.
8340 Transitions need a @b{load_defaults} and @b{save_defaults} function so
8341 the first time they're dropped on the timeline they'll have useful
8342 settings.
8344 A @b{read_data} and @b{save_data} function takes over after insertion
8345 to access data specific to each instance of the transition.
8347 The most important difference between transitions and realtime plugins
8348 is the addition of an @b{is_transition} method to the processing
8349 object.  @b{is_transition} should return 1 to signify the plugin is a
8350 transition.
8352 Transitions process data in a @b{process_realtime} function.
8354 @example
8355 int process_realtime(VFrame *input, 
8356                 VFrame *output);
8357 @end example
8359 @example
8360 int process_realtime(int64_t size, 
8361                 double *input_ptr, 
8362                 double *output_ptr);
8363 @end example
8365 The input argument to process_realtime is the data for the next edit. 
8366 The output argument to process_realtime is the data for the previous
8367 edit.
8369 Routines exist for determining where you are relative to the
8370 transition's start and end.
8372 @itemize
8374 @item @b{PluginClient::get_source_position()} - returns the current
8375 position since the start of the transition of the lowest sample in the
8376 buffers.
8378 @item @b{PluginClient::get_total_len()} - returns the integer length of
8379 the transition.  The units are either samples or frames, in the data
8380 rate requested by the first plugin.
8382 @end itemize
8384 Users should divide the source position by total length to get the
8385 fraction of the transition the current @b{process_realtime} function is
8388 Transitions run in the data rate requested by the first plugin in the
8389 track.  This may be different than the project data rate.  Since
8390 process_realtime lacks a rate argument, use @b{get_framerate()} or
8391 @b{get_samplerate} to get the requested rate.
8397 @node PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK
8398 @section PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK
8400 Effects like @b{Histogram} and @b{VideoScope} need to update the GUI
8401 during playback to display information about the signal.  This is
8402 achieved with the @b{send_render_gui} and @b{render_gui} methods. 
8403 Normally in process_buffer, when the processing object wants to update
8404 the GUI it should call @b{send_render_gui}.  This should only be called
8405 in process_buffer.  Send_render_gui goes through a search and
8406 eventually calls @b{render_gui} in the GUI instance of the plugin.
8408 Render_gui should have a sequence like
8410 @example
8411 void MyPlugin::render_gui(void *data)
8413         if(thread)
8414         @{
8415                 thread->window->lock_window();
8417 // update GUI here
8419                 thread->window->unlock_window();
8420         @}
8423 @end example
8426 Send_render_gui and render_gui use one argument, a void pointer to
8427 transfer information from the processing object to the GUI.  The user
8428 should typecast this pointer into something useful.
8440 @node PLUGIN QUERIES
8441 @section PLUGIN QUERIES
8444 There are several useful queries in PluginClient which can be accessed
8445 from the processing object.  Some of them have different meaning in
8446 realtime and non-realtime mode.  They all give information about the
8447 operating system or the project which can be used to improve the
8448 quality of the processing.
8450 @menu
8451 * SYSTEM QUERIES:: Utilities for determining the system resources.
8452 * TIMING QUERIES:: Utilities for performing time-dependant processing.
8453 @end menu
8459 @node SYSTEM QUERIES
8460 @subsection SYSTEM QUERIES
8463 @itemize
8465 @item 
8467 @b{get_interpolation_type()} returns the type of interpolation the user
8468 wants for all scaling operations.  This is a macro from
8469 overlayframe.inc.  It can be applied to any call to the
8470 @b{OverlayFrame} object.
8472 @item
8474 @b{get_project_smp()} Gives the number of CPU's on the system minus 1. 
8475 If it's a uniprocessor it's 0.  If it's a dual processor, it's 1.  This
8476 number should be used to gain parallelism.
8478 @item
8480 @b{get_total_buffers()} Gives the number of tracks a multichannel
8481 plugin needs to process.
8484 @end itemize
8491 @node TIMING QUERIES
8492 @subsection TIMING QUERIES
8495 There are two rates for media a realtime plugin has to be aware of: the
8496 project rate and the requested rate.  Functions are provided for
8497 getting the project and requested rate.  In addition, doing time
8498 dependant effects requires using several functions which tell where you
8499 are in the effect.
8501 @itemize
8502 @item
8504 @b{get_project_framerate()} Gives the frames per second of the video as
8505 defined by the project settings.
8508 @item
8510 @b{get_project_samplerate()} Gives the samples per second of the audio as
8511 defined by the project settings.
8513 @item
8515 @b{get_framerate()} Gives the frames per second requested by the plugin
8516 after this one.  This is the requested frame rate and is the same as
8517 the frame_rate argument to process_buffer.
8519 @item
8521 @b{get_samplerate()} Gives the samples per second requested by the plugin
8522 after this one.  This is the requested sample rate and is the same as
8523 the sample_rate argument to process_buffer.
8525 @item
8527 @b{get_total_len()} Gives the number of samples or frames in the
8528 range covered by the effect, relative to the requested data rate.
8530 @item
8532 @b{get_source_start()} For realtime plugins it gives the lowest sample
8533 or frame in the effect range in the requested data rate.  For
8534 nonrealtime plugins it's the start of the range of the timeline to
8535 process.
8537 @item
8539 @b{get_source_position()} For realtime plugins it's the lowest numbered
8540 sample in the requested region to process if playing forward and the
8541 highest numbered sample in the region if playing backward.  For video
8542 it's the start of the frame if playing forward and the end of the frame
8543 if playing in reverse.  The position is relative to the start of the
8544 EDL and in the requested data rate.
8546 For transitions this is always the lowest numbered sample of the region
8547 to process relative to the start of the transition.
8549 @item
8551 @b{get_direction()} Gives the direction of the current playback
8552 operation.  This is a macro defined in transportque.inc.  This is
8553 useful for calling read functions since the read functions position
8554 themselves at the start or end of the region to read, depending on the
8555 playback operation.
8557 @item
8559 @b{local_to_edl()}
8561 @item
8563 @b{edl_to_local()}
8565 These convert between the requested data rate and the project data
8566 rate.  They are used to convert keyframe positions into numbers which
8567 can be interpolated at the requested data rate.  The conversion is
8568 automatically based on frame rate or sample rate depending on the type
8569 of plugin.
8571 @item
8572 @b{get_prev_keyframe(int64_t position, int is_local)}
8574 @item
8575 @b{get_next_keyframe(int64_t position, int is_local)}  
8577 These give the nearest keyframe before or after the position given. 
8578 The macro defined version of load_configuration automatically retrieves
8579 the right keyframes but you may want to do this on your own.
8581 The position argument can be either in the project rate or the
8582 requested rate.  Set is_local to 1 if it's in the requested rate and 0
8583 if it's in the project rate.
8585 In each keyframe, another position value tells the keyframe's position
8586 relative to the start of the timeline and in the project rate.
8588 The only way to get smooth interpolation between keyframes is to
8589 convert the positions in the keyframe objects to the requested rate. 
8590 Do this by using edl_to_local on the keyframe positions.
8592 @end itemize
8598 @node USING OPENGL
8599 @section USING OPENGL
8603 Realtime video plugins support OpenGL.  Using OpenGL to do plugin
8604 routines can speed up playback greatly since it does most of the work
8605 in hardware.  Unfortunately, every OpenGL routine needs a software
8606 counterpart for rendering, doubling the amount of software to
8607 maintain.  Fortunately, having an OpenGL routine means the software
8608 version doesn't need to be as optimized as it did when software was the
8609 only way.
8611 As always, the best way to design a first OpenGL plugin is to copy an
8612 existing one and alter it.  The @b{Brightness} plugin is a simple
8613 OpenGL plugin to copy.  There are 3 main points in OpenGL rendering and
8614 1 point for optimizing OpenGL rendering.
8616 @menu
8617 * GETTING OPENGL DATA:: Getting video data in a form usable by OpenGL
8618 * DRAWING USING OPENGL:: The method of drawing video in OpenGL
8619 * USING SHADERS:: Routines to simplify shader usage
8620 * AGGREGATING PLUGINS:: Combining OpenGL routines from different plugins into one.
8621 @end menu
8625 @node GETTING OPENGL DATA
8626 @subsection GETTING OPENGL DATA
8628 The first problem is getting OpenGL-enabled plugins to interact with
8629 software-only plugins.  To solve this, all the information required to
8630 do OpenGL playback is stored in the VFrame object which is passed to
8631 @b{process_buffer}.  To support 3D, the VFrame contains a PBuffer and a
8632 texture, in addition to VFrame's original rows.
8634 In OpenGL mode, VFrame has 3 states corresponding to the location of
8635 its video data.  The opengl state is recovered by calling
8636 @b{get_opengl_state} and is set by calling @b{set_opengl_state}.  The
8637 states are:
8639 @itemize
8641 @item
8643 @b{VFrame::RAM} - This means the video data is stored in the
8644 traditional row pointers.  It must be loaded into a texture before
8645 being drawn using OpenGL routines.
8647 @item @b{VFrame::TEXTURE} - The video data is stored in texture
8648 memory.  It's ready to be drawn using OpenGL routines.
8650 @item @b{VFrame::SCREEN} - The video data is stored in a frame buffer
8651 in the graphics card.  For plugins, the frame buffer is always a
8652 PBuffer.  The image on the frame buffer can't be replicated again
8653 unless it is read back into the texture and the opengl state is reset
8654 to TEXTURE.  The frame buffer is limited to 8 bits per channel.  If an
8655 OpenGL effect is used in a floating point project, it only retains 8
8656 bits.
8658 @end itemize
8660 In the plugin's @b{process_buffer} routine, there is normally a call to
8661 @b{read_frame} to get data from the previous plugin in the chain. 
8662 @b{read_frame} takes a new parameter called @b{use_opengl}.  
8664 The plugin passes 1 to @b{use_opengl} if it intends to handle the data
8665 using OpenGL.  It passes 0 to @b{use_opengl} if it can only handle the
8666 data using software.  The value of @b{use_opengl} is passed up the
8667 chain to ensure a plugin which only does software only gets the data in
8668 the row pointers.  If @b{use_opengl} is 0, the opengl state in VFrame
8669 is RAM.
8671 The plugin must not only know if it is software-only but if its output
8672 must be software only.  Call @b{get_use_opengl} to determine if the
8673 output can be handled by OpenGL.  If @b{get_use_opengl} returns 0, the
8674 plugin must pass 0 for @b{use_opengl} in @b{read_frame} and do its
8675 processing in software.  If @b{get_use_opengl} is 1, the plugin can
8676 decide based on its implementation whether to use OpenGL.
8679 The main problem with OpenGL is that all the gl... calls need to be run
8680 from the same thread.  To work around this, the plugin interface has
8681 routines for running OpenGL in a common thread.  
8684 @b{run_opengl} transfers control to the common OpenGL thread.  This is
8685 normally called by the plugin in @b{process_buffer} after it calls
8686 @b{read_frame} and only if @b{get_use_opengl} is 1.
8688 Through a series of indirections, @b{run_opengl} eventually transfers
8689 control to a virtual function called @b{handle_opengl}. 
8690 @b{handle_opengl} must be overridden with a function to perform all the
8691 OpenGL routines.  The contents of @b{handle_opengl} must be enclosed in
8692 @b{#ifdef HAVE_GL} ... @b{#endif} to allow it to be compiled on systems
8693 with no graphics support, like render nodes.  The return value of
8694 @b{handle_opengl} is passed back from @b{run_opengl}.
8696 @b{read_frame} can't be called from inside @b{handle_opengl}.  This
8697 would create a recursive lockup because it would cause other objects to
8698 call @b{run_opengl}.
8700 Once inside @b{handle_opengl}, the plugin has full usage of all the
8701 OpenGL features.  VFrame provides some functions to automate common
8702 OpenGL sequences.
8704 The VFrame argument to @b{process_buffer} is always available through
8705 the @b{get_output(int layer)} function.  If the plugin is multichannel,
8706 the layer argument retrieves a specific layer of the output buffers. 
8707 The PBuffer of the output buffer is where the OpenGL output must go if
8708 any processing is done.
8712 @node DRAWING USING OPENGL
8713 @subsection DRAWING USING OPENGL
8716 The sequence of commands to draw on the output PBuffer stars with
8717 getting the video in a memory area where it can be recalled for
8718 drawing:
8720 @example
8721 get_output()->to_texture();
8722 get_output()->enable_opengl();
8723 @end example
8725 @b{to_texture} transfers the OpenGL data from wherever it is to the
8726 output's texture memory and sets the output state to TEXTURE.
8728 @b{enable_opengl} makes the OpenGL context relative to the output's
8729 PBuffer.
8731 The next step is to draw the texture with some processing on the
8732 PBuffer.  The normal sequence of commands to draw a texture is:
8734 @example
8735 get_output()->init_screen();
8736 get_output()->bind_texture(0);
8737 get_output()->draw_texture();
8738 @end example
8740 @b{VFrame::init_screen} sets the OpenGL frustum and parameters to known
8741 values.
8743 @b{VFrame::bind_texture(int texture_unit)} binds the texture to the given
8744 texture unit and enables it.
8746 @b{VFrame::draw_texture()} calls the vertex functions to draw the
8747 texture normalized to the size of the PBuffer.  Copy this if you want
8748 custom vertices.
8750 The last step in the handle_opengl routine, after the texture has been
8751 drawn on the PBuffer, is to set the output's opengl state to SCREEN
8752 with a call to @b{VFrame::set_opengl_state}.  The plugin should not
8753 read back the frame buffer into a texture or row pointers if it has no
8754 further processing.  Plugins should only leave the output in the
8755 texture or RAM if its location results from normal processing.  They
8756 should set the opengl state to RAM or TEXTURE if they do.
8758 @b{Colormodels in OpenGL}
8760 The colormodel exposed to OpenGL routines is always floating point
8761 since that is what OpenGL uses, but it may be YUV or RGB depending on
8762 the project settings.  If it's YUV, it's offset by 0.5 just like in
8763 software.  Passing YUV colormodels to plugins was necessary for speed. 
8764 The other option was to convert YUV to RGB in the first step that
8765 needed OpenGL.  Every effect and rendering step would have needed a YUV
8766 to RGB routine.  With the YUV retained, only the final compositing step
8767 needs a YUV to RGB routine.
8774 @node USING SHADERS
8775 @subsection USING SHADERS
8777 Very few effects can do anything useful with just a straight drawing of
8778 the texture on the PBuffer.  They normally define a shader.  The shader
8779 is a C program which runs on the graphics card.  Since the graphics
8780 card is optimized for graphics, it can be much faster than running it
8781 on the CPU.  
8783 Shaders are written in OpenGL Shading Language.  The shader source code
8784 is contained in a string.  The normal sequence for using a shader comes
8785 after a call to @b{enable_opengl}.
8787 @example
8788 char *shader_source = "...";
8789 unsigned char shader_id = VFrame::make_shader(0, shader_source, 0);
8790 glUseProgram(shader_id);
8791 // Set uniform variables using glUniform commands
8792 @end example
8794 The compilation and linking step for shaders is encapsulated by the
8795 VFrame::make_shader command.  It returns a shader_id which can be
8796 passed to OpenGL functions.  The first and last arguments must always
8797 by 0.  And arbitrary number of source strings may be put between the
8798 0's.  The source strings are concatenated by make_shader into one huge
8799 shader source.  If multiple main functions are in the sources, the main
8800 functions are renamed and run in order.
8802 There are a number of useful macros for shaders in playback3d.h.  All
8803 the shaders so far have been fragment shaders.  After the shader is
8804 initialized, draw the texture starting from @b{init_screen}.  The
8805 shader program must be disabled with another call to
8806 @b{glUseProgram(0)} and 0 as the argument.
8808 The shader_id and source code is stored in memory as long as Cinelerra
8809 runs.  Future calls to make_shader with the same source code run much
8810 faster.
8815 @node AGGREGATING PLUGINS
8816 @subsection AGGREGATING PLUGINS
8818 Further speed improvements may be obtained by combining OpenGL routines
8819 from two plugins into a single handle_opengl function.  This is done
8820 when @b{Frame to Fields} and @b{RGB to 601} are attached in order. 
8821 Aggregations of more than two plugins are possible but very hard to get
8822 working.  Aggregation is useful for OpenGL because each plugin must
8823 copy the video from a texture to a PBuffer.  In software there was no
8824 copy operation.
8826 In aggregation, one plugin processes everything from the other plugins
8827 and the other plugins fall through.  The fall through plugins must copy
8828 their parameters to the output buffer so they can be detected by the
8829 processing plugin.
8831 The VFrame used as the output buffer contains a parameter table for
8832 parameter passing between plugins and it's accessed with
8833 @b{get_output()->get_params()}.  Parameters are set and retrieved in
8834 the table with calls to @b{update} and @b{get} just like with defaults.
8836 The fall through plugins must determine if the processor plugin is
8837 attached with calls to @b{next_effect_is} and @b{prev_effect_is}. 
8838 These take the name of the processor plugin as a string argument and
8839 return 1 if the next or previous plugin is the processor plugin.  If
8840 either returns 1, the fall through plugin must still call @b{read_frame} to
8841 propogate the data but return after that.
8843 The processor plugin must call @b{next_effect_is} and
8844 @b{prev_effect_is} to determine if it's aggregated with a fall through
8845 plugin.  If it is, it must perform the operations of the fall through
8846 plugin in its OpenGL routine.  The parameters for the the fall through
8847 plugin should be available by @b{get_output()->get_params()} if the
8848 fall through plugin set them.
8857 @node KEYBOARD SHORTCUTS
8858 @chapter KEYBOARD SHORTCUTS
8860 Alex Ferrer started summarizing most of the keyboard shortcuts.  Most
8861 of the keys work without any modifier like shift or ctrl.  Most windows
8862 can be closed with a @b{Ctrl-w}.  Most operations can be cancelled with
8863 @b{ESC} and accepted with @b{Enter}.
8865 @section PROGRAM WINDOW
8868 @subsection Editing Media
8870 @example
8871 z         Undo
8872 Shift Z   Re-Do
8873 x         Cut
8874 c         Copy
8875 v         Paste
8876 Del       Clear
8877 Shift Spc Paste Silence
8878 m         Mute region
8879 a         Select all
8880 shift + click   When done over an edit causes the highlighted selection to extend to the cursor position.
8881                 When done over the boundary of an effect causes the trim operation to apply to one effect.
8882 @end example
8884 @subsection Editing Labels & In/Out Points
8886 @example
8887 [             Toggle In point 
8888 ]             Toggle Out point 
8889 l             Toggle label at current position
8890 Ctrl <-       Go to Previous Label
8891 Ctrl ->       Go to Next Label
8892 @end example
8895 @subsection Navigation
8897 @example
8898 Right arrow      Move right*
8899 Left arrow       Move left*
8900 Up arrow         Zoom out*
8901 Down arrow       Zoom in*
8902 Ctrl Up          Expand waveform amplitude
8903 Ctrl Dn          Shrink waveform amplitude
8904 Alt Up           Expand curve amplitude
8905 Alt Dn           Shrink curve amplitude
8906 f                Fit time displayed to selection
8907 Alt f            Fit curve amplitude to highlighted section of curves
8908 Alt Left         Move left one edit
8909 Alt Right        Move right one edit
8910 Page Up          Move up*
8911 Page Dn          Move down*
8912 Ctrl Page Up     Expand track height
8913 Ctrl Page Dn     Shrink track height
8914 Home             Go to beginning of timeline*
8915 End              Go to end of timeline*
8917 @end example
8919 * You may have to click on the timeline to deactivate any text boxes or
8920 tumblers before these work.
8925 @subsection File operations
8927 @example
8928 n         New project
8929 o         Load Files
8930 s         Save Project
8931 r         Record
8932 Shift R   Render
8933 q         Quit
8934 Shift P   Preferences
8935 Shift B   Batch Render
8936 Shift F   Set Format
8937 @end example
8939 @subsection Key Frame Editing
8941 @example
8943 Shift X    Cut keyframes
8944 Shift C    Copy keyframes
8945 Shift V    Paste keyframes
8946 Shift Del  Clear keyframes
8947 Alt c      Copy default keyframe
8948 Alt v      Paste default keyframe
8950 @end example
8953 @subsection Track Manipulation
8955 @example
8957 t          Add Audio Track
8958 u          Insert default Audio Transition
8959 Shift T    Add Video Track
8960 Shift U    Insert Default Video Transition
8961 d          Delete last Track
8962 Shift L    Loop playback
8963 Tab        Toggle single track arming status
8964 Shift-Tab  Toggle every other track's arming status
8966 @end example
8968 @subsection What's drawn on the timeline
8970 @example
8972 1         Show titles
8973 2         Show transitions
8974 3         Fade keyframes
8975 4         Mute keyframes
8976 5         Mode keyframes
8977 6         Pan keyframes
8978 7         Camera keyframes
8979 8         Projector keyframes
8980 9         Plugin keyframes
8981 0         Mask keyframes
8982 -         Camera Zoom
8983 =         Projector Zoom
8985 @end example
8988 @section VIEWER & COMPOSITOR WINDOWS
8990 @example
8992 x         Cut
8993 c         Copy
8994 v         Paste
8995 v         Splice
8996 b         Overwrite
8997 [         Toggle In point 
8998 ]         Toggle Out point 
8999 l         Toggle label at current position
9000 Ctrl <-   Go to Previous Label
9001 Ctrl ->   Go to Next Label
9002 Home      Go to beginning
9003 End       Go to end
9004 z         Undo
9005 Shift Z   Re-Do
9006 +         Zoom in
9007 -         Zoom out
9009 @end example
9013 @section PLAYBACK TRANSPORT
9015 Transport controls work in any window which has a playback transport.  They are
9016 accessed through the number pad with num lock disabled.
9018 @example
9019 4 Frame back         5 Reverse Slow     6 Reverse      + Reverse Fast
9020 1 Frame Forward      2 Forward Slow     3 Play     Enter Fast Forward
9021 0 Stop
9023 @end example
9025 [ Space bar ] is normal Play, Hitting any key twice is Pause.
9028 Hitting any transport control with CTRL down causes only the region
9029 between the in/out points to be played, if in/out points are defined.
9031 @section RECORD WINDOW
9033 @example
9035 Space              Start and pause recording of the current batch
9036 l                  Toggle label at current position.
9038 @end example
9040 @bye