r863: Merge 2.1:
[cinelerra_cv/ct.git] / doc / cinelerra.texi
blobde2f185855f9bbb1efbadff3a95721023b322d15
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.0.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 * BUZ::
572 * RAW 1394 VIDEO PLAYBACK::
573 * DV 1394 VIDEO PLAYBACK::
574 * IEC 61883 VIDEO PLAYBACK::
575 @end menu
577 @node COMMON VIDEO DRIVER ATTRIBUTES
578 @subsection COMMON VIDEO DRIVER ATTRIBUTES
581 @itemize
583 @item
585 DISPLAY
587 The is intended for dual monitor
588 displays.  Depending on the value of Display, the Compositor window
589 will appear on a different monitor from the rest of the windows.
591 @item
593 DEVICE PATH
595 Usually a file in the @b{/dev/} directory
596 which controls the device.
598 @item
600 SWAP FIELDS
602 Make the even lines odd and the odd lines even
603 when sending to the device.  On an NTSC or 1080i monitor the fields may
604 need to be swapped to prevent jittery motion.
606 @item
608 OUTPUT CHANNEL
610 Devices with multiple outputs may need a
611 specific connector to send video on.
613 @item
615 PORT
617 The IEEE1394 standard specifies something known as the
618 @b{port}.  This is probably the firewire card number in the system
619 to use.
621 @item
623 CHANNEL
625 The IEEE1394 standard specifies something known as the
626 @b{channel}.  For DV cameras it's always @b{63}.
628 @end itemize
630 @node X11
631 @subsection X11
633 This was the first method of video playback on any UNIX system, valid
634 all the way until 1999.  It just writes the RGB triplet for each pixel
635 directly to the window.  It's the slowest playback method.  It's still
636 useful as a fallback when graphics hardware can't handle very large
637 frames.
639 @node X11-XV
640 @subsection X11-XV
642 This was the second big method of video playback in UNIX starting in
643 1999.  It converts YUV to RGB in hardware with scaling.  It's the
644 preferred playback method but can't handle large frame sizes.  The
645 maximum video size for XV is usually 1920x1080.
649 @node BUZ
650 @subsection BUZ
652 This is a method for playing motion JPEG-A files directly to a
653 composite analog signal.  It uses a popular hack of the Video4Linux 1
654 driver from 2000 to decompress JPEG in hardware.  Sadly, even though
655 analog output is largely obsolete, newer drivers have replaced BUZ.
657 @node RAW 1394 VIDEO PLAYBACK
658 @subsection RAW 1394 VIDEO PLAYBACK
660 The first interface between linux software and firewire camcorders. 
661 This was the least reliable way to play video to a camcorder.  It
662 consisted of a library on top of the kernel commands.
665 @node DV 1394 VIDEO PLAYBACK
666 @subsection DV 1394 VIDEO PLAYBACK
668 The second rewrite of DV camcorder support in Linux.  This was the most
669 reliable way to play video to a camcorder.  This consisted of direct
670 kernel commands.
672 @node IEC 61883 VIDEO PLAYBACK
673 @subsection IEC 61883 VIDEO PLAYBACK
676 The third rewrite of DV camcorder support in Linux.  This is a library
677 on top of RAW 1394 which is a library on top of the kernel commands. 
678 It's less reliable than DV 1394 but more reliable than RAW 1394.  The
679 next rewrite ought to fix that.
687 @node PLAYBACK
688 @section PLAYBACK
692 @menu
693 * AUDIO OUT::
694 * VIDEO OUT::
695 @end menu
699 @node AUDIO OUT
700 @subsection AUDIO OUT
702 These determine what happens when you play sound from the timeline.
704 @itemize 
706 @item
707 SAMPLES TO SEND TO CONSOLE:
709 For playing audio, small fragments of sound are read from disk and
710 processed in a virtual console sequentially.  A larger value here
711 causes more latency when you change mixing parameters but gives more
712 reliable playback.
714 Some sound drivers don't allow changing of the console fragment so
715 latency is unchanged no matter what this value is.
717 A good way of ensuring high quality playback was to read bigger
718 fragments from the disk and break them into smaller fragments for the
719 soundcard.  That changed when the virtual console moved from the push
720 model to the pull model.  Since different stages of the rendering
721 pipeline can change the rate of the incoming data, it would now be real
722 hard to disconnect size of the console fragments from the size of the
723 fragments read from disk.
725 @item
727 AUDIO OFFSET:
729 The ability to tell the exact playback position on Linux sound drivers
730 is pretty bad if it's provided at all.  Since this information is
731 required for proper video synchronization, it has to be accurate.  The
732 @b{AUDIO OFFSET} allows users to adjust the position returned by the
733 sound driver to reflect reality.  The audio offset doesn't affect the
734 audio playback or rendering at all.  It merely changes the
735 synchronization of video playback.
737 The easiest way to set the audio offset is to create a timeline with 1
738 video track and one audio track.  Expand the audio track and center the
739 audio pan.  The frame rate should be something over 24fps and the
740 sampling rate should be over 32000.  The frame size should be small
741 enough for your computer to render it at the full framerate.  Highlight
742 a region of the timeline starting at 10 seconds and ending at 20
743 seconds.  Drop a @b{gradient} effect on the video track and configure
744 it to be clearly visible.  Drop a @b{synthesizer} effect on the audio
745 and configure it to be clearly audible.
747 Play the timeline from 0 and watch to see if the gradient effect starts
748 exactly when the audio starts.  If it doesn't, expand the audio track
749 and adjust the nudge.  If the audio starts ahead of the video, decrease
750 the nudge value.  If the audio starts after the video, increase the
751 nudge value.  Once the tracks play back synchronized, copy the nudge
752 value to the @b{AUDIO OFFSET} value in preferences.
754 @b{Note:} if you change sound drivers or you change the value of @b{USE
755 SOFTWARE FOR POSITIONING INFORMATION}, you'll need to change the audio
756 offset because different sound drivers are unequally inaccurate.
758 @item
760 VIEW FOLLOWS PLAYBACK
762 Causes the timeline window to scroll when the playback cursor moves. 
763 This can bog down the X Server or cause the timeline window to lock up
764 for long periods of time while drawing the assetse.
766 @item
767 USE SOFTWARE FOR POSITIONING INFORMATION
769 Most soundcards and sound drivers don't give reliable information on
770 the number of samples the card has played. When playing video you need
771 this information for synchronization. This option causes the sound
772 driver to be ignored and a software timer to be used for
773 synchronization.
775 @item
776 AUDIO PLAYBACK IN REALTIME:
778 Back in the days when 150Mhz was the maximum, this allowed
779 uninterrupted playback on heavy loads.  It forces the audio playback to
780 the highest priority in the kernel.  Today it's most useful for
781 achieving very low latency between console tweeks and soundcard
782 output.  You must be root to get realtime priority.
784 @item
785 AUDIO DRIVER
787 There are many sound drivers for Linux.  This allows selecting one
788 sound driver and setting parameters specific to it.  The sound drivers
789 and their parameters are described in the sound driver section. 
790 @xref{AUDIO DRIVERS}.
792 @end itemize
797 @node VIDEO OUT
798 @subsection VIDEO OUT
800 These determine how video gets from the timeline to your eyes.
802 @itemize
805 @item PLAY EVERY FRAME
807 Causes every frame of video to be displayed even if it means falling
808 behind the audio.  This should always be on unless you use mostly
809 uncompressed codecs.  Most compressed codecs don't support frame
810 dropping anymore.
814 @item
816 FRAMERATE ACHIEVED
818 The number of frames per second being displayed during playback.  This
819 is only updated during playback.
822 @item
824 SCALING EQUATION
826 When video playback involves any kind of scaling or translation, this
827 algorithm is used.  This doesn't affect 1:1 playback.
829 @itemize
831 @item
832 NEAREST NEIGHBOR ENLARGE AND REDUCE
834 lowest but fastest
835 quality.  Produces jagged edges and uneven motion.
838 @item
840 BICUBIC ENLARGE AND BILINEAR REDUCE
842 highest but slowest
843 quality.  For enlarging a bicubic interpolation is used, which blurs
844 slightly but doesn't reveal stair steps.  For reduction a bilinear
845 interpolation is used, which produces very sharp images and reduces
846 noise.  The bilinear reduced images can be sharpened with a sharpen
847 effect with less noise than a normal sized image.
849 @item
851 BILINEAR ENLARGE AND BILINEAR REDUCE
853 when slight enlargement
854 is needed a bilinear enlargement looks better than a bicubic
855 enlargement.
857 @end itemize
860 @item
862 PRELOAD BUFFER FOR QUICKTIME
864 The Quicktime/AVI decoder can handle DVD sources better when this is
865 around 10000000.  This reduces the amount of seeking required. 
866 Unfortunately when reading high bitrate sources from a hard drive, this
867 tends to slow it down.  For normal use this should be 0.
870 @item 
872 DVD SUBTITLE TO DISPLAY
874 DVD IFO files usually contain subtitle tracks.  These must be decoded
875 with by the MPEG decoder.  Select @b{Enable subtitles} to enable
876 subtitle decoding.  There are usually multiple subtitle tracks starting
877 from 0.  The subtitle track to be decoded for all MPEG streams goes in
878 the DVD subtitlee to display text box.  Go to the asset corresponding
879 to the MPEG file in the Resources window and right click.  Click on
880 Info.  The number of subtitle tracks is given at the bottom.
883 @item 
889 VIDEO DRIVER
891 Normally video on the timeline goes to the compositor window during
892 continuous playback and when the insertion point is repositioned. 
893 Instead of sending video to the Compositor window the video driver can
894 be set to send video to another output device during continuous
895 playback.  This doesn't affect where video goes when the insertion
896 point is repositioned, however.
898 The video drivers and their parameters are described in the video
899 driver section.  @xref{VIDEO DRIVERS}.
902 @end itemize
907 @node RECORDING
908 @section RECORDING
910 @menu
911 * FILE FORMAT::
912 * AUDIO IN::
913 * VIDEO IN::
914 @end menu
918 The parameters here affect what happens when you go to
919 @b{File->Record...}.  The intention was to make @b{File->Record...} go
920 as fast as possible into the record monitoring window, without a
921 lengthy dialog to configure the file format.  Instead the file format
922 for recording is set here and it is applied to all recordings.  Also
923 set here is the hardware for recording, since the hardware determines
924 the supported file format in most cases.
927 @node FILE FORMAT
928 @subsection FILE FORMAT
930 This determines the output file format for recordings.  It depends
931 heavily on the type of driver used.  The interface is the same as the
932 rendering interface.  The @b{Record audio tracks} toggle must be
933 enabled to record audio.  The @b{Record video tracks} toggle must be
934 enabled to record video.  The wrench button left of each toggle opens a
935 configuration dialog to set the codec corresponding to audio and
936 video.  The audio and video is wrapped in a wrapper defined by the
937 @b{File Format} menu.  Different wrappers may record audio only, video
938 only, or both.
940 Some video drivers can only record to a certain wrapper.  DV, for
941 example, can only record to Quicktime with DV as the video compression.
942 If the video driver is changed, the file format may be updated to give
943 the supported output.  If you change the file format to an unsupported
944 format, it may not work with the video driver.
948 @node AUDIO IN
949 @subsection AUDIO IN
951 These determine what happens when you record audio.
953 @itemize
954 @item
956 RECORD DRIVER
958 This is used for recording audio in the Record window.  It may be
959 shared with the Record Driver for video if the audio and video are
960 wrapped in the same stream.  It takes variable parameters depending on
961 the driver.  The parameters have the same meaning as they do for
962 playback.
964 @itemize
965 @item
967 DEVICE PATH
969 Usually a file in the @b{/dev/} directory which controls the
970 device.
972 @item
974 BITS
976 The number of bits of precision Cinelerra should set the device for. 
977 This sometimes has a figuritive meaning.  Some sound drivers need to be
978 set to 32 bits to perform 24 bit recording and won't record anything
979 when set to 24 bits.  Some sound drivers need to be set to 24 bits for
980 24 bit recording.
984 @end itemize
986 @item
988 SAMPLES TO WRITE AT A TIME
990 Audio is first read in small fragments from the device.  Many small
991 fragments are combined into a large fragment before writing to disk. 
992 The disk writing process is done in a different thread.  The value here
993 determines how large the combination of fragments is for each disk
994 write.
996 @item
998 SAMPLE RATE FOR RECORDING
1000 Regardless of what the project settings are.  This is the sample rate
1001 used for recording.  This should be the highest the audio device
1002 supports.
1004 @end itemize
1006 @node VIDEO IN
1007 @subsection VIDEO IN
1009 These determine what happens when you record video.
1011 @itemize
1012 @item
1014 RECORD DRIVER
1016 This is used for recording video in the Record window.  It may be
1017 shared with the Record Driver for audio if the audio and video are
1018 wrapped in the same stream.  It takes variable parameters depending on
1019 the driver.  The parameters have the same meaning as they do for
1020 playback.
1022 @item
1024 FRAMES TO RECORD TO DISK AT A TIME
1026 Frames are recorded in a pipeline.  First frames are buffered in the
1027 device.  Then they're read into a larger buffer for writing to disk. 
1028 The disk writing is done in a different thread as the device reading. 
1029 For certain codecs the disk writing uses multiple processors.  This
1030 value determines how many frames are written to disk at a time.
1032 @item
1034 FRAMES TO BUFFER IN DEVICE
1036 The number of frames to store in the device before reading.  This
1037 determines how much latency there can be in the system before frames
1038 are dropped.
1040 @item
1041 USE SOFTWARE FOR POSITIONING INFORMATION
1043 Video uses audio for
1046 synchronization but most soundcards don't give accurate position
1047 information.  This calculates an estimation of audio position in
1048 software instead of the hardware for synchronization.
1050 @item
1052 SYNC DRIVES AUTOMATICALLY
1054 For high bitrate recording the drives may be fast enough to store the
1055 data but Linux may wait several minutes and stall as it writes several
1056 minutes of data at a time.  This forces Linux to flush its buffers
1057 every second instead of every few minutes and produce slightly better
1058 realtime behavior.
1060 @item
1062 SIZE OF CAPTURED FRAME
1064 This is the size of the frames recorded.  It is independant of the
1065 project frame size because most video devices only record a fixed frame
1066 size.  If the frame size given here isn't supported by the device it
1067 might crash Cinelerra.
1069 @item
1070 FRAME RATE FOR RECORDING
1072 The frame rate recorded is different from the project settings.  This
1073 sets the recorded frame rate.
1075 @end itemize
1084 @node PERFORMANCE
1085 @section PERFORMANCE
1088 You'll spend most of your time configuring this section.  The main
1089 focus of performance is rendering parameters not available in the
1090 rendering dialog.  
1096 @itemize 
1098 @item
1099 CACHE ITEMS
1103 To speed up rendering, several assets are kept open simultaneously.
1104 This determines how many are kept open.  A number too large may exhaust
1105 your memory pretty fast and result in a crash.  A number too small may
1106 result in slow playback as assets need to be reopened more frequently.
1109 @item
1111 SECONDS TO PREROLL RENDERS
1113 Some effects need a certain amount of time to settle in.  This sets a
1114 number of seconds to render without writing to disk before the selected
1115 region is rendered.  When using the renderfarm you'll sometimes need to
1116 preroll to get seemless transitions between the jobs.  Every job in a
1117 renderfarm is prerolled by this value.  This does not affect background
1118 rendering, however.  Background rendering uses a different preroll
1119 value.
1121 @item
1123 FORCE SINGLE PROCESSOR USE
1125 Cinelerra tries to use all processors on the system by default but
1126 sometimes you'll only want to use one processor, like in a renderfarm
1127 client.  This forces only one processer to be used.  The operating
1128 system, however, usually uses the second processor anyway for disk
1129 access so this option is really a 1.25 processor mode.  The value of
1130 this parameter is used in renderfarm clients.
1132 @end itemize
1135 @menu
1136 * BACKGROUND RENDERING::
1137 * RENDERFARM::
1138 @end menu
1141 @node BACKGROUND RENDERING
1142 @subsection BACKGROUND RENDERING
1144 Background rendering was originally concieved to allow HDTV effects to
1145 be displayed in realtime.  Background rendering causes temporary output
1146 to constantly be rendered while the timeline is being modified.  The
1147 temporary output is played during playack whenever possible.  It's very
1148 useful for transitions and previewing effects which are too slow to
1149 display in a reasonable amount of time.  If renderfarm is enabled, the
1150 renderfarm is used for background rendering, giving you the potential
1151 for realtime effects if enough network bandwidth and CPU nodes exist.
1153 @itemize
1159 @item
1160 FRAMES PER BACKGROUND RENDERING JOB
1162 This only works if renderfarm is being used, otherwise background
1163 rendering creates a single job for the entire timeline.  The number of
1164 frames specified here is scaled to the relative CPU speed of rendering
1165 nodes and used in a single renderfarm job.  The optimum number is 10 -
1166 30 since network bandwidth is used to initialize each job.
1170 @item
1171 FRAMES TO PREROLL BACKGROUND
1173 This is the number of frames to render ahead of each background
1174 rendering job.  Background rendering is degraded when preroll is used
1175 since the jobs are small.  When using background rendering, this number
1176 is ideally 0.  Some effects may require 3 frames of preroll.
1182 @item
1183 OUTPUT FOR BACKGROUND RENDERING
1185 Background rendering generates a sequence of image files in a certain
1186 directory.  This parameter determines the filename prefix of the image
1187 files.  It should be on a fast disk, accessible to every node in the
1188 renderfarm by the same path.  Since hundreds of thousands of image
1189 files are usually created, @b{ls} commands won't work in the
1190 background rendering directory.  The @image{magnify} browse button for
1191 this option normally won't work either, but the @image{wrench}
1192 configuration button for this option works.
1194 @item
1195 FILE FORMAT
1197 The file format for background rendering has to be a sequence of
1198 images. The format of the image sequence determines the quality and
1199 speed of playback.  JPEG is good most of the time.
1202 @end itemize
1204 @node RENDERFARM
1205 @subsection RENDERFARM
1207 To use the renderfarm set these options.  Ignore them for a standalone
1208 system
1210 @itemize
1212 @item
1214 USE RENDER FARM FOR RENDERING
1216 When selected, all the
1217 @b{file->render} operations use the renderfarm.
1219 @item
1221 NODES
1223 Displays all the nodes on the renderfarm and which ones are active. 
1225 Nodes are added by entering the host name of the node, verifying the
1226 value of @b{port} and hitting @b{add node}.
1228 Computer freaks may be better off editing the
1229 @b{~/.bcast/.Cinelerra_rc} file than this if they have hundreds of
1230 nodes.  Remember that .Cinelerra_rc is overwritten whenever a copy of
1231 Cinelerra exits.
1233 Select the @b{ON} column to activate and deactivate nodes once they
1234 are created.
1236 Nodes may be edited by highlighting a row and hitting @b{apply changes}.
1238 @item
1240 HOSTNAME
1242 Edit the hostname of an existing node or enter the hostname of a new
1243 node here.
1245 @item
1247 PORT
1249 Edit the port of an existing node or enter the port of a new node here.
1251 @item
1253 REPLACE NODE
1255 When editing an existing node, hit this to commit the changes to
1256 @b{HOSTNAME} and @b{PORT}.  The changes won't be committed if you
1257 don't hit this button.
1259 @item
1261 ADD NODE
1263 Create a new node with the @b{HOSTNAME} and @b{PORT} settings.
1265 @item
1267 DELETE NODE
1269 Deletes whatever node is highlighted in the @b{NODES} list.
1271 @item
1273 SORT NODES
1275 Sorts the @b{NODES} list based on the hostname.
1277 @item
1279 RESET RATES
1281 This sets the framerate for all the nodes to 0.  Frame rates are used
1282 to scale job sizes based on CPU speed of the node.  Frame rates are
1283 only calculated when renderfarm is enabled.
1290 @item
1292 TOTAL JOBS TO CREATE
1294 Determines the number of jobs to dispatch to the renderfarm.  The more
1295 jobs you create, the more finely balanced the renderfarm becomes.
1297 Determine the total jobs to create by multiplying the number of nodes
1298 including the master node by some number.  Multiply them by 1 to have
1299 one job dispatched for every node.  Multiply them by 3 to have 3 jobs
1300 dispatched for every node.  If you have 10 slave nodes and one master
1301 node, specify 33 to have a well balanced renderfarm.
1303 @end itemize
1309 @node INTERFACE
1310 @section INTERFACE
1312 These parameters affect purely how the user interface works.
1314 @itemize
1316 @item
1318 INDEX FILES GO HERE
1320 Back in the days when 4 MB/sec was unearthly speed for a hard drive,
1321 index files were introduced to speed up drawing the audio tracks.  This
1322 option determines where index files are placed on the hard drive.
1325 @item
1327 SIZE OF INDEX FILE
1329 Determines the size of an index file. Larger index sizes allow smaller
1330 files to be drawn faster while slowing down the drawing of large files.
1331 Smaller index sizes allow large files to be drawn faster while slowing
1332 down small files.
1334 @item
1336 NUMBER OF INDEX FILES TO KEEP
1338 To keep the index directory from becoming unruly, old index files are
1339 deleted. This determines the maximum number of index files to keep in
1340 the directory.
1342 @item
1344 DELETE ALL INDEXES
1346 When you change the index size or you want to clean out excessive index
1347 files, this deletes all the index files.
1349 @item
1350 USE HOURS:MINUTES:SECONDS.XXX
1352 Various representations of time are given.  Select the most convenient
1353 one.  The time representation can also be changed by @b{CTRL}
1354 clicking on the time ruler.
1356 @item
1357 USE THUMBNAILS
1359 The Resource Window displays thumbnails of assets by default.  This can
1360 take a long time to set up.  This option disables the thumbnails.
1362 @item
1363 CLICKING IN/OUT POINTS DOES WHAT
1365 Cinelerra not only allows you to perform editing by dragging in/out
1366 points but also defines three seperate operations which occur when you
1367 drag an in/out point. For each mouse button you select the behavior in
1368 this window. The usage of each editing mode is described in editing.
1370 @item
1371 MIN DB FOR METER
1373 Some sound sources have a lower noise threshold than others. 
1374 Everything below the noise threshold is meaningless.  This option sets
1375 the meters to clip below a certain level.  Consumer soundcards usually
1376 bottom out at -65.  Professional soundcards bottom out at -90.
1377 @xref{SOUND LEVEL METERS}.
1379 @item
1380 MAX DB FOR METER
1382 This sets the maximum sound level represented by the sound meters.  No
1383 matter what this value is, no soundcard can play sound over 0 db.  This
1384 value is presented merely to show how far over the limit a sound wave
1386 @xref{SOUND LEVEL METERS}.
1388 @item
1389 THEME
1391 Cinelerra supports variable themes.  Select one here and restart
1392 Cinelerra to see it.
1394 @end itemize
1398 @node ABOUT
1399 @section ABOUT
1401 This section gives you information about the copyright, the time of the
1402 current build, the lack of a warranty, and the versions of some of the
1403 libraries.  Be sure to agree to the terms of the lack of the warranty.
1411 @node CREATING A NEW PROJECT
1412 @chapter CREATING A NEW PROJECT
1414 There are 2 ways to create a new project: going to @b{File->New} or
1415 loading new files @xref{LOADING FILES}.  Once a new project is
1416 created, all the parameters can be changed later without creating a new
1417 project.  
1420 @menu
1421 * USING THE NEW PROJECT DIALOG::
1422 * CHANGING PARAMETERS AFTER LOADING::
1423 @end menu
1427 @node USING THE NEW PROJECT DIALOG
1428 @section USING THE NEW PROJECT DIALOG
1430 One way is to go to @b{File->New}.  This dialog contains the parameters
1431 for the new project.  The sections of the @b{New} dialog are described
1432 here:
1434 @itemize
1436 @item
1438 @b{Presets} - Select an option from this menu to have all the project
1439 settings set to one of the known standards.
1441 @item
1442 @b{Audio -> Tracks} - Sets the number of audio tracks the new project
1443 should have.  Tracks can be added or deleted later, but options are
1444 provided here for convenience.
1446 @item
1447 @b{Audio -> Channels} - Sets the number of audio channels the new
1448 project should have.  The number of audio channels doesn't have to be
1449 the same as the number of tracks.
1451 @item
1452 @b{Audio -> Samplerate} - Sets the samplerate of the audio.  The
1453 project samplerate doesn't have to be the same as the media sample rate
1454 that you load.  Media is resampled to match the project sample rate.
1456 @item
1457 @b{Video -> Tracks} - Sets the number of video tracks the new project
1458 should have.  Tracks can be added or deleted later, but options are
1459 provided here for convenience.
1461 @item
1462 @b{Video -> Framerate} - Sets the framerate of the video.  The project
1463 framerate doesn't have to be the same as the media frame rate that you
1464 load.  Media is reframed to match the project framerate.
1466 @item
1467 @b{Video -> Canvas size} - Sets the size of the video output.  Each
1468 track also has its own frame size.  Initially the @b{New} dialog
1469 creates video tracks whose sizes all match the video output, but the
1470 video track sizes can be changed later without changing the video
1471 output.
1473 @item
1474 @b{Video -> Aspect ratio} - Sets the aspect ratio.  The aspect ratio is
1475 applied to the video output.  The aspect ratio can be different than
1476 the number of horizontal pixels / the number of vertical pixels. 
1477 Setting a different aspect ratio than the number of pixels results in
1478 nonsquare pixels.
1480 @item
1481 @b{Video -> Auto aspect ratio} - If this is checked, the @b{New} dialog
1482 always recalculates the @b{Aspect ratio} setting when the @b{Canvas
1483 size} is changed.  This ensures pixels are always square.
1485 @item 
1486 @b{Video -> Color model} - This sets the color model video intermediates
1487 in the project will be stored in.  Color models are described in a 
1488 separate section @xref{COLOR MODEL}.
1490 @end itemize
1504 @node CHANGING PARAMETERS AFTER LOADING
1505 @section CHANGING PARAMETERS AFTER LOADING
1507 After a project is created, you have to use the set format dialog to
1508 change parameters without deleting the project.  Go to @b{Settings->Set
1509 format}.  
1511 Most of the options are identical to the @b{File->New}
1512 options except the lack of a number of tracks to create and the
1513 addition of audio channel locations.
1515 This section is discussed in @xref{SETTING PROJECT ATTRIBUTES}.
1522 @node THE MAIN WINDOWS
1523 @chapter THE MAIN WINDOWS
1525 When Cinelerra first starts, you'll get four main windows.  Hitting
1526 @b{CTRL-w} in any window closes it.
1529 @menu
1530 * VIEWER::
1531 * COMPOSITOR::
1532 * PROGRAM::
1533 * RESOURCES::
1534 * SOUND LEVEL METERS::
1535 * OTHER WINDOWS::
1536 @end menu
1538 @node VIEWER
1539 @section VIEWER
1542 In here you'll scrub around source media and clips, selecting regions
1543 to paste into the project.  Operations done in the viewer affect a
1544 temporary EDL or a clip but not the timeline.
1546 @node COMPOSITOR
1547 @section COMPOSITOR
1550 This window displays the output of the timeline.  It's the interface
1551 for most compositing operations or operations that affect the
1552 appearance of the timeline output.  Operations done in the Compositor
1553 affect the timeline but don't affect clips.
1555 The video output has several navigation functions.  The video output
1556 size is either locked to the window size or unlocked with scrollbars
1557 for navigation.  The video output can be zoomed in and out and panned. 
1558 Navigating the video output this way doesn't affect the rendered
1559 output, it just changes the point of view in the compositor window.
1561 If it is unlocked from the window size, middle clicking and dragging
1562 anywhere in the video pans the point of view.
1564 Hitting the + and - keys zooms in and out of the video output.
1566 Underneath the video output are copies of many of the functions
1567 available in the main window.  In addition there is a
1568 @image{cwindow_zoom} zoom menu and a @image{cwindow_light} tally light.
1570 The zoom menu jumps to all the possible zoom settings and, through the
1571 @b{Auto} option, locks the video to the window size.  The zoom menu
1572 does not affect the window size.
1574 The tally light turns red when rendering is happening.  This is useful
1575 for knowing if the output is current.
1577 Right clicking anywhere in the video output brings up a menu with all
1578 the zoom levels and some other options.  In this particular case the
1579 zoom levels resize the entire window and not just the video.  
1581 The @b{reset camera} and @b{reset projector} options center the camera
1582 and projector @xref{COMPOSITING}.
1584 The @b{Hide controls} option hides everything except the video.
1586 On the left of the video output is a toolbar specific to the compositor
1587 window.  Here are the functions in the toolbar:
1589 @menu
1590 * PROTECT VIDEO::
1591 * MAGNIFYING GLASS::
1592 * MASKS TOOL::
1593 * CAMERA::
1594 * PROJECTOR::
1595 * CROP TOOL::
1596 * EYEDROPPER::
1597 * TOOL INFO::
1598 * SAFE REGIONS TOOL::
1599 @end menu
1601 @node PROTECT VIDEO
1602 @subsection PROTECT VIDEO
1604 @image{protect}
1606 This disables changes to the compositor output from clicks in it.  It
1607 is an extra layer on top of the track arming toggle to prevent
1608 unwanted changes.
1610 @node MAGNIFYING GLASS
1611 @subsection MAGNIFYING GLASS
1613 @image{magnify}
1615 This zooms in and out of the compositor output without resizing the
1616 window.  If the video output is currently locked to the size of the
1617 window, clicking in it with the magnifying glass unlocks it and
1618 creates scrollbars for navigation.
1620 Left clicking in the video zooms in.
1622 Ctrl clicking in the video zooms out.
1624 Rotating the wheel on a wheel mouse zooms in and out.
1627 @node MASKS TOOL
1628 @subsection MASKS TOOL
1630 @image{mask}
1632 This brings up the mask editing tool @xref{MASKS}.  Enable the
1633 @image{toolwindow} tool window to see options for this tool.
1635 @node CAMERA
1636 @subsection CAMERA
1639 @image{camera}
1641 This brings up the camera editing tool @xref{THE CAMERA AND
1642 PROJECTOR}.  Enable the @image{toolwindow} tool window to see options
1643 for this tool.
1645 @node PROJECTOR
1646 @subsection PROJECTOR
1648 @image{projector}
1650 This brings up the projector editing tool @xref{THE CAMERA AND
1651 PROJECTOR}.  Enable the @image{toolwindow} tool window to see options
1652 for this tool.
1654 @node CROP TOOL
1655 @subsection CROP TOOL
1657 @image{crop}
1659 This brings up the cropping tool @xref{CROPPING}.  The
1660 @image{toolwindow} tool window must be enabled to use this tool.
1662 @node EYEDROPPER
1663 @subsection EYEDROPPER
1665 @image{eyedrop}
1667 This brings up the eyedropper.  The eyedropper detects whatever color
1668 is under it and stores it in a temporary area.  Enabling the
1669 @image{toolwindow} tool info shows the currently selected color.  Click
1670 anywhere in the video output to select the color at that point.
1672 The eyedropper not only lets you see areas which are clipped, but its
1673 value can be applied to many effects.  Different effects handle the
1674 eyedropper differently.
1677 @node TOOL INFO
1678 @subsection TOOL INFO
1680 @image{toolwindow}
1682 This brings up a window containing options for the currently selected
1683 tool.
1686 @node SAFE REGIONS TOOL
1687 @subsection SAFE REGIONS TOOL
1689 @image{titlesafe}
1691 This draws the safe regions in the video output.  This doesn't affect
1692 the rendered output @xref{SAFE REGIONS}.
1704 @node PROGRAM
1705 @section PROGRAM
1708 This contains the timeline and the entry point for all menu driven
1709 operations.  The timeline consists of a vertical stack of tracks with
1710 horizontal representation of time.  This defines the output of
1711 rendering operations and what is saved when you save files.  Left of
1712 the timeline is the patchbay which contains options affecting each
1713 track.
1715 Under the @b{Window} menu you'll find options affecting the main
1716 windows.  @b{default positions} repositions all the windows to a 4
1717 screen editing configuration.  On dual headed displays, the
1718 @b{default positions} operation fills only one monitor with windows.
1721 @node RESOURCES
1722 @section RESOURCES
1725 Effects, transitions, clips, and assets are accessed here.  Most of the
1726 resources are inserted into the project by dragging them out of the
1727 resource window.  Management of resource allocation is also performed
1728 here.
1730 @node SOUND LEVEL METERS
1731 @section SOUND LEVEL METERS
1733 An additional window, the @b{levels window} can be brought up from
1734 the @b{Window} menu.  The @b{levels} window displays the output
1735 audio levels after all mixing is done.
1737 Sound level meters appear in many locations.  They can be toggled in
1738 the viewer and compositor windows with the @image{show_meters} level
1739 toggle. They appear in the patchbay when a track is expanded (@xref{THE
1740 PATCHBAY}.)  They appear in the recording monitor when audio is being
1741 recorded.  
1743 The sound levels in the @b{levels window, compositor, and viewer}
1744 correspond to the final output levels before they are clipped to the
1745 soundcard range.  In the @b{record monitor} they are the input values
1746 from the sound card.  In the @b{patchbay} they are the sound levels for
1747 each track after all effects are processed and before downmixing for
1748 the output.
1750 Most of the time, audio levels have numerical markings in DB but in the
1751 patchbay there isn't enough room.
1753 The sound level is color coded as an extra means of determining the
1754 sound level.  Even without numerical markings, the sound level color
1755 can distinguish between several ranges and overload.  Look at the color
1756 codings in a meter with numerical markings to see what colors
1757 correspond to what sound level.  Then for meters in the patchbay in
1758 expanded audio tracks, use the color codings to see if it's overloading.
1760 Be aware that sound levels in Cinelerra can go above 0DB.  This allows
1761 not only seeing if a track is overloading but how much information is
1762 being lost by the overloading.  Overloading by less than 3DB is usually
1763 acceptable.  While overloading is treated as positive numbers in
1764 Cinelerra, it is clipped to 0 when sent to a sound card or file.
1766 The visible range of the sound level meters is configurable in
1767 @b{settings->preferences->interface} (@xref{INTERFACE}.)
1769 @node OTHER WINDOWS
1770 @section OTHER WINDOWS
1772 The @b{Overlays window} can be brought up from the @b{Window}
1773 menu.  This is a quick way to toggle what is drawn in the timeline. 
1774 Every option in the @b{View} menu is available here.
1782 @node LOADING AND SAVING FILES
1783 @chapter LOADING AND SAVING FILES
1786 @menu
1787 * SUPPORTED FILE FORMATS::     What formats Cinelerra can import and export
1788 * LOADING FILES::              Loading all types of files
1789 * LOADING THE BACKUP::         Recovering the session from before a crash
1790 * SAVING FILES::               Saving edit decision lists
1791 * RENDERING FILES::            Saving media files
1792 @end menu
1803 @node SUPPORTED FILE FORMATS
1804 @section SUPPORTED FILE FORMATS
1806 Here are most of the supported file formats and notes regarding their
1807 compression.  You may be able to load other formats not described here.
1809 The format of the file affects what Cinelerra does with it.  Edit
1810 decision lists replace the project settings.  Formats which contain
1811 media but no edit decisions just add data to the tracks.  If your
1812 project sample rate is 48khz and you load a sound file with 96khz,
1813 you'll still be playing it at 48khz.   If you load an EDL file at 96khz
1814 and the current project sample rate is 48khz, you'll change it to
1815 96khz.
1817 Some file formats are very slow to display on the timeline.  These
1818 usually have video which is highly compressed.  Drawing highly
1819 compressed video picons can be very slow.  Disable picon drawing for
1820 these files with the @b{draw media} toggle to speed up operations.
1823 @sp 1
1824 @image{track_attributes}
1825 @b{Track attributes}
1827 Supported file formats are currently:
1829 @itemize
1830 @item
1832 @item
1834 @item
1835 AIFF
1836 @item
1837 AC3 audio
1838 @end itemize
1840 @menu
1841 * QUICKTIME::
1842 * MPEG-4 AUDIO::
1843 * IMAGE SEQUENCES::
1844 * STILL IMAGES::
1845 * AVI::
1846 * MPEG FILES CONTAINING VIDEO::
1847 * DVD MOVIES::
1848 * MPEG 1 AUDIO::
1849 * OGG THEORA/VORBIS::
1850 * EDIT DECISION LIST::
1851 @end menu
1854 @node QUICKTIME
1855 @subsection QUICKTIME
1856 Quicktime is not the standard for UNIX but we use it because it's well
1857 documented.  All of the Quicktime movies on the internet are
1858 compressed.  Cinelerra doesn't support most compressed Quicktime movies
1859 but does support some.  If it crashes when loading a Quicktime movie,
1860 that means the format probably wasn't supported.
1862 @b{NOTES ON QUICKTIME ENCODING}
1864 Here are some notes regarding making Quicktime movies in Cinelerra:
1866 Quicktime is a wrapper for 2 codecs, a video codec and an audio codec. 
1867 The video and audio codecs are picked separately.  The preferred
1868 encoding for Quicktime output is MPEG-4 Video and MPEG-4 Audio.  This
1869 format plays in the commercial players for Windows and has good
1870 compression quality.  For better compression, use H-264 Video. 
1871 Unfortunately H-264 decoding is so slow it can't play very large frame
1872 sizes.
1874 Cinelerra supports 2 nonstandard codecs: Dual MPEG-4 video and dual
1875 H.264 video.  These won't play in anything but Cinelerra and XMovie. 
1876 They are designed for movies where the frames have been divided into 2
1877 fields, each field displayed sequentially.  The dual codecs interleave
1878 2 video streams to improve efficiency without requiring major changes
1879 to the player.
1881 @node MPEG-4 AUDIO
1882 @subsection MPEG-4 AUDIO
1884 This is the same as Quicktime with MPEG-4 Audio as the audio codec.
1886 @node IMAGE SEQUENCES
1887 @subsection IMAGE SEQUENCES
1890 Rendering an image sequence is not the same as rendering a single
1891 image.  When rendering an image sequence Cinelerra generates a table of
1892 contents file for the image sequence and makes a different image file
1893 for every timeline position.  The table of contents can be loaded
1894 instead of the individual images to get better performance.  To learn
1895 more about the different image formats supported in an image sequence,
1896 read about still images.
1899 @node STILL IMAGES
1900 @subsection STILL IMAGES
1903 Rendering a single image causes the image file to be overwritten for
1904 every timeline position.  No table of contents is created.  When
1905 loaded, the image takes up one frame in length and doesn't change the
1906 project attributes.
1908 Several still image formats not normally found in other programs are
1909 described here.
1911 @menu
1912 * OPEN EXR IMAGES::
1913 * RAW DIGITAL CAMERA IMAGES::
1914 @end menu
1916 @node OPEN EXR IMAGES
1917 @subsubsection OPEN EXR IMAGES
1919 You may not know about Open EXR.  This format stores floating point RGB
1920 images.  It also supports a small amount of compression.  Projects
1921 which render to EXR should be in a floating point color model to take
1922 advantage of it @xref{SETTING PROJECT ATTRIBUTES}.  Several compression
1923 options are available for EXR.
1925 @itemize
1927 @item
1929 @b{PIZ} Lossless wavelet compression.  This is the best compression.
1931 @item
1932 @b{ZIP} Lossless gzip algorithm.
1934 @item
1935 @b{RLE} Lossless run length encoding.  This is the fastest and worst
1936 compression.
1938 @item
1939 @b{PXR24} Lossy compression where the floating point numbers are
1940 converted to 24 bits and compressed with gzip.
1942 @end itemize
1944 Select @b{Use Alpha} if the project colormodel has an alpha channel and
1945 you want to retain it in the file.  Otherwise the primary colors are
1946 multiplied by the alpha channel.
1948 @node RAW DIGITAL CAMERA IMAGES
1949 @subsubsection RAW DIGITAL CAMERA IMAGES
1951 RAW digital camera images are a special kind of image file which
1952 Cinelerra only imports.  These must be processed in a floating point
1953 color space once they are on the timeline.  Raw images from Canon
1954 cameras are the only ones tested.  They need to have the @b{Linearize}
1955 effect applied to correct gamma.  Because raw images take a long time
1956 to interpolate, they are usually viewed first in a proxy file and then
1957 touched up.
1959 First apply the Linearize effect to a track of raw images and set it to
1960 @b{automatic} with @b{0.6} gamma.  Then render the timeline to a
1961 Quicktime JPEG file.  Append the Quicktime JPEG file in a new track and
1962 disable playback of the old track.  Now the gamma corrected copy of
1963 each raw image can be previewed relatively fast in the same timeline
1964 position as the original image.
1968 @node AVI
1969 @subsection AVI
1971 AVI with assorted audio and video codecs.  Because AVI is so
1972 fragmented, your luck will vary.
1975 @node MPEG FILES CONTAINING VIDEO
1976 @subsection MPEG FILES CONTAINING VIDEO
1979 MPEG files containing video can be loaded directly into Cinelerra.  If
1980 the file is supported, a table of contents is built.  If the file is
1981 unsupported, it usually crashes or shows very short tracks. 
1982 Unfortunately, this method of loading MPEG files isn't good enough if
1983 you intend to use the files in a renderfarm.  
1985 To use MPEG files in a renderfarm you need to run @b{mpeg3toc} to
1986 generate a table of contents for the file, then load the table of
1987 contents.  Mpeg3toc needs the absolute path of the MPEG file.  If you
1988 don't use an absolute path, it assumes the MPEG file is in the same
1989 directory that Cinelerra is run from.
1991 MPEG streams are structured into multiple tracks.  Each track can be
1992 video or audio.  Each audio track can have 1-6 channels.  Cinelerra
1993 converts each channel of audio into a track.
1995 @b{NOTES ON MPEG VIDEO ENCODING}
1997 MPEG video encoding is done separately from MPEG audio encoding.  In
1998 MPEG video there are 2 colormodels.  The YUV 4:2:0 colormodel is
1999 encoded by a highly optimized version of mpeg2enc with presets for
2000 standard consumer electronics.  In the process of optimizing mpeg2enc,
2001 they got rid of YUV 4:2:2 encoding.  The YUV 4:2:2 colormodel is
2002 encoded by a less optimized version of mpeg2enc.
2004 YUV 4:2:2 encoding was kept around because the NTSC version of DV video
2005 loses too much quality when transferred to YUV 4:2:0.  This DV video
2006 must be transferred to YUV 4:2:2.
2008 When encoding YUV 4:2:0, the bitrate parameter changes meaning
2009 depending on whether the bitrate or quantization is fixed.  If the
2010 bitrate is fixed, it's the target bitrate.  If the quantization is
2011 fixed, it's the maximum bitrate allowed.  This is a quirk of the
2012 mpeg2enc version.
2014 @node DVD MOVIES
2015 @subsection DVD MOVIES
2018 DVD's are spit into a number of programs, each identified by a unique
2019 @b{IFO} file.  If you want to load a DVD, find the corresponding
2020 @b{IFO} file for the program of interest.  Load the IFO file directly
2021 and a table of contents will be built.  Alternatively for renderfarm
2022 usage, a table of contents can be created separately.
2026 @example
2027 mpeg3toc -v /cdrom/video_ts/vts_01_0.ifo dvd.toc
2028 @end example
2030 or something similar.  Then load @b{dvd.toc}.
2034 @node MPEG 1 AUDIO
2035 @subsection MPEG 1 AUDIO
2037 These are .mp2 and .mp3 files.  If fixed bitrate, they can be loaded
2038 directly with no table of contents.  Variable bitrate streams need to
2039 have a table of contents created with @b{mpeg3toc}.
2041 @node OGG THEORA/VORBIS
2042 @subsection OGG THEORA/VORBIS
2045 The OGG format is an antiquated but supposedly unpatented way of
2046 compressing audio and video.  The quality isn't as good as H.264 or
2047 MPEG-4 Audio.  In reality, anyone with enough money and desire can find
2048 a patent violation so the justification for OGG is questionable.
2050 @node EDIT DECISION LIST
2051 @subsection EDIT DECISION LIST
2054 Edit decision lists are generated by Cinelerra for storing projects. 
2055 They end in .xml.  They change project attributes when loaded.
2057 Because edit decision lists consist of text, they can be edited in a
2058 text editor.
2077 @node LOADING FILES
2078 @section LOADING FILES
2080 All data that you work with in Cinelerra is acquired either by
2081 @b{recording from a device} or by @b{loading from disk}.  This
2082 section describes loading.
2084 The loading and playing of files is just as you would expect. Just go
2085 to @b{file->Load}, select a file for loading, and hit @b{ok}. Hit
2086 the forward play button and it should start playing, regardless of
2087 whether a progress bar has popped up.
2089 Another way to load files is to pass the filenames as arguments on the
2090 command line.  This creates new tracks for every file and starts the
2091 program with all the arguments loaded.
2093 If the file is a still image, the project's attributes are not changed
2094 and the first frame of the track becomes the image.  If the file has
2095 audio, Cinelerra may build an index file for it to speed up drawing. 
2096 You can edit and play the file while the index file is being built.
2098 @menu
2099 * INSERTION STRATEGY::
2100 * LOADING MULTIPLE FILES::
2101 @end menu
2113 @node INSERTION STRATEGY
2114 @subsection INSERTION STRATEGY
2116 Usually three things happen when you load a file.  First the existing
2117 project is cleared from the screen, second the project's attributes are
2118 changed to match the file's, and finally the new file's tracks are
2119 created in the timeline.
2121 But Cinelerra lets you change what happens when you load a file.
2123 In the file selection box go to the @b{Insertion strategy} box and
2124 select it.  Each of these options loads the file a different way.
2126 @itemize
2129 @item
2130 Replace current project
2132 All tracks in the current project are deleted and new tracks are
2133 created to match the source.  Project attributes are only changed when
2134 loading XML.  If multiple files are selected it adds new tracks for
2135 every file.
2137 @item
2138 Replace current project and concatenate tracks
2140 Same as replace current project except if multiple files are selected
2141 it concatenates the tracks of every file after the first.
2143 @item
2144 Append in new tracks
2146 The current project is not deleted and new tracks are created for the
2147 source.
2149 @item
2150 Concatenate to existing tracks
2152 The current project is not deleted and new files are concatenated to
2153 the existing tracks.
2155 @item
2156 Paste at insertion point
2158 The file is pasted in like a normal paste operation.
2160 @item
2161 Create new resources only
2163 The timeline is unchanged and new resources are created in the Resource
2164 Window.
2166 @end itemize
2169 The insertion strategy is a recurring option in many of Cinelerra's
2170 functions.  In each place the options do the same thing.  With these
2171 options you can almost do all your editing by loading files.
2173 If you load files by passing command line arguments to Cinelerra, the
2174 files are loaded with @b{Replace current project} rules.
2180 @node LOADING MULTIPLE FILES
2181 @subsection LOADING MULTIPLE FILES
2183 In the file selection box go to the list of files.  Select a file.  Go
2184 to another file and select it while holding down @b{CTRL}.  This
2185 selects one additional file.  Go to another file and select it while
2186 holding down @b{SHIFT}.  This selects every intervening file.  This
2187 behavior is available in most every list box.
2189 Select a bunch of mp3 files and @b{Replace current project and
2190 concatenate tracks} in the insertion strategy to create a song
2191 playlist.
2196 @node LOADING THE BACKUP
2197 @section LOADING THE BACKUP
2199 There is one special XML file on disk at all times.  After every
2200 editing operation Cinelerra saves the current project to a backup in
2201 @b{$HOME/.bcast/backup.xml}.  In the event of a crash go to
2202 @b{file->load backup} to load the backup.  It is important after a
2203 crash to reboot Cinelerra without performing any editing operations. 
2204 Loading the backup should be the first operation or you'll overwrite
2205 the backup.
2208 @node SAVING FILES
2209 @section SAVING FILES
2211 When Cinelerra saves a file it saves an edit decision list of the
2212 current project but doesn't save any media.  Go to @b{File->save
2213 as...}.  Select a file to overwrite or enter a new file.  Cinelerra
2214 automatically concatenates @b{.xml} to the filename if no
2215 @b{.xml} extension is given.
2217 The saved file contains all the project settings and locations of every
2218 edit but instead of media it contains pointers to the original media
2219 files on disk.
2221 For each media file the XML file stores either an absolute path or just
2222 the relative path.  If the media is in the same directory as the XML
2223 file a relative path is saved.  If it's in a different directory an
2224 absolute path is saved.
2226 In order to move XML files around without breaking the media linkages
2227 you either need to keep the media in the same directory as XML file
2228 forever or save the XML file in a different directory than the media
2229 and not move the media ever again.
2231 If you want to create an audio playlist and burn it on CD-ROM, save the
2232 XML file in the same directory as the audio files and burn the entire
2233 directory.  This keeps the media paths relative.
2235 XML files are useful for saving the current state before going to sleep
2236 and saving audio playlists but they're limited in that they're specific
2237 to Cinelerra.  You can't play XML files in a dedicated movie player. 
2238 Realtime effects in an XML file have to be resynthesized every time you
2239 play it back.  The XML file also requires you to maintain copies of all
2240 the source assets on hard drives, which can take up space and cost a
2241 lot of electricity to spin.  For a more persistent storage of the
2242 output there's rendering.
2249 @node RENDERING FILES
2250 @section RENDERING FILES
2252 Rendering takes a section of the timeline, performs all the editing,
2253 effects and compositing, and stores it in a pure movie file.  You can
2254 then delete all the source assets, play the rendered file in a movie
2255 player, or bring it back into Cinelerra for more editing.  It's very
2256 difficult to retouch any editing decisions in the pure movie file,
2257 however, so keep the original assets and XML file around several days
2258 after you render it.
2260 All rendering operations are based on a region of the timeline to be
2261 rendered.  You need to define this region on the timeline.  The
2262 navigation section describes methods of defining regions. 
2263 @xref{NAVIGATING THE PROJECT}.  The rendering functions define the
2264 region based on a set of rules.  When a region is highlighted or in/out
2265 points are set, the affected region is rendered.  When no region is
2266 highlighted, everything after the insertion point is rendered.  Merely
2267 by positioning the insertion point at the beginning of a track and
2268 unsetting all in/out points, the entire track is rendered.
2272 @menu
2273 * SINGLE FILE RENDERING::      Rendering a single file
2274 * BATCH RENDERING::            Rendering several files unattended
2275 * THE RENDER FARM::            Rendering using many computers
2276 * COMMAND LINE RENDERING::     Rendering from the command line without a GUI
2277 @end menu
2281 @node SINGLE FILE RENDERING
2282 @subsection SINGLE FILE RENDERING
2284 The fastest way to get media to disk is to use the single file
2285 rendering function.
2287 Go to @b{File->render} to bring up the render dialog.  Select the
2288 magnifying glass @image{magnify} to bring up a file selection dialog.  This determines
2289 the filename to write the rendered file to and the encoding parameters.
2291 In the render dialog select a format from the @b{File Format} menu. 
2292 The format of the file determines whether you can render audio or video
2293 or both.  Select the @b{Render audio tracks} toggle to generate
2294 audio tracks and @b{Render video tracks} to generate video tracks.
2297 Select the wrench @image{wrench} next to each toggle to set compression
2298 parameters.  If the file format can't store audio or video the
2299 compression parameters will be blank.  If @b{Render audio tracks} or
2300 @b{Render video tracks} is selected and the file format doesn't
2301 support it, trying to render will pop up an error.
2303 The @b{Create new file at each label} option causes a new file to be
2304 created when every label in the timeline is encountered.  This is
2305 useful for dividing long audio recordings into individual tracks.  When
2306 using the renderfarm, @b{Create new file at each label} causes one
2307 renderfarm job to be created at every label instead of using the
2308 internal load balancing algorithm to space jobs.
2310 When @b{Create new file at each label} is selected, a new filename
2311 is created for every output file.  If the filename given in the render
2312 dialog has a 2 digit number in it, the 2 digit number is overwritten
2313 with a different incremental number for every output file.  If no 2
2314 digit number is given, Cinelerra automatically concatenates a number to
2315 the end of the given filename for every output file.
2317 In the filename @b{/hmov/track01.wav} the @b{01} would be
2318 overwritten for every output file.  The filename
2319 @b{/hmov/track.wav}; however, would become @b{/hmov/track.wav001}
2320 and so on and so forth.  Filename regeneration is only used when either
2321 renderfarm mode is active or creating new files for every label is
2322 active.
2324 Finally the render dialog lets you select an insertion mode.  The
2325 insertion modes are the same as with loading files.  In this case if
2326 you select @b{insert nothing} the file will be written out to disk
2327 without changing the current project.  For other insertion strategies
2328 be sure to prepare the timeline to have the output inserted at the
2329 right position before the rendering operation is finished. 
2330 @xref{EDITING}.  Editing describes how to cause output to be inserted
2331 at the right position.
2333 It should be noted that even if you only have audio or only have video
2334 rendered, a @b{paste} insertion strategy will behave like a normal
2335 paste operation, erasing any selected region of the timeline and
2336 pasting just the data that was rendered.  If you render only audio and
2337 have some video tracks armed, the video tracks will get truncated while
2338 the audio output is pasted into the audio tracks.
2342 @node BATCH RENDERING
2343 @subsection BATCH RENDERING
2347 If you want to render many projects to media files without having to
2348 repeatedly attend to the @b{Render} dialog, @b{batch rendering} is the
2349 function to use.  In this function, you specify many EDL files to
2350 render and the unique output files for each.  Then Cinelerra loads each
2351 EDL file and renders it automatically, without any user intervention. 
2352 Each EDL file and its output to be rendered is called a @b{batch}. 
2353 This allows a huge amount of media to be processed and greatly
2354 increases the value of an expensive computer.
2356 The first thing to do when preparing to do batch rendering is define
2357 projects to be rendered.  The batch renderer requires a separate EDL
2358 file for every batch to be rendered.  Set up a project and define the
2359 region to be rendered either by highlighting it, setting in/out points
2360 around it, or positioning the insertion point before it.  Then save the
2361 project as an EDL.  Define as many projects as needed this way.  The
2362 batch renderer takes the active region from the EDL file for rendering.
2364 With all the EDL files prepared with active regions, go to
2365 @b{File->batch render}.  This brings up the batch rendering dialog. 
2366 The interface for batch rendering is a bit more complex than for single
2367 file rendering.
2370 A list of batches must be defined before starting a batch rendering
2371 operation.  The table of batches appears on the bottom of the batch
2372 render dialog and is called @b{batches to render}.  Above this are
2373 the configuration parameters for a single batch.
2375 Set the @b{output path}, @b{file format}, @b{Audio}, @b{Video}, and
2376 @b{Create new file at each label} parameters as if it was a single
2377 file.  These parameters apply to only one batch.  In addition to the
2378 standard rendering parameters, you must select the source EDL to use in
2379 the batch.  Do this by setting the @b{EDL path}.
2381 If the @b{batches to render} list is empty or nothing is highlighted,
2382 click @b{New} to create a new batch.  The new batch will contain all
2383 the parameters you just set.
2385 Repeatedly press the @b{New} button to create more batches with the
2386 same parameters.  Highlight any batch and edit the configuration on the
2387 top of the batch render window.  The highlighted batch is always
2388 synchronized to the information displayed.
2390 Click and drag batches to change the order in which they're rendered. 
2391 Hit @b{delete} to permanently remove the highlighted batch.
2393 In the list box is a column which enables or disables the batch.  This
2394 way batches can be skipped without being deleted.  Click on the
2395 @b{Enabled} column in the list box to enable or disable a batch.  If it
2396 is checked, the batch is rendered.  If it is blank, the batch is
2397 skipped.
2399 The other columns in the batch list are informative.
2401 @itemize
2403 @item
2404 @b{Output} The output path of the batch.
2405 @item
2406 @b{EDL} The source EDL of the batch.
2407 @item
2408 @b{Elapsed} The amount of time taken to render the batch if it is finished.
2410 @end itemize
2412 To start rendering from the first enabled batch, hit @b{Start}.
2414 Once rendering, the main window shows the progress of the batch.  Once
2415 the batch finishes, the elapsed column in the batch list is updated and
2416 the next batch is rendered until all the enabled batches are finished.
2417 The currently rendering batch is always highlighted red.
2420 To stop rendering before the batches are finished without closing the
2421 batch render dialog, hit @b{Stop}.
2423 To stop rendering before the batches are finished and close the batch
2424 render dialog, hit @b{Cancel}.
2426 To exit the batch render dialog whether or not anything is being
2427 rendered, hit @b{Cancel}.
2435 @node THE RENDER FARM
2436 @subsection THE RENDER FARM
2438 When bicubic interpolation and HDTV was first done on Cinelerra, the
2439 time needed to produce the simplest output became unbearable even on
2440 the fastest dual 1.7Ghz Xeon of the time.  Renderfarm support even in
2441 the simplest form brings HDTV times back in line with SD while making
2442 SD faster than realtime.
2444 While the renderfarm interface isn't spectacular, it's simple enough to
2445 use inside an editing suite with less than a dozen nodes without going
2446 through the same amount of hassle you would with a several hundred node
2447 farm.  Renderfarm is invoked transparently for all file->render
2448 operations when it is enabled in the preferences.
2450 Cinelerra divides the selected region of the timeline into a certain
2451 number of jobs which are then dispatched to the different nodes
2452 depending on the load balance.  The nodes process the jobs and write
2453 their output to individual files on the filesystem.  The output files
2454 are not concatenated.  It's important for all the nodes to have access
2455 to the same filesystem on the same mount point for assets.
2457 If a node can't access an input asset it'll display error messages to
2458 its console but probably not die.  If it can't access an output asset
2459 it'll cause the rendering to abort.
2461 It should be noted that in the render dialog, the @b{Create new file at
2462 each label} option causes a new renderfarm job to be created at each
2463 label instead of by the load balancer.  If this option is selected when
2464 no labels exist, only one job will be created.
2466 A Cinelerra renderfarm is organized into a master node and any number
2467 of slave nodes.  The master node is the computer which is running the
2468 GUI.  The slave nodes are anywhere else on the network and are run from
2469 the command line.  Run a slave node from the command line with 
2471 @b{cinelerra -d}
2473 That is the simplest configuration.  Type @b{cinelerra -h} to see more
2474 options.  The default port number may be overridden by passing a port
2475 number after the -d.
2478 Most of the time you'll want to bring in the rendered output and fine
2479 tune the timing on the timeline.  Also some file formats like MPEG
2480 can't be direct copied.  Because of this, the jobs are left in
2481 individual files.
2483 You can load these by creating a new track and specifying
2484 @b{concatenate to existing tracks} in the load dialog.  Files which
2485 support direct copy can be concatenated into a single file by rendering
2486 to the same file format with renderfarm disabled.  Also to get direct
2487 copy, the track dimensions, output dimensions, and asset dimensions
2488 must be equal.
2490 MPEG files or files which don't support direct copy have to be
2491 concatenated with a command line utility.  MPEG files can be
2492 concatenated with @b{cat}.
2494 Configuration of the renderfarm is described in the configuration
2495 chapter @xref{RENDERFARM}.  The slave nodes traditionally read and
2496 write data to a common filesystem over a network, thus they don't need
2497 hard drives.
2499 Ideally all the nodes on the renderfarm have similar CPU performance. 
2500 Cinelerra load balances on a first come first serve basis.  If the last
2501 segment is dispatched to the slowest node, all the fastest nodes may
2502 end up waiting for the slowest node to finish while they themselves
2503 could have rendered it faster.
2509 @node COMMAND LINE RENDERING
2510 @subsection COMMAND LINE RENDERING
2512 The command line rendering facility consists of a way to load the
2513 current set of batch rendering jobs and process them without a GUI. 
2514 This is useful if you're planning on crashing X repeatedly or want to
2515 do rendering on the other side of a low bandwidth network.  You might
2516 have access to a supercomputer in India but still be stuck in America,
2517 exhiled you might say.  A command line interface is ideal for this.
2519 To perform rendering from the command line, first run Cinelerra in
2520 graphical mode.  Go to @b{file->batch render}.  Create the batches you
2521 intend to render in the batch window and close the window.  This saves
2522 the batches in a file.  Set up the desired renderfarm attributes in
2523 @b{settings->preferences} and exit Cinelerra.  These settings are used
2524 the next time command line rendering is used.
2526 On the command line run 
2528 @b{cinelerra -r}
2530 to processes the current batch jobs without a GUI.  Setting up all the
2531 parameters for this operation is hard.  That's why the command line
2532 aborts if any output files already exist.
2534 Other parameters exist for specifying alternative files for the
2535 preferences and the batches.  Attempting to use anything but the
2536 defaults is very involved so it hasn't been tested.
2542 @node NAVIGATING THE PROJECT
2543 @chapter NAVIGATING THE PROJECT
2545 The thing you want to do most of the time is get to a certain time and
2546 place in the media.  Internally the media is organized into tracks. 
2547 Each track extends across time.  Navigation involves both getting to a
2548 track and getting to a certain time in the track.
2552 @menu
2553 * NAVIGATING THE PROGRAM WINDOW::
2554 * NAVIGATING THE VIEWER AND COMPOSITOR::
2555 * NAVIGATING THE RESOURCES::
2556 * USING THE TRANSPORT CONTROLS::
2557 * USING BACKGROUND RENDERING::
2558 @end menu
2562 @node NAVIGATING THE PROGRAM WINDOW
2563 @section NAVIGATING THE PROGRAM WINDOW
2565 The program window contains many features for navigation and displays
2566 the timeline as it is structured in memory: tracks stacked vertically
2567 and extending across time horizontall.  The horizontal scroll bar
2568 allows you to scan across time.  The vertical scroll bar allows you to
2569 scan across tracks.
2571 Below the timeline you'll find the zoom panel.  The zoom panel contains
2572 values for @b{sample zoom}, @b{amplitude}, @b{track zoom}, and
2573 @b{curve zoom}.  These values in addition to the scrollbars are the
2574 main tools for positioning the timeline.
2583 @sp 1
2585 @image{zoompanel}
2588 Changing the @b{sample zoom} causes the amount of time visible to
2589 change.  @b{If your mouse has a wheel and it works in X11 go over
2590 the tumblers and use the wheel to zoom in and out.}
2592 The @b{amplitude} only affects audio.  It determines how big the
2593 waveform is if the waveform is drawn.
2595 The @b{track zoom} affects all tracks.  It determines the height of
2596 each track.  If you change the track zoom the amplitude zoom
2597 compensates so  audio waveforms look proportional.
2599 The @b{curve zoom} affects the curves in all the tracks.  It
2600 determines the amplitude and offset of the curves.  The tumbler affects
2601 curve amplitude but the only way to change curve offset is to use the
2602 @b{fit curves} button.  @image{fit_curves,,,,}
2605 In addition to the graphical tools, you'll probably more often use the
2606 keyboard to navigate.  Use @b{PAGE UP} and @b{PAGE DOWN} to
2607 scroll up and down the tracks.
2609 Use the @b{LEFT} and @b{RIGHT} arrows to move across time in
2610 small increments.  You'll often need to scroll beyond the end of the
2611 timeline but scrollbars won't let you do it.  Instead use the
2612 @b{RIGHT} arrow to scroll past the end of timeline.
2614 Use the @b{HOME} and @b{END} keys to instantly go to the
2615 beginning or end of the timeline.  In @b{I-beam} mode, hold down
2616 shift while pressing @b{HOME} or @b{END} to select the region of
2617 the timeline between the insertion point and the key pressed.
2619 Use the @b{UP} and @b{DOWN} arrows to change the sample zoom by a
2620 power of 2.
2622 @b{CTRL-UP} and @b{CTRL-DOWN} cause the amplitude zoom to change.
2624 @b{CTRL-PGUP} and @b{CTRL-PGDOWN} cause the track zoom to change.
2626 @b{ALT-UP} and @b{ALT-DOWN} cause the curve amplitude to change.
2630 @menu
2631 * THE INSERTION POINT::
2632 * THE IN/OUT POINTS::
2633 * USING LABELS IN THE PROGRAM WINDOW::
2634 @end menu
2648 @node THE INSERTION POINT
2649 @subsection THE INSERTION POINT
2651 By default you'll see a flashing insertion point in the program window
2652 the first time you boot it up.  This is where new media is pasted onto
2653 the timeline.  It's also the starting point of all playback
2654 operations.  When rendering, it defines the region of the timeline to
2655 be rendered.
2657 The insertion point is normally moved by clicking inside the timebar. 
2658 Any region of the timebar not obscured by labels and in/out points is a
2659 hotspot for repositioning the insertion point.
2661 @sp 1
2662 @image{main_timebar,,,,}
2663 @b{The main timebar}
2665 The insertion point also can be moved by clicking in the timeline
2666 itself, but not always.  The insertion point has two modes of
2667 operation: 
2669 @itemize
2670 @item
2671 drag and drop mode 
2673 @item
2674 cut and paste mode
2676 @end itemize
2678 The mode of operation is determined by selecting the arrow or the
2679 i-beam in the buttonbar.
2681 @sp 1
2682 @image{editing_mode,,,,}
2683 @b{The editing mode buttons}
2685 If the arrow is highlighted it enables @b{drag and drop} mode.  In
2686 drag and drop mode, clicking in the timeline doesn't reposition the
2687 insertion point.  Instead it selects an entire edit.  Dragging in the
2688 timeline repositions the edit, snapping it to other edit boundaries. 
2689 This is normally useful for reordering audio playlists and moving
2690 effects around.
2692 If the i-beam is highlighted it enables @b{cut and paste mode}.  In
2693 cut and paste mode clicking in the timeline repositions the insertion
2694 point.  Dragging in the timeline highlights a region.  The highlighted
2695 region becomes the playback range during the next playback operation,
2696 the rendered range during the next render operation, and the region
2697 affected by cut and paste operations.
2699 @b{Shift-clicking} in the timeline extends the highlighted region.
2701 @b{Double-clicking} in the timeline selects the entire edit the
2702 cursor is over.
2704 It should be noted that when moving the insertion point and selecting
2705 regions, the positions are either aligned to frames or aligned to
2706 samples.  When editing video you'll want to align to frames.  When
2707 editing audio you'll want to align to samples.  This is set in
2708 @b{settings->align cursor on frames}.
2710 If the highlighted region is the region affected by cut and paste
2711 operations, how do I cut and paste in @b{drag and drop} mode?  In
2712 this case you need to set @b{in/out points} to define an affected region.
2718 @node THE IN/OUT POINTS
2719 @subsection THE IN/OUT POINTS
2721 In both editing modes you can set in/out points.  The in/out points
2722 define the affected region.  In drag and drop mode they are the only
2723 way to define an affected region.  In both cut and paste mode and drag
2724 and drop mode the highlighted area overrides the in/out points.  If a
2725 highlighted area and in/out points are set, the highlighted area is
2726 affected by editing operations and the in/out points are ignored.  If
2727 no region is highlighted, the in/out points are used.
2729 Normally, in/out points do not affect the playback region.  Only if you
2730 hold down CTRL while issuing a playback command do the in/out points
2731 determine the playback region.
2733 To set in/out points go to the timebar and position the insertion point
2734 somewhere.  Hit the @image{in_point_button} @b{in point button}.  Go
2735 to a position after the in point and hit the @image{out_point_button}
2736 @b{out point button}.
2738 @sp 1
2739 @image{inout_points} @b{Timebar with in/out points set}.
2741 Select either the in point or the out point and the insertion point
2742 jumps to that location.  After selecting an in point, if you hit the
2743 @b{in point button} the in point will be deleted.  After selecting
2744 an out point, if you hit the @b{out point button} the out point will
2745 be deleted.
2747 If you select a region somewhere else while in/out points already
2748 exist, the existing points will be repositioned when you hit the in/out
2749 buttons.
2751 @b{Shift-clicking} on an in/out point extends the highlighted region
2752 to that point.
2754 Instead of using the button bar you can use the @b{[} and @b{]}
2755 keys to toggle in/out points.
2757 The insertion point and the in/out points allow you to define an
2758 affected region but they don't let you jump to exact points on the
2759 timeline very easily.  For this purpose there are labels.
2765 @node USING LABELS IN THE PROGRAM WINDOW
2766 @subsection USING LABELS IN THE PROGRAM WINDOW
2768 Labels are an easy way to set exact locations on the timeline you want
2769 to jump to.  When you position the insertion point somewhere and hit
2770 the @image{label_button} @b{label button} a new label appears on the
2771 timeline.  
2773 @sp 1
2774 @image{timebar_label} @b{Timebar with a label on it}
2776 No matter what the zoom settings are, clicking on the label positions
2777 the insertion point exactly where you set it.  Hitting the label button
2778 again when a label is selected deletes it.
2780 @b{Shift-clicking} on a label extends the highlighted region.
2782 @b{Double-clicking} between two labels highlights the region between
2783 the labels.
2785 Hitting the @b{l} key has the same effect as the label button.
2787 If you hit the label button when a region is highlighted, two labels
2788 are toggled at each end of the highlighted region.  If one end already
2789 has a label, then the existing label is deleted and a label is created
2790 at the opposite end.
2792 Labels can reposition the insertion point when they are selected but
2793 they can also be traversed with the @image{label_traversal} @b{label
2794 traversal} buttons.  When a label is out of view, the label traversal
2795 buttons reposition the timeline so the label is visible.  There are
2796 keyboard shortcuts for label traversal, too.
2798 @b{CTRL-LEFT} repositions the insertion point on the previous label.
2800 @b{CTRL-RIGHT} repositions the insertion point on the next label.
2802 With label traversal you can quickly seek back and forth on the
2803 timeline but you can also select regions.
2805 @b{SHIFT-CTRL-LEFT} extends the highlighted region to the previous
2806 label.
2808 @b{SHIFT-CTRL-RIGHT} extends the highlighted region to the next label.
2810 Manually hitting the label button or @b{l} key over and over again
2811 to delete a series of labels can get tedious.  For deleting a set of
2812 labels, first highlight a region and second use the @b{Edit->Clear
2813 labels} function.  If in/out points exist, the labels between the
2814 in/out points are cleared and the highlighted region ignored.
2823 @node NAVIGATING THE VIEWER AND COMPOSITOR
2824 @section NAVIGATING THE VIEWER AND COMPOSITOR
2826 The navigation features of the Viewer and Compositor behave very
2827 similarly.  Each has a timebar and slider below the video output.  The
2828 timebar and slider are critical for navigation.
2830 @sp 1
2832 @image{timebarslider,,,,}
2834 The timebar represents the entire time covered by the program.  When
2835 you define labels and in/out points it defines those, too.  Finally the
2836 timebar defines a region known as the @b{preview region}.
2838 The @b{preview region} is the region of the timeline which the
2839 slider effects.  The slider only covers the time covered by the preview
2840 region.  By using a preview region inside the entire program and using
2841 the slider inside the preview region you can quickly and precisely seek
2842 in the compositor and viewer.
2844 When you replace the current project with a file the preview region
2845 automatically resizes to cover the entire file.  When you append data
2846 or change the size of the current project, the preview region stays the
2847 same size and shrinks.  Therefore, you need to resize the preview
2848 region.
2850 Load a file and then slide around it using the compositor slider.  The
2851 insertion point in the main window follows the compositor.  Move the
2852 pointer over the compositor's timebar until it turns into a left resize
2853 pointer.  The click and drag right.  The preview region should have
2854 changed and the slider resized proportionally.
2856 Go to the right of the timebar until a right resize pointer appears. 
2857 Drag left so the preview region shrinks.
2859 Go to the center of the preview region in the timebar and drag it
2860 around to convince yourself if can be moved.
2863 @sp 1
2865 @image{previewregion,,,,}
2867 @b{Preview region in compositor}
2869 If you go to the slider and slide it around with the preview region
2870 shrunk, you'll see the slider only affects the preview region.  The
2871 timebar and slider in the viewer window work exactly the same.
2873 Labels and in/out points are fully supported in the viewer and
2874 compositor.  The only difference between the viewer and compositor is
2875 the compositor reflects the state of the program while the viewer
2876 reflects the state of a clip but not the program.
2878 When you hit the @b{label button} in the compositor, the label
2879 appears both in the compositor timebar and the program timebar.
2881 When you select a label or in/out point in the compositor, the program
2882 window jumps to that position.
2884 @sp 1
2885 @image{viewer_labels} @b{Labels and in/out points in the viewer}.
2887 In the viewer and compositor, labels and in/out points are displayed in
2888 the timebar.  Instead of displaying just a region of the program, the
2889 timebar displays the entire program here.
2893 Like the Program window, the Compositor has a zoom capability.  First,
2894 the pulldown menu on the bottom of the compositor window has a number
2895 of zoom options.  When set to @b{Auto} the video is zoomed to match
2896 the compositor window size as closely as possible.  When set to any
2897 other percentage, the video is zoomed a power of 2 and scrollbars can
2898 be used to scroll around the output.  When the video is zoomed bigger
2899 than the window size, not only do scrollbars scan around it but
2900 @b{middle mouse button} dragging in the video output scans around
2901 it.  This is exactly when The Gimp does.
2903 Furthermore, the zoom @image{magnify} toggle causes the Compositor
2904 window to enter zoom mode.  In zoom mode, clicking in the video output
2905 zooms in while @b{ctrl-clicking} in the video output zooms out.  If
2906 you have a wheel mouse, rotating the wheel zooms in or out too.
2908 Zooming in or out with the zoom tool does not change the rendered
2909 output, mind you.  It's merely for scrutinizing video or fitting it in
2910 the desktop.
2917 @node NAVIGATING THE RESOURCES
2918 @section NAVIGATING THE RESOURCES
2920 The resource window is divided into two areas.  One area lists folders
2921 and another area lists folder contents.  Going into the folder list and
2922 clicking on a folder updates the contents area with the contents of
2923 that folder.
2925 The folder and contents can be displayed as icons or text.
2927 @b{Right clicking} in the folder or contents area brings up a menu
2928 containing formatting options.  Select @b{Display text} to display a
2929 text listing.  Select @b{Sort items} to sort the contents of the
2930 folder alphabetically.
2939 @node USING THE TRANSPORT CONTROLS
2940 @section USING THE TRANSPORT CONTROLS
2942 Transport controls are just as useful in navigation as they are in
2943 playing back footage, hence they are described here in the navigation
2944 section.  Each of the Viewer, Compositor, and Program windows has a
2945 transport panel.
2947 @sp 1
2948 @image{transport_panel} @b{The transport panel}.
2950 The transport panel is controlled by the keyboard as well as the
2951 graphical interface.  For each of the operations it performs, the
2952 starting position is the position of the insertion point in the Program
2953 window and the slider in the Compositor window.  The ending position is
2954 either the end or start of the timeline or the end or start of the
2955 selected region if there is one.
2957 The orientation of the end or start depends on the direction of
2958 playback.  If it's forward the end position is the end of the selected
2959 region.  If it's backward the end position is the start of the selected
2960 region.
2962 The insertion point moves to track playback.  When playback stops, the
2963 insertion point stays where playback stopped.  Thus, by playing back
2964 you change the position of the insertion point.
2966 The keyboard interface is usually the fastest and has more speeds.  The
2967 transport keys are arranged in a sideways @b{T} on the number pad.
2969 @itemize
2971 @item
2972 @b{+} Fast reverse
2973 @item
2974 @b{6} Normal reverse
2975 @item
2976 @b{5} Slow reverse
2977 @item
2978 @b{4} Frame reverse
2979 @item
2980 @b{1} Frame forward
2981 @item
2982 @b{2} Slow forward
2983 @item
2984 @b{3} Normal forward
2985 @item
2986 @b{Enter} Fast forward
2987 @item
2988 @b{0} Stop
2989 @item
2990 @b{Spacebar} Normal forward
2991 @end itemize
2993 Hitting any key on the keyboard twice pauses it.
2995 When using frame advance functions the behavior may seem odd.  If you
2996 frame advance forward and then frame advance backward, the displayed
2997 frame doesn't change.  This is because the playback position isn't the
2998 frame but the time between two frames.  The rendered frame is the area
2999 that the playback position crosses.  When you increment the time
3000 between two frames by one and decrement it by one, you cross the same
3001 frame both times and so the same frame is displayed.
3003 The transport behavior changes if you hold down CTRL when issuing any
3004 of the transport commands.  This causes the starting point to be the in
3005 point if playing forward and the out point if playing backward.  If
3006 playing forward, the out point becomes the ending point and if playing
3007 backward, the in point becomes the ending point.  If no in/out points
3008 are specified, the behavior falls back to using the insertion point and
3009 track boundaries as the starting and ending points.
3013 @node USING BACKGROUND RENDERING
3014 @section USING BACKGROUND RENDERING
3018 Background rendering allows impossibly slow effects to play back in
3019 realtime shortly after the effect is pasted in the timeline.  It
3020 continuously renders temporary output.  When renderfarm is enabled,
3021 background rendering uses the renderfarm continuously.  This way, any
3022 size video can be seen in realtime merely by creating a fast enough
3023 network with enough nodes.
3025 Background rendering is enabled in settings->preferences->performance. 
3026 It has one interactive function: @b{settings->set background render}.  This
3027 sets the point where background rendering begins to where the in point
3028 is.  If any video exists, a red bar appears in the time bar showing
3029 what has been background rendered.
3031 It's often useful to insert an effect or a transition and then select
3032 settings->set background render right before the effect to preview it
3033 in full framerates.
3037 @node EDITING
3038 @chapter EDITING
3041 Editing comprises both the time domain and the track domain.  Since the
3042 timeline consists of a stack of tracks, you need to worry about how to
3043 sort and create tracks in addition to what time certain media appears
3044 on a track.
3046 In the time domain, Cinelerra offers many ways to approach the editing
3047 process.  The three main methods are two screen editing, drag and drop
3048 editing, and cut and paste editing.
3050 There are several concepts Cinelerra uses when editing which apply to
3051 all the methods.  The @b{timeline} is where all editing decisions are
3052 represented.  This is a stack of tracks in the center of the main
3053 window.  It can be scrolled up, down, left and right with the
3054 scrollbars on the right and bottom of it.  It can also be scrolled up
3055 and down with a mouse wheel.
3057 The @b{active region} is the range of time which is affected by editing
3058 commands on the timeline.  The active region is determined first by the
3059 presence of in/out points in the timeline.  If those don't exist the
3060 highlighted region is used.  If no highlighted region exists the
3061 insertion point is used as the start of the active region.  Some
3062 commands treat all the space to the right of the insertion point as
3063 active, like @b{Render}, while others treat the active length as 0 if no
3064 end point for the active region is defined.
3066 Finally, editing decisions never affect source material.  This is
3067 @b{non destructive editing} and it became popular with audio because it
3068 was much faster than if you had to copy all the media affected by an
3069 edit.  Editing only affects pointers to source material, so if you want
3070 to have a media file at the end of your editing session which
3071 represents the editing decisions, you need to @b{render} it.
3072 @xref{RENDERING FILES}.
3074 Every track on the timeline has a set of attributes on
3075 the left, the most important of which is the @b{arm track}
3076 attribute.
3080 @menu
3081 * THE PATCHBAY::           Enabling different features on different tracks
3082 * NUDGING TRACKS::         Move entire tracks horizontally
3083 * PANNING TRACKS::         Changing the audio output channels
3084 * AUTOMATIC TRACK PANNING::  Panning tracks to common speaker arrangements
3085 * STANDARD AUDIO MAPPINGS::  Making audio panning that works on other players.
3086 * MANIPULATING TRACKS::    Moving whole tracks around
3087 * TWO SCREEN EDITING::     Using two video windows to edit
3088 * DRAG AND DROP EDITING::  Dragging objects to edit
3089 * CUT AND PASTE EDITING::  Editing media like text
3090 * TRIMMING::               Changing in and out points
3091 @end menu
3094 @node THE PATCHBAY
3095 @section THE PATCHBAY
3098 On the left of the timeline is a region affectionately known as the
3099 patchbay.  The patchbay enables features specific to each track.  All
3100 tracks have a text area for naming the track.
3102 All tracks have an @b{expander} @image{expandpatch_checked} for viewing
3103 more options and for viewing the effects on the track.  Click on the
3104 expander to expand or collapse the track.  If it's pointing sideways,
3105 the track is collapsed.  If it's pointing down, the track is expanded. 
3106 The effects appear below the media for the track if they exist.
3108 All tracks have the following row of toggles for several features.
3110 @sp 1
3111 @image{track_attributes}
3112 @b{Track attributes}
3115 If the toggle is colored, it is enabled.  If the toggle is the
3116 background color of most of the windows, it is disabled.  Click on the
3117 toggle to enable or disable the feature.  Several mouse operations
3118 speed up the configuration of several tracks at a time.
3120 Click on an attribute and drag across adjacent tracks to copy the same
3121 attribute to those tracks.
3123 Hold down @b{shift} while clicking a track's attribute to enable the
3124 attribute in the current track and toggle the attribute in all the
3125 other tracks.
3127 Hold down @b{shift} while clicking an attribute.  Click until all the
3128 tracks except the selected one are disabled.  Then drag the cursor over
3129 the adjacent track to enable the attribute in the adjacent track.
3132 The other attributes affect the output of the track.
3134 @itemize
3136 @item
3138 @b{Play track} determines whether the track is rendered or not.  If
3139 it's off, the track is not rendered.  However, if the track is chained
3140 to any other tracks, the other tracks perform all the effects in the
3141 chained track, regardless of play status.
3142 @sp 1
3144 @item
3146 @b{Arm track} determines whether the track is armed or not.   Only the
3147 @b{armed tracks} are affected by editing operations.  Make sure you
3148 have enough armed destination tracks when you paste or splice material
3149 or some tracks in the material will get left out.
3151 In addition to restricting editing operations, the armed tracks in
3152 combination with the active region determine where material is inserted
3153 when loading files.  If the files are loaded with one of the insertion
3154 strategies which doesn't delete the existing project, the armed tracks
3155 will be used as destination tracks.
3157 Press @b{Tab} while the cursor is anywhere over a track to toggle the
3158 track arming status.
3160 Press @b{Shift-Tab} while the cursor is over a track to toggle the
3161 arming status of every other track.
3163 @item
3165 @b{Gang fader} causes the fader to track the movement of whatever other
3166 fader you're adjusting.  A fader is only ganged if the @b{arm track} is
3167 also on.  This is normally used to adjust audio levels on all the
3168 tracks simultaneously.  Gang also causes @b{Nudge} parameters to
3169 synchronise across all the ganged tracks.
3172 @sp 1
3174 @item
3176 @b{Draw media} determines if picons or waveforms are drawn on the
3177 track.  By default, some file formats load with this off while other
3178 file formats load with it on.  This depends on whether the file format
3179 takes a long time to draw on the timeline.  Merely set it to on if you
3180 want to see picons for any file format.
3181 @sp 1
3183 @item
3185 @b{Mute track} causes the output to be thrown away once the track is
3186 completely rendered.  This happens whether or not @b{play track} is
3187 on.  If the track is part of an effect chain, the output of the effect
3188 chain track is overlayed on the final output even though it's routed
3189 back to another track.  Mute track is used to keep the effect chain
3190 track from overlapping the output of the source track.
3191 @sp 1
3193 @item
3195 @b{Fader} All tracks have a fader, but the units of each fader depend
3196 on whether it's audio or video.  Click and drag the fader to fade the
3197 track in and out.  If it is ganged to other tracks of the same media
3198 type, with the @b{arm} option enabled, the other faders should follow.
3200 Hold down @b{shift} and drag a fader to center it on 0.
3202 @end itemize
3206 @node NUDGING TRACKS
3207 @section NUDGING TRACKS
3209 Each track has a nudge textbox in its patchbay.  You may have to expand
3210 the track to see it.  These are views of the patchbays when expanded.
3212 @image{apatches}
3214 Pan and nudge for an audio track.
3216 @image{vpatches}
3218 Overlay mode and nudge for a video track.
3221 The nudge is the amount the track is shifted left or right during
3222 playback.  The track is not displayed shifted on the timeline, but it
3223 is shifted when it's played back.  This is useful for synchronizing
3224 audio with video, creating fake stereo, or compensating for an effect
3225 which shifts time, all without tampering with any edits.
3227 Merely enter in the amount of time to shift by to instantly shift the
3228 track.  Negative numbers make the track play later.  Positive numbers
3229 make the track play sooner.  The nudge units are either @b{seconds} or
3230 the native units for the track.  Select the units by @b{right clicking}
3231 on the nudge textbox and using the context sensitive menu.
3233 Nudge settings are ganged with the @b{Gang faders} toggle and the
3234 @b{Arm track} toggle.
3236 Use the mouse wheel over the nudge textbox to increment and decriment
3243 @node PANNING TRACKS
3244 @section PANNING TRACKS
3246 Audio tracks have a panning box in their patchbay.  It may have to be
3247 expanded to see it.  The panning box is shown here.
3249 @image{apatches}
3251 Pan and nudge for an audio track.
3253 Position the pointer in the panning box and click/drag to reposition
3254 the audio output among the speaker arrangement.  The loudness of each
3255 speaker is printed during the dragging operation.  The panning box uses
3256 a special algorithm to try to allow audio to be focused through one
3257 speaker or branched between the nearest speakers when more than 2
3258 speakers are used.
3262 @node AUTOMATIC TRACK PANNING
3263 @section AUTOMATIC TRACK PANNING
3266 Several convenience functions are provided for automatically setting
3267 the panning to several common standards.  They are listed in the
3268 @b{Audio} menu.  These functions only affect audio tracks with
3269 @b{recording} enabled.
3271 @b{Audio->Map 1:1} - This maps every track to its own channel and wraps
3272 around when all the channels are allocated.  It's most useful for
3273 making 2 tracks with 2 channels map to stereo and for making 6 tracks
3274 with 6 channels map to a 6 channel soundcard.
3276 @b{Audio->Map 5.1:2} - This maps 6 tracks to 2 channels.  The project
3277 should have 2 channels when using this function.  Go to
3278 @b{Settings->format} to set the output channels to 2.  This is most
3279 useful for downmixing 5.1 audio to stereo.
3285 @node STANDARD AUDIO MAPPINGS
3286 @section STANDARD AUDIO MAPPINGS
3288 Although Cinelerra lets you map any audio track to any speaker, there
3289 are standard mappings you should use to ensure the media can be played
3290 back elsewhere.  Also, most audio encoders require the audio tracks to
3291 be mapped to standard speaker numbers or they won't work.
3293 In the @b{channel position} widget @xref{SETTING PROJECT ATTRIBUTES},
3294 the channels are numbered to correspond to the output tracks they are
3295 rendered to.  For stereo, the source of channel 1 needs to be the left
3296 track and the source of channel 2 needs to be the right track.
3298 For 5.1 surround sound, the sources of the 6 channels need to be in the
3299 order of center, front left, front right, back left, back right, low
3300 frequency effects.  If the right tracks aren't mapped to the right
3301 speakers, most audio encoders won't encode the right information if
3302 they encode anything at all.  The low frequency effects track
3303 specifically can't store high frequencies in most cases.
3309 @node MANIPULATING TRACKS
3310 @section MANIPULATING TRACKS
3312 Tracks in Cinelerra either contain audio or video.  There is no special
3313 designation for tracks other than the type of media they contain.  When
3314 you create a new project, it contains a certain mumber of default
3315 tracks.  You can still add or delete tracks from a number of menus. 
3316 The @b{Tracks} menu contains a number of options for dealing with
3317 multiple tracks simultaneously.  Each track itself has a popup menu
3318 which affects one track.
3320 Bring up the popup menu by moving over a track and right clicking.  The
3321 popup menu affects the track whether it's armed or not.
3323 @b{Move up} and @b{move down} moves the one track up or down in
3324 the stack.  @b{Delete track} deletes the track.
3326 Operations in the @b{Tracks} menu affect only tracks which are
3327 armed.
3329 @b{Move tracks up} and @b{Move tracks down} shift all the armed
3330 tracks up or down the stack.
3332 @b{Delete tracks} deletes the armed tracks.
3334 @b{Delete last track} deletes the last track, whether it's armed or
3335 not.  Holding down the @b{d} key quickly deletes all the tracks.
3337 @b{Concatenate tracks} is more complicated.  It takes every
3338 @b{playable} track and concatenates it to the end of the first
3339 @b{armed tracks}.  If there are two armed tracks followed by two
3340 playable tracks, the concatenate operation puts the two playable tracks
3341 after the two armed tracks.  If there are three playable tracks
3342 instead, two tracks are put after the armed tracks and a third track is
3343 put on the end of the first armed track.  The destination track wraps
3344 around until all the playable tracks are concatenated.
3346 Finally, you'll want to create new tracks.  The @b{Audio} and
3347 @b{Video} menus each contain an option to add a track of their
3348 specific type.  In the case of audio, the new track is put on the
3349 bottom of the timeline and the output channel of the audio track is
3350 incremented by one.  In the case of video, the new track is put on the
3351 top of the timeline.  This way, video has a natural compositing order. 
3352 New video tracks are overlayed on top of old tracks.
3362 @node TWO SCREEN EDITING
3363 @section TWO SCREEN EDITING
3365 This is the fastest way to construct a program out of movie files.  The
3366 idea consists of viewing a movie file in one window and viewing the
3367 program in another window.  Sections of the movie file are defined in
3368 one window and transferred to the end of the program in the other
3369 window.
3371 The way to begin a two screen editing session is to load some
3372 resources.  In @b{file->load} load some movies with the insertion
3373 mode @b{create new resources}.  You want the timeline to stay
3374 unchanged while new resources are brought in.  Go to the Resource
3375 Window and select the @b{media} folder.  The newly loaded resources
3376 should appear.  Drag a resource from the media side of the window over
3377 the Viewer window.
3379 There should be enough armed tracks on the timeline to put the sections
3380 of source material that you want.  If there aren't, create new tracks
3381 or arm more tracks.
3383 In the viewer window seek to the starting point of a clip you want to
3384 use.  Use either the @b{slider} or the @b{transport controls}. 
3385 Use the @b{preview region} to narrow down the search.  Set the
3386 starting point with the @image{in_point_button} @b{in point button}.
3388 Seek to the ending point of the clip you want to use.  Set the ending
3389 point with the @image{out_point_button} @b{out point button}.  The
3390 two points should now appear on the timebar and define a clip.
3392 There are several things you can do with the clip now.
3394 @itemize
3396 @item
3398 Splice @image{splice_button} inserts the clip in the timeline, pushing
3399 everything back.  If an @b{in point} or @b{out point} exists on
3400 the timeline it's inserted there, otherwise it's inserted after the
3401 insertion point.  After that, the insertion point moves to the end of
3402 the clip.  If there is no in/out point, the insertion point will be
3403 used as the next splice location.  This way you can continuously build
3404 up the program by splicing.
3406 @item
3408 Overwrite @image{overwrite_button} overwrites the region of the
3409 timeline with the clip.  If an @b{in point} or @b{out point}
3410 exists on the timeline it's overwritten there, otherwise it's
3411 overwritten after the insertion point.  If a region is highlighted or
3412 both in and out points exist the difference between the active region
3413 and the clip length is deleted.
3417 @item
3419 Create a clip @image{toclip_button} generates a new clip for the
3420 resource window containing the affected region but doesn't change the
3421 timeline.  Every clip has a title and a description.  These are
3422 optional.
3424 @item
3426 Copy behaves the same as in cut and paste editing.
3428 @end itemize
3430 Two screen editing can be done purely by keybard shortcuts.  When you
3431 move the pointer over any button a tooltip should appear, showing what
3432 key is bound to that button.  In the Viewer window, the number pad keys
3433 control the transport and the @b{[ ] v} keys perform in/out points
3434 and splicing.
3446 @node DRAG AND DROP EDITING
3447 @section DRAG AND DROP EDITING
3449 The answer is yes, you can you create a bunch of clips and drag them on
3450 the timeline.  You can also drag edits around the timeline.
3452 Load some files using @b{file->load}.  Set the insertion mode to
3453 @b{Create new resources}.  This loads the files into the Resource
3454 Window.  Create some audio and video tracks on the timeline using the
3455 video and audio menus.
3457 Open the @b{Media} folder in the resource window.  Drag a media file
3458 from the resource window to the timeline.  If the media has video, drag
3459 it onto a video track.  If the media is pure audio, drag it onto an
3460 audio track.
3462 Cinelerra fills out the audio and video tracks below the dragging
3463 cursor with data from the file.  This affects what tracks you should
3464 create initially and which track to drag the media onto.  If the media
3465 has one video track and two audio tracks, you'll need one video track
3466 and two audio tracks on the timeline and the media should be dragged
3467 over the first video track.  If the media has audio only you'll need
3468 one audio track on the timeline for every audio track in the media and
3469 the media should be dragged over the first audio track.
3471 When dragging, the media snaps to the start of track if the track is
3472 empty.  If there are edits on the track, the media snaps to the nearest
3473 edit boundary.
3475 You can also drag multiple files from the resource window.  Either draw
3476 a box around the files, use SHIFT, or use CTRL when selecting files. 
3477 When you drop the files in the timeline, they are concatenated.  The
3478 behavior of SHIFT and CTRL changes depending on if the resources are in
3479 text or icons.
3481 To display the resources as text or icons, right click inside the media
3482 list.  Select either @b{display icons} or @b{display text} to
3483 change the list format.
3485 When displaying text in the resource window @b{SHIFT-clicking} on
3486 media files extends the number of highlighted selections. 
3487 @b{CTRL-clicking} on media files in text mode selects additional
3488 files one at a time.
3490 When displaying icons in the resource window @b{SHIFT-clicking} or
3491 @b{CTRL-clicking} selects media files one at a time.
3493 In addition to dragging media files, if you create clips and open the
3494 @b{clip} folder you can drag clips on the timeline.
3496 In the timeline there is further dragging functionality.  To enable the
3497 dragging functionality of the timeline, select the arrow toggle
3498 @image{arrow}.  Move over an edit and drag it.  If more than one
3499 track is armed, Cinelerra will drag any edits which start on the same
3500 position as the edit the cursur is currently over.  During a dragging
3501 operation the edit snaps to the nearest boundary.
3503 Dragging edits around the timeline allows you to sort music playlists,
3504 sort movie scenes, and give better NAB demos but not much else.
3516 @node CUT AND PASTE EDITING
3517 @section CUT AND PASTE EDITING
3519 This is the traditional method of editing in audio editors.  In the
3520 case of Cinelerra, you either need to start a second copy of Cinelerra
3521 and copy from one copy to the other, copy from different tracks in the
3522 same copy, or load a media file into the Viewer and copy from there.
3524 Load some files onto the timeline.  To perform cut and paste editing
3525 select the @image{ibeam} i-beam toggle.  Select a region of the
3526 timeline and select the @image{cut} cut button to cut it.  Move the
3527 insertion point to another point in the timeline and select the
3528 @image{paste} paste button.  Assuming no in/out points are defined on
3529 the timeline this performs a cut and paste operation.
3531 If in/out points are defined, the insertion point and highlighted
3532 region are overridden by the in/out points for clipboard operations. 
3533 Thus, with in/out points you can perform cut and paste in drag and drop
3534 mode as well as cut and paste mode.
3536 When editing audio, it is customary to cut from one part of a waveform
3537 into the same part of another waveform.  The start and stop points of
3538 the cut are identical in each waveform and might be offset slightly,
3539 while the wave data is different.  It would be very hard to highlight
3540 one waveform to cut it and highlight the second waveform to paste it
3541 without changing the relative start and stop positions.
3543 One option for simplifying this is to open a second copy of Cinelerra,
3544 cutting and pasting to transport media between the two copies.  This
3545 way two highlighed regions can exist simultanously.
3547 Another option is to set in/out points for the source region of the
3548 source waveform and set labels for the destination region of the
3549 destination waveform.  Perform a cut, clear the in/out points, select
3550 the region between the labels, and perform a paste.
3554 A final operation in cut and paste editing is the @b{edit->clear}
3555 operation.  If a region is highlighted or in/out points exist, the
3556 affected region is cleared by @b{edit->clear}.  But if the insertion
3557 point is over an edit boundary and the edits on each side of the edit
3558 boundary are the same resource, the edits are combined into one edit
3559 comprised by the resource.  The start of this one edit is the start of
3560 the first edit and the end of this one edit is the end of the second
3561 edit.  This either results in the edit expanding or shrinking.
3567 @node TRIMMING
3568 @section TRIMMING
3570 With some edits on the timeline it's possible to do trimming.  By
3571 trimming you shrink or grow the edit boundaries by dragging them.  In
3572 either drag and drop mode or cut and paste mode, move the cursor over
3573 an edit boundary until it changes shape.  The cursor will either be an
3574 expand left or an expand right.  If the cursor is an expand left, the
3575 dragging operation affects the beginning of the edit.  If the cursor is
3576 an expand right, the dragging operation affects the end of the edit.
3578 When you click on an edit boundary to start dragging, the mouse button
3579 number determines which dragging behavior is going to be followed.  3
3580 possible behaviors are bound to mouse buttons in the interface
3581 preferences. @xref{INTERFACE}.
3583 The effect of each drag operation not only depends on the behavior
3584 button but whether the beginning or end of the edit is being dragged.
3585 When you release the mouse button, the trimming operation is performed.
3587 In a @b{Drag all following edits} operation, the beginning of the
3588 edit either cuts data from the edit if you move it forward or pastes
3589 new data from before the edit if you move it backward.  The end of the
3590 edit pastes data into the edit if you move it forward or cuts data from
3591 the end of the edit if you move it backward.  All the edits thereafter
3592 shift.  Finally, if you drag the end of the edit past the start of the
3593 edit, the edit is deleted.
3595 In a @b{Drag only one edit} operation, the behavior is the same when
3596 you drag the beginning or end of an edit.  The only difference is none
3597 of the other edits in the track shift.  Instead, anything adjacent to
3598 the current edit expands or shrinks to fill gaps left by the drag
3599 operation.
3601 In a @b{Drag source only} operation, nothing is cut or pasted.  If
3602 you move the beginning or end of the edit forward, the source reference
3603 in the edit shifts forward.  If you move the beginning or end of the
3604 edit backward, the source reference shifts backward.  Where the edit
3605 appears in the timeline remains the same but the source shifts.
3607 For all file formats besides still images, the extent of the trimming
3608 operation is clamped to the source file length.  Attempting to drag the
3609 start of the edit beyond the start of the source clamps it to the
3610 source start.
3612 In all trimming operations, all edits which start on the same position
3613 as the cursor when the drag operation begins are affected.  Unarm
3614 tracks to prevent edits from getting affected.
3623 @node USING EFFECTS
3624 @chapter USING EFFECTS
3626 It would be sufficient to perform all changes to the timeline using
3627 editing operations, but this isn't very extensible.  Certain timeline
3628 changes should produce a different effect in the output without
3629 involving a unique procedure to apply each change.  This is why we have
3630 effects.
3632 Effects fall into three categories, and each effect in a category is
3633 applied using the same procedure.
3636 @menu
3637 * REALTIME EFFECTS::
3638 * RENDERED EFFECTS::
3639 * TRANSITIONS::
3640 * LADSPA EFFECTS::
3641 @end menu
3645 @node REALTIME EFFECTS
3646 @section REALTIME EFFECTS
3648 These are layered under the track they apply to.  They process the
3649 track when the track is played back, with no permanent storage of the
3650 output except when the project is rendered.
3652 All the realtime effects are listed in the resource window, divided
3653 into two groups: audio effects and video effects.  Audio effects should
3654 be dragged from the resource window onto audio tracks.  Video effects
3655 should be dragged onto video tracks.
3657 If there is data on the destination track, the effect is applied to the
3658 entire track.  If there is no data on the track the effect is deleted. 
3659 Finally, if a region of the track is selected the effect is pasted into
3660 the region, regardless of whether there is data.
3662 Some of the effects don't process data but synthesize data.  In the
3663 case of a synthesis effect, you'll want to select a region of the
3664 track so the dragging operation pastes it without deleting it.
3666 When dragging more than one effect onto a track, you'll see the effects
3667 layering from top to bottom, on the bottom of the track.   When the
3668 track is played back, effects are processed from top to bottom.  The
3669 output of the top effect becomes the input of the bottom effect and so
3670 on and so forth.
3672 In addition to dragging from the resource window, effects may be
3673 applied to a track by a popup menu.  Right click on a track and select
3674 @b{Attach effect} from the popup.  The attach effect dialog gives
3675 you more control than pure dragging and dropping.  For one thing, the
3676 attach effect dialog lets you attach two more types of effects: shared
3677 effects and shared tracks.  Select a plugin from the @b{Plugins}
3678 column and hit @b{Attach} under the plugins column to attach it. 
3679 The effect is the same as if the effect was dragged from the resource
3680 window.
3682 When an effect exists under a track, it most often needs to be
3683 configured.  Go to the effect and right click on it to bring up the
3684 effect popup.  In the effect popup is a @b{show} option.  The show
3685 option causes the GUI for the effect to appear under the cursor.  Most
3686 effects have GUI's but some don't.  If the effect doesn't have a GUI,
3687 nothing pops up when the @b{show} option is selected.  When you
3688 tweek parameters in the effect GUI, the parameters normally effect the
3689 entire duration of the effect.
3692 @menu
3693 * REALTIME EFFECT TYPES::
3694 * EDITING REALTIME EFFECTS::
3695 @end menu
3699 @node REALTIME EFFECT TYPES
3700 @subsection REALTIME EFFECT TYPES
3702 The two other effect types supported by the Attach Effect dialog are
3703 recycled effects.  In order to use a recycled effect, three requiremenets
3704 must be met:
3706 @itemize
3708 @item
3709 There must be other effects in the timeline.
3711 @item
3713 The other effects must be of the same type as the track you're
3714 attaching an effect to.  If the track is an audio track, the effects
3715 must be audio effects.  If the track is a video track, the effects must
3716 be video effects.
3718 @item
3720 The insertion point or selected region must start inside the other effects.
3722 @end itemize
3724 In the case of a shared effect, these conditions must be true.  In the
3725 case of a shared track, there merely must be another track on the
3726 timeline of the same type as the track you're applying an effect to. 
3727 If you right clicked on a video track to attach an effect, there won't
3728 be anything in the @b{shared tracks} column if no other video track
3729 exists.  If you right clicked on an audio track there won't be anything
3730 in the shared track column if no other audio track exists.
3732 If shared effects or shared tracks are available, they appear in the
3733 @b{shared effects} and @b{shared tracks} columns.  The
3734 @b{attach} button under each column causes anything highlighted in
3735 the column to be attached under the current track.
3737 Shared effects and shared tracks allow very unique things to be done. 
3738 In the case of a shared effect, the shared effect is treated like a
3739 copy of the original effect except in the shared effect the GUI can't
3740 be brought up.  All configuration of the shared effect is determined by
3741 the GUI of the original effect and only the GUI of the original effect
3742 can be brought up.
3744 When a shared effect is played back, it's processed just like a normal
3745 effect except the configuration is copied from the original effect. 
3746 Some effects detect when they are being shared, like the reverb effects
3747 and the compressor.  These effects determine what tracks are sharing
3748 them and either mix the two tracks together or use one track to stage
3749 some value.  The reverb mixes tracks together to simulate ambience. 
3750 The compressor uses one of the sharing tracks as the trigger.
3752 When an original track has a @b{shared track} as one of its effects,
3753 the shared track itself is used as a realtime effect.  This is more
3754 commonly known as @b{bouncing tracks} but Cinelerra achieves the
3755 same operation by attaching shared tracks.  The fade and any effects in
3756 the shared track are applied to the original track.  Once the shared
3757 track has processed the data, the original track performs any effects
3758 which come below the shared track and then composites it on the output.
3760 In addition, once the shared track has processed the output of the
3761 original track like a realtime effect, the shared track mixes itself
3762 into the output with it's settings for pan, mode, and projector.  Thus,
3763 two tracks are mixing the same data on the output.  Most of the time
3764 you don't want the shared track to mix the same data as the original
3765 track on the output.  You want it to stop right before the mixing stage
3766 and give the data back to the original track.  Do this by enabling the
3767 @image{mutepatch_up} mute toggle next to each track for whom you don't
3768 want to mix on the output.
3770 Suppose you were making video and you did want the shared track to
3771 composite the original track's data on the output a second time.  In
3772 the case of video, the video from the shared track would always appear
3773 under the video from the original track, regardless of whether it was
3774 on top of the original track.  This is because shared tracks are
3775 composited in order of their attachment.  Since it's part of the original
3776 track it has to be composited before the original track is composited.
3784 @node EDITING REALTIME EFFECTS
3785 @subsection EDITING REALTIME EFFECTS
3787 Many operations exist for manipulating effects once they are in the
3788 timeline.  Because mixing effects and media is such complex business,
3789 the methods used in editing effects aren't as concise as cutting and
3790 pasting.  Some of the editing happens by dragging in/out points, some
3791 of the editing happens through popup menus, and some of it happens by
3792 dragging effects.
3794 Normally when you edit tracks, the effects follow the editing
3795 decisions.  If you cut from a track, the effect shrinks.  If you drag
3796 edit in/out points, the effect changes length.  This behavior can be
3797 disabled by selecting @b{Settings->edit effects} in the project
3798 window.  This decouples effects from editing operations, but what if
3799 you just want to edit the effects?
3801 Move the timeline cursor over the effect borders until it changes to a
3802 resize left or resize right icon.  In this state, if you drag the end
3803 of the effect, it performs an edit just like dragging the end of a
3804 track does.  
3806 The three editing behaviors of track trimming apply to effect trimming
3807 and they are bound to the mouse buttons that you set in @b{interface
3808 preferences}. @xref{INTERFACE}.  When you perform a trim edit on an
3809 effect, the effect boundary is moved by dragging on it.  Unlike track
3810 editing, the effect has no source length.  You can extend the end of an
3811 effect as much as desired without being limited.
3813 Also unlike track editing, the starting position of the drag operation
3814 doesn't bind the edit decision to media.  The media the effect is bound
3815 to doesn't follow effect edits.  Other effects; however, do follow
3816 editing decisions made on an effect.  If you drag the end of an effect
3817 which is lined up to effects on other tracks, the effects on the other
3818 tracks will be edited while the media stays the same.
3820 What happens if you trim the end of an effect in, leaving a lot of
3821 unaffected time near the end of the track?  When you drag an effect in
3822 from the Resource Window you can insert the effect in the portion of
3823 the row unoccupied by the trimming operation.  Realtime effects are
3824 organized into rows under the track.  Each row can have multiple
3825 effects.
3827 In some cases you'll want a trimming operation to change only one row
3828 of effects.  This can be achieved by first positioning the insertion
3829 point on the start or end of the effect.  Then press @b{shift} while
3830 beginning the trimming operation.  This causes the operation to change
3831 only one row of effects.
3833 In addition to trimming, you can move effects up or down.  Every track
3834 can have a stack of effects under it.  By moving an effect up or down
3835 you change the order in which effects are processed in the stack.  Go
3836 to an effect and right click to bring up the effect menu.  The
3837 @b{Move up} and @b{Move down} options move the effect up or down.
3839 When you're moving effects up or down, be aware that if they're shared
3840 as @b{shared effects}, any references will be pointing to a
3841 different effect after the move operation.
3843 Finally, there's dragging of effects.  Dragging effects works just like
3844 dragging edits.  You must select the @image{arrow} arrow to enter drag and
3845 drop mode before dragging effects.  The effects snap to media
3846 boundaries, effect boundaries, and tracks.  Be aware if you drag a
3847 reference to a shared effect, the reference will usually point to the
3848 wrong effect afterwards.
3850 Right click on an effect to bring up a menu for the effect.  Select
3851 @b{attach...} to change the effect or change the reference if it is
3852 a shared effect.
3861 @node RENDERED EFFECTS
3862 @section RENDERED EFFECTS
3865 Another type of effect is performed on a section of the track and the
3866 result stored somewhere before it is played back.  The result is
3867 usually pasted into the track to replace the original data.
3869 The rendered effects are not listed in the resource window but instead
3870 are accessed through the @b{Audio->Render effect} and
3871 @b{Video->Render effect} menu options.  Each of these menu options
3872 brings up a dialog for the rendered effect.  Rendered effects apply to
3873 only one type of track, either audio or video.  If no tracks of the
3874 type exist, an error pops up.
3876 A region of the timeline to apply the effect to must be defined before
3877 selecting @b{Render effect...}.  If no in/out points and no
3878 highlighted region exists, the entire region after the insertion point
3879 is treated as the affected region.  Otherwise, the region between the
3880 in/out points or the highlighted region is the affected region.
3882 Secondly, the tracks to apply the rendered affect to need to be
3883 @b{armed}.  All other tracks are ignored.
3885 Finally, the rendered affect processes certain track attributes when it
3886 reads its input data but not others.  Transitions in the affected track
3887 are applied.  Nudge is not and effects are not.  This allows the new
3888 data to be pasted into the existing position without changing the nudge
3889 value.
3891 In the render effect dialog is a list of all the realtime and all the
3892 rendered effects.  The difference here is that the realtime effects are
3893 rendered to disk and not applied under the track.  Highlight an effect
3894 in the list to designate it as the one being performed.
3896 Define a file to render the effect to in the @b{Select a file to
3897 render to} box.  The @image{magnify} magnifying glass allows file
3898 selection from a list.
3900 Select a file format which can handle the track type.  The
3901 @image{wrench} wrench allows configuration specific to the file format.
3903 There is also an option for creating a new file at each label.  If you
3904 have a CD rip on the timeline which you want to divide into different
3905 files, the labels would become dividing points between the files if
3906 this option were selected.  When the timeline is divided by labels, the
3907 effect is re-initialized at every label.  Normalize operations take the
3908 peak in the current file and not in the entire timeline.
3910 Finally there is an insertion strategy just like in the render dialog. 
3911 It should be noted that even though the effect applies only to audio or
3912 video, the insertion strategy applies to all tracks just like a
3913 clipboard operation.
3915 When you click @b{OK} in the effect dialog, it calls the GUI of the
3916 effect.  If the effect is also a realtime effect, a second GUI appears
3917 to prompt for acceptance or rejection of the current settings.  After
3918 accepting the settings, the effect is processed.
3933 @node TRANSITIONS
3934 @section TRANSITIONS
3936 When one edit ends and another edit begins, the default behaviour is to
3937 have the first edit's output immediately become the output of the
3938 second edit when played back.  Transitions are a way for the first
3939 edit's output to become the second edit's output with different
3940 variations.
3942 Cinelerra supports audio and video transitions, all of which are listed
3943 in the resource window.  Transitions may only apply to the matching
3944 track type.  Transitions under @b{audio transitions} can only apply
3945 to audio tracks.  Transitions under @b{video transitions} can only
3946 apply to video tracks.
3948 Load a video file and cut a section from the center so the edit point
3949 is visible on the timeline.  Go the resource window and click on the
3950 @b{Video transitions} folder.  Drag a transition from the transition
3951 list onto the second video edit on the timeline.  A box highlights over
3952 where the transition will appear.  Releasing it over the second edit
3953 applies the transition between the first and second edit.
3955 You can now scrub over the transition with the transport controls and
3956 watch the output in the @b{Compositor window}.  Scrubbing with the
3957 insertion point doesn't normally show transitions because the
3958 transition durations are usually too short.  The exact point in time
3959 when the transition takes effect isn't straightforward.  It starts when
3960 the second edit begins and lasts a certain amount of time into the
3961 second edit.  Therefore, the first asset needs to have enough data
3962 after the edit point to fill the transition into the second edit.
3964 Once the transition is in place, it can be edited similarly to an
3965 effect.  Move the pointer over the transition and right click to bring
3966 up the transition menu.  The @b{show} option brings up specific
3967 parameters for the transition in question if there are any.  The
3968 @b{length} option adjusts the length of the transition in seconds. 
3969 Once these two parameters are set, they are applied to future
3970 transitions until they are changed again.  Finally, the @b{detach}
3971 option removes the transition from the timeline.
3973 Dragging and dropping transitions from the Resource window to the
3974 Program window can be really slow and tiring.  Fortunately, once you
3975 drag a transition from the Resource window, the @b{U} and @b{u}
3976 keys will paste the same transition.  The @b{U} key pastes the last
3977 video transition and the @b{u} key pastes the last audio transition
3978 on all the recordable tracks.  If the insertion point or in point is
3979 over an edit, the beginning of the edit is covered by the transition.  
3981 It should be noted that when playing transitions from the timeline to a
3982 hardware accelerated video device, the hardware acceleration will
3983 usually be turned off momentarily during the transition and on after
3984 the transition in order to render the transition.  Using an
3985 unaccelerated video device for the entire timeline normally removes the
3986 disturbance.
3992 @node LADSPA EFFECTS
3993 @section LADSPA EFFECTS
3996 LADSPA effects are supported in realtime and rendered mode for audio. 
3997 The LADSPA plugins you get from the internet vary in quality.  Most
3998 can't be tweeked in realtime very easily and work better when
3999 rendered.  Some crash and some can only be applied to one track due to
4000 a lack of reentrancy.  Although Cinelerra implements the LADSPA
4001 interface as accurately as possible, multiple tracks of realtime,
4002 simultaneous processing go beyond the majority of LADSPA users.  LADSPA
4003 effects appear in the audio folder as the hammer and screwdriver, to
4004 signify that they are Plugins for Linux Audio Developers.
4006 LADSPA Effects are enabled merely by setting the @b{LADSPA_PATH}
4007 environment variable to the location of your LADSPA plugins or putting
4008 them in the @b{/usr/lib/cinelerra} directory.
4019 @node SETTING PROJECT ATTRIBUTES
4020 @chapter SETTING PROJECT ATTRIBUTES
4022 When you play media files in Cinelerra, the media files have a certain
4023 number of tracks, a certain frame size, a certain sample size, and so
4024 on and so forth.  No matter what the media file has; however, it is
4025 still played back according to the project attributes.  If an audio
4026 file's samplerate is different than the project attributes, it is
4027 resampled.  If a video file's frame size is different than the project
4028 attributes, it is composited on a black frame, either cropped or
4029 bordered with black.
4031 The project attributes are adjusted in @b{Settings->Set Format} and in
4032 to a more limited extent in @b{File->New}.  When you adjust project
4033 settings in @b{file->new} a new timeline is created with no data. 
4034 Every timeline created from this point uses the same settings.  When
4035 you adjust settings in @b{settings->format}, the timeline is not
4036 recreated with no data but every timeline created from this point uses
4037 the same settings.
4039 In addition to the traditional settings for sample rate, frame rate,
4040 frame size, Cinelerra uses some unusual settings like @b{channel
4041 positions, color model, and aspect ratio.}
4045 @menu
4046 * AUDIO CHANNEL POSITIONS::
4047 * COLOR MODEL::
4048 * ASPECT RATIO::
4049 @end menu
4055 @node AUDIO CHANNEL POSITIONS
4056 @section AUDIO CHANNEL POSITIONS
4058 The currently enabled audio channels and their positions in the user
4059 interface boxes are displayed in the channel position widget.
4061 @sp 2
4062 @image{channelpositions}
4063 @sp 2
4066 The channels are numbered.  When rendered, the output from channel 1 is
4067 rendered to the first output track in the file or the first soundcard
4068 channel of the soundcard.  Later channels are rendered to their
4069 successively numbered output tracks.
4071 The audio channel locations correspond to where in the panning widgets
4072 each of the audio outputs is.  The closer the panning position is to
4073 one of the audio outputs, the more signal that speaker gets.  Click on
4074 a speaker icon and drag to change the audio channel location.
4076 The speakers can be in any orientation.  A different speaker
4077 arrangement is stored for every number of audio channels since normally
4078 you don't want the same speaker arrangement for different numbers of
4079 channels.
4081 Channel positions is the only setting which doesn't affect the output
4082 necessarily.  Click on a speaker icon and drag to change the position
4083 of a channel.  It is merely a convenience so when more than 2 channels
4084 are used, the pan controls on the timeline can distinguish between
4085 them.  It has nothing to do with the actual arrangement of speakers.
4088 But different channels can be positioned very close together to make
4089 them have the same output.
4094 @node COLOR MODEL
4095 @section COLOR MODEL
4097 Color model is very important for video playback because video has the
4098 disadvantage of being very slow.  Although it isn't noticable, audio
4099 intermediates contain much more information than the audio on disk and
4100 the audio which is played.  Audio always uses the highest bandwidth
4101 intermediate because it's fast.
4103 Video intermediates must use the least amount of data for the required
4104 quality because it's slow, but video intermediates still use a higher
4105 bandwidth color model than video which is stored and video which is
4106 played.  This allows more processing to be done with less destruction
4107 of the original data.   
4109 The video is stored on disk in one colormodel, normally compressed
4110 using a YUV derivative.  When played back, Cinelerra decompresses it
4111 from the file format directly into the format of the output device.  If
4112 effects are processed, the decompression is into an intermediate
4113 colormodel first and the intermediate colormodel is then converted to
4114 the format of the output device.  The selection of intermediate
4115 colormodel determines how accurate and fast the effects are.
4117 Cinelerra colormodels are described using a certain packing order of
4118 components and a certain number of bits for each component.  The
4119 packing order is printed on the left and the bit allocation is printed
4120 on the right.
4122 @itemize
4123 @item
4125 @b{RGB-888} 
4127 This allocates 8 bits for the R, G, and B channels and no alpha. This
4128 is normally used for uncompressed media with low dynamic range.
4130 @item
4132 @b{RGBA-8888} 
4134 This allocates an alpha channel to the 8 bit RGB colormodel.  It's used
4135 for overlaying multiple tracks.
4137 @item
4139 @b{YUV-888} 
4141 This allocates 8 bits for Y, U, and V.  This is used for low dynamic
4142 range operations in which the media is compressed in the YUV color
4143 space.  Most compressed media is in YUV and this allows it to be
4144 processed fast with the least color degradation. 
4146 @item
4148 @b{YUVA-8888} 
4150 This allocates an alpha channel to the 8 bit YUV colormodel for
4151 transparency.
4153 @item
4155 @b{RGB-Float} 
4157 This allocates a 32 bit float for the R, G, and B channels and no
4158 alpha.  This is used for high dynamic range processing with no
4159 transparency.
4161 @item
4163 @b{RGBA-Float} This adds a 32 bit float for alpha to RGB-Float.  This
4164 is used for high dynamic range processing with transparency.
4166 @end itemize
4170 In order to do effects which involve alpha channels, a colormodel with
4171 an alpha channel must be selected.  These are RGBA8888, YUVA8888, and
4172 RGBA Float.  The 4 channel colormodels are notoriously slower than 3
4173 channel colormodels, with the slowest being RGBA Float.  Some effects,
4174 like fade, work around the need for alpha channels while other effects,
4175 like chromakey, require an alpha channel to do anything, so it's a good
4176 idea to try the effect without alpha channels before settling on an
4177 alpha channel and slowing it down.
4179 The YUV colormodels are usually faster than RGB colormodels when using
4180 compressed footage.  They also destroy fewer colors than RGB
4181 colormodels.  If footage stored as JPEG or MPEG is processed many times
4182 in RGB, the colors will fade while they won't if processed in YUV.
4184 Years of working with high dynamic range footage have shown floating
4185 point RGB to be the best format for high dynamic range.  While 16 bit
4186 integers were used in the past, these were too lossy and slow for the
4187 amount of improvement.
4189 RGB float doesn't destroy information when used with YUV source
4190 footage.  It also supports brightness above 100%.  Be aware that some
4191 effects, like Histogram, still clip above 100% when in floating point.
4193 @node ASPECT RATIO
4194 @section ASPECT RATIO
4196 Aspect ratio determines the shape of the video output when using the
4197 X11 video output.  The numbers in each direction can be any floating
4198 point number.  When drawn on the screen, video pixels are stretched to
4199 match the aspect ratio.
4201 Some file formats, like MPEG video, write the project aspect ratio to
4202 the file.
4213 @node COMPOSITING
4214 @chapter COMPOSITING
4217 A large amount of Cinelerra's binary size is directed towards
4218 compositing.  When you remove the letterboxing from a widescreen show,
4219 you're compositing.  Changing the resolution of a show, making a split
4220 screen, and fading in and out among other things are all compositing
4221 operations in Cinelerra.  Cinelerra detects when it's in a compositing
4222 operation and plays back through the compositing engine only then. 
4223 Otherwise, it uses the fastest decoder available in the hardware.
4225 Compositing operations are done on the timeline and in the Compositor
4226 window.  Shortcuts exist in the Resource window for changing some
4227 compositing attributes.  Once some video files are on the timeline, the
4228 compositor window is a good place to try compositing.
4232 @menu
4233 * THE CAMERA AND PROJECTOR::
4234 * MASKS::
4235 * CROPPING::
4236 * SAFE REGIONS::
4237 * OVERLAY MODES::
4238 * TRACK AND OUTPUT SIZES::
4239 @end menu
4243 @node THE CAMERA AND PROJECTOR
4244 @section THE CAMERA AND PROJECTOR
4246 In the compositor window, the most important functions are the
4247 @image{camera} camera button and the @image{projector} projector
4248 button.  These control operation of the camera and projector.  Inside
4249 Cinelerra's compositing pipeline, the camera determines where in the
4250 source video the temporary is copied from.  The projector determines
4251 where in the output the temporary is copied to.  The temporary is a
4252 frame of video in Cinelerra's memory where all graphics processing is
4253 done.  Each track has a different temporary which is defined by the
4254 track size.  By resizing the tracks you can create splitscreens, pans,
4255 and zooms.
4257 @sp 2
4258 @image{compositing_pipeline}
4259 @sp 2
4260 @b{Visual representation of the compositing pipeline}.
4262 When editing the camera and projector in the compositing window, the
4263 first track with @b{record} enabled is the track affected.  Even if
4264 the track is completely transparent, it's still the affected track.  If
4265 multiple video tracks exist, the easiest way to select one track for
4266 editing is to @b{shift-click} on the record icon of the track.  This
4267 solos the track.
4269 When the @b{projector} button is enabled in the compositor window,
4270 you're in projector editing mode.  A guide box appears in the video
4271 window.  Dragging anywhere in the video window causes the guide box to
4272 move, hopefully along with the video.  @b{shift-dragging} anywhere
4273 in the video window causes the guide box to shrink and grow along with
4274 the video.  Once you've positioned the video with the projector, you're
4275 ready to master the camera.
4277 Select the @image{camera} camera button to enable camera editing mode. 
4278 In this mode, the guide box shows where the camera position is in
4279 relation to past and future camera positions but not where it is in
4280 relation to the source video.  Dragging the camera box in the
4281 compositor window doesn't move the box but instead moves the location
4282 of the video inside the box.
4284 For example, when you drag the camera left, the video moves right. 
4285 When you drag the camera up, the video moves down.  When you shift-drag
4286 the camera, the effect is the same as if you zoomed in or out of the
4287 source.  The intention of the camera is to produce still photo panning,
4288 while the intention of the projector is to composite several sources in
4289 the same scene.
4291 In the compositing window, there is a popup menu of options for the
4292 camera and projector.  Right click over the video portion of the
4293 compositing window to bring up the menu.
4295 @itemize
4297 @item Reset Camera causes the camera to return to the center position.
4299 @item Reset Projector causes the projector to return to the center.
4301 @end itemize
4304 The camera and projector have shortcut operations neither in the popup
4305 menu or represented in video overlays.  These are accessed in the
4306 @b{Tool window}.  Most operations in the Compositor window have a
4307 tool window which is enabled by activating the @image{toolwindow}
4308 question mark.
4310 In the case of the camera and projector, the tool window shows x, y,
4311 and z coordinates.  By either tumbling or entering text directly, the
4312 camera and projector can be precisely positioned.  9 justification
4313 types are also defined for easy access.  A popular justification
4314 operation is upper left projection after image reduction.  This is used
4315 when reducing the size of video with aspect ratio adjustment.
4317 The translation effect allows simultaneous aspect ratio conversion and
4318 reduction but is easier to use if the reduced video is put in the upper
4319 left of the temporary instead of in the center.  The track size is set
4320 to the original size of the video and the camera is centered.  The
4321 output size is set to the reduced size of the video.  Without any
4322 effects, this produces just the cropped center portion of the video in
4323 the output.
4325 The translation effect is dropped onto the video track.  The input
4326 dimensions of the translation effect are set to the original size and
4327 the output dimensions are set to the reduced size.  To put the reduced
4328 video in the center section that the projector shows would require
4329 offsetting @b{out x and out y} by a complicated calculation. 
4330 Instead, we leave @b{out x and out y} at 0 and use the projector's
4331 tool window.
4333 Merely by selecting @image{left_justify} left justify and
4334 @image{top_justify} top justify, the projector displays the reduced
4335 image from the top left corner of the temporary in the center of the
4336 output.
4343 @node MASKS
4344 @section MASKS
4346 Masks select a region of the video for either displaying or hiding. 
4347 Masks are also used in conjunction with another effect to isolate the
4348 effect to a certain region of the frame.  A copy of one video track may
4349 be delayed slightly and unmasked in locations where the one copy has
4350 interference but the other copy doesn't.  Color correction may be
4351 needed in one section of a frame but not another.  A mask can be
4352 applied to just a section of the color corrected track while the
4353 vanilla track shows through.  Removal of boom microphones, airplanes,
4354 and housewives are other mask uses.
4356 The order of the compositing pipeline affects what can be done with
4357 masks.  Mainly, masks are performed on the temporary after effects and
4358 before the projector.  This means multiple tracks can be bounced to a
4359 masked track and projected with the same mask.
4361 Our compositing pipeline graph now has a masking stage.  There are 8
4362 possible masks per track.  Each mask is defined separately, although
4363 they each perform the same operation, whether it's addition or
4364 subtraction.
4366 @sp 2
4367 @image{compositing_pipeline2}
4368 @sp 2
4369 @b{Compositing pipeline with masks}
4371 To define a mask, go into the Compositor window and enable the
4372 @image{mask} @b{mask} toggle.  Now go over the video and
4373 click-drag.  Click-drag again in another part of the image to create
4374 each new point of the mask.  While it isn't the conventional bezier
4375 curve behavior, this masking interface performs in realtime what the
4376 effect of the mask is going to be.  Creating each point of the mask
4377 expands a rubber band curve.  
4379 Once points are defined, they can be moved by @b{ctrl-dragging} in
4380 the vicinity of the corner.  This; however, doesn't smooth out the
4381 curve.  The in-out points of the bezier curve are accessed by
4382 @b{shift-dragging} in the vicinity of the corner.  Then
4383 @b{shift-dragging} near the in or out point causes the point to
4384 move.
4386 Finally, once you have a mask, the mask can be translated in one piece
4387 by @b{alt-dragging} the mask.  Mask editing in Cinelerra is
4388 identical to how The Gimp edits masks except in this case the effect of
4389 the mask is always on.
4391 The masks have many more parameters which couldn't be represented with
4392 video overlays.  These are represented in the tool window for masks. 
4393 Selecting the @image{toolwindow} question mark when the @image{mask}
4394 mask toggle is highlighted brings up the mask options.
4396 The @b{mode} of the mask determines if the mask removes data or
4397 makes data visible.  If the mode is subtractive, the mask causes video
4398 to disappear.  If the mode is additive, the mask causes video to appear
4399 and everything outside the mask to disappear.
4401 The @b{value} of the mask determines how extreme the addition or
4402 subtraction is.  In the subtractive mode, higher values subtract more
4403 alpha.  In the additive mode, higher values make the region in the mask
4404 brighter while the region outside the mask is always hidden.
4406 The mask number determines which one of the 8 possible masks we're
4407 editing.  Each track has 8 possible masks.  When you click-drag in the
4408 compositor window, you're only editing one of the masks.  Change the
4409 value of @b{mask number} to cause another mask to be edited.  The
4410 previous mask is still active but only the curve overlay for the
4411 currently selected mask is visible.
4413 When multiple masks are used, their effects are ORed together.  Every
4414 mask in a single track uses the same value and mode.
4416 The edges of a mask are hard by default but this rarely is desired. 
4417 The @b{feather} parameter determines how many pixels to feather the
4418 mask.  This creates softer edges but takes longer to render.
4420 Finally, there are parameters which affect one point on the current
4421 mask instead of the whole mask.  These are @b{Delete, x, y}.  The
4422 active point is defined as the last point dragged in the compositor
4423 window.  Any point can be activated merely by @b{ctrl-clicking} near
4424 it without moving the pointer.  Once a point is activated,
4425 @b{Delete} deletes it and @b{x, y} allow repositioning by numeric
4426 entry.
4431 @node CROPPING
4432 @section CROPPING
4436 Cropping changes the value of the output dimensions and the projector
4437 to reduce the visible picture area.  Enable the @image{crop} crop
4438 toggle and the @image{toolwindow} tool window in the @b{compositing
4439 window} to perform cropping.
4441 This draws a rectangle over the video.  Click-drag anywhere in the
4442 video to start a new rectangle.  Click-drag over any corner of the
4443 rectangle to reposition the corner.
4445 Alt-click in the cropping rectangle to translate the rectangle to any
4446 position without resizing it.
4448 The tool window allows text entry of the coordinates and executes the
4449 cropping operation.  When the rectangle is positioned, hit the @b{do
4450 it} button in the tool window to execute the cropping operation.
4457 @node SAFE REGIONS
4458 @section SAFE REGIONS
4460 On consumer displays the borders of the image are cut off and within
4461 the cutoff point is a region which isn't always square like it is in
4462 the compositor window.  The borders are intended for scratch room and
4463 vertical blanking data.  You can show where these borders are by
4464 enabling the @image{titlesafe} safe regions toggle.  Keep titles inside
4465 the inner rectangle and keep action inside the outer rectangle.
4474 @node OVERLAY MODES
4475 @section OVERLAY MODES
4477 Every video track has an overlay mode, accessible by expanding the
4478 track.  The overlay mode is a pulldown menu on the left under the
4479 fader.  When collapsed, it displays an icon representing the current
4480 overlay mode.
4482 Select the @image{expandpatch_checked} expand track toggle to view all
4483 the options for a video track if you can't see the overlay mode.  The
4484 overlay mode of video tracks is @b{normal} by default.  Select other
4485 modes by clicking the overlay button and selecting an item from the
4486 popup menu.
4488 Overlay modes are processed inside the projector stage of compositing. 
4489 The different modes are summarized below.
4491 @itemize
4493 @item
4495 @b{Normal} uses a traditional Porter-Diff equation to blend tracks with
4496 alpha.  When no alpha exists in the project color model, the new track
4497 always replaces the output.
4499 @item
4501 @b{Addition}  In this mode, whatever is in the output is added to the
4502 current track.  The result is blended based on the current track's
4503 alpha onto the output.
4505 @item
4507 @b{Subtraction} In this mode, the current track is subtracted from the
4508 output and the result is alpha blended onto the output.
4510 @item 
4512 @b{Multiply} is the most useful operation.  The current track is multiplied
4513 by the output and the result blended onto the output.  Usually a black
4514 and white image with no alpha channel or a white title on a black image
4515 is used as the current track.  With the multiply operation, only the
4516 output portions under the white area show.
4518 @item
4520 @b{Divide} divides the current track by the output and the result is
4521 blended into the output.  It usually results in overloaded levels.
4523 @item
4525 @b{Replace} does no blending and overwrites the output with the current
4526 track.
4528 @end itemize
4534 @node TRACK AND OUTPUT SIZES
4535 @section TRACK AND OUTPUT SIZES
4537 The size of the temporary and the size of the output in our compositing
4538 pipeline are independant and variable.  This fits into everything
4539 covered so far.  The camera's viewport is the temporary size.  Effects
4540 are processed in the temporary and are affected by the temporary size. 
4541 Projectors are rendered to the output and are affected by the output
4542 size.  If the temporary is smaller than the output, the temporary is
4543 bordered by blank regions in the output.  If the temporary is bigger
4544 than the output, the temporary is cropped.
4546 The temporary size is defined as the track size.  Each track has a
4547 different size.  Right click on a track to bring up the track's menu. 
4548 Select @b{Resize Track} to resize the track to any arbitrary size. 
4549 Alternatively you can select @b{Match output size} to make the track
4550 the same size as the output.
4552 The output size is set in either @b{New} when creating a new project
4553 or @b{Settings->Format}.  In the Resource window there is another
4554 way to change the output size.  Right click on a video asset and select
4555 @b{Match project size} to conform the output to the asset.  When new
4556 tracks are created, the track size always conforms to the output size
4557 specified by these methods.
4564 @node KEYFRAMES
4565 @chapter KEYFRAMES
4568 When you change the fade, camera, projector, or other parameters for a
4569 track, they stay by default the same for the entire durection of the
4570 timeline.   Setting static parameters isn't very useful sometimes. 
4571 Normally you need to move the camera around over time or change mask
4572 positions.  Masks need to follow objects.  We create dymanic changes by
4573 defining keyframes.  A keyframe is a certain point in time when the
4574 settings for one operation change.  In Cinelerra, there are keyframes
4575 for almost every compositing parameter and effect parameter.
4577 Whenever you adjust any parameter, the value is stored in a keyframe. 
4578 If the value is stored in a keyframe, why doesn't it always change? 
4579 The keyframe it is stored in by default is known as the @b{default
4580 keyframe}.  The default keyframe applies to the entire duration if no
4581 other keyframes are present.  The default keyframe is not drawn
4582 anywhere because it always exists.  The only way change occurs over
4583 time is if non-default keyframes are created.
4585 Display keyframes for any parameter by using the @b{view} menu.  A
4586 faster way to toggle multiple keyframe types is to bring up
4587 @b{window->overlays}.  This window allows toggling of every parameter
4588 in the view menu.  When keyframes are selected, they are drawn on the
4589 timeline over the tracks they apply to.
4591 Keyframes come in many forms: curves, toggles, modes, and so on. 
4592 How to handle the different types of keyframes is described here.
4594 @menu
4595 * CURVE KEYFRAMES::
4596 * TOGGLE KEYFRAMES::
4597 * AUTOMATIC KEYFRAMES::
4598 * COMPOSITOR KEYFRAMES::
4599 * EDITING KEYFRAMES::
4600 @end menu
4604 @node CURVE KEYFRAMES
4605 @section CURVE KEYFRAMES
4607 Many parameters are stored in bezier curves.  Go to @b{view->fade} or
4608 @b{view->...zoom} to show curves on the timeline for those parameters. 
4609 In either arrow editing mode or i-beam editing mode, move the cursor
4610 over the curves in the timeline until it changes shape.  Then merely by
4611 clicking and dragging on the curve you can create a keyframe at the
4612 position.
4614 After the keyframe is created, click drag on it again to reposition
4615 it.  When you click-drag a second keyframe on the curve, it creates a
4616 smooth ramp.  @b{ctrl-dragging} on a keyframe changes the value of
4617 either the input control or the output control.  This affects the
4618 sharpness of the curve.  While the input control and the output control
4619 can be moved horizontally as well as vertically, the horizontal
4620 movement is purely for legibility and isn't used in the curve value.
4622 You may remember that The Gimp and the Compositing masks all use
4623 @b{shift} to select control points so why does the timeline use
4624 @b{ctrl}?  When you @b{shift-drag} on a timeline curve, the
4625 keyframe snaps to the value of either the next or previous keyframe,
4626 depending on which exists.  This lets you set a constant curve value
4627 without having to copy the next or previous keyframe.
4629 @menu
4630 * NAVIGATING CURVE KEYFRAMES::
4631 @end menu
4634 @node NAVIGATING CURVE KEYFRAMES
4635 @subsection NAVIGATING CURVE KEYFRAMES
4637 There isn't much room on the timeline for a wide range of curve
4638 values.  You need to zoom the curves in and out vertically to have any
4639 variability.  This is done by 2 tools: the automation fit button
4640 @image{fitautos} and automation zoom menu @image{autozoom}.
4642 The automation fit button scales and offsets the vertical range so the
4643 selected curve area appears in the timeline.  If a region of the
4644 timeline is highlighted by the cursor, only that region is scaled. 
4645 In/out points don't affect the zoomed region.  @b{Alt-f} also performs
4646 automation fitting.
4648 The automation zoom menu manually changes the vertical scaling of the
4649 curves in multiples of 2.  Click on its tumbler to change the zoom. 
4650 @b{Alt-Up and Alt-Dn} change the automation zoom from the keyboard.
4653 @node TOGGLE KEYFRAMES
4654 @section TOGGLE KEYFRAMES
4656 Mute is the only toggle keyframe.  Mute keyframes determine where the
4657 track is processed but not rendered to the output.  Click-drag on these
4658 curves to create a keyframe.  Unlike curves, the toggle keyframe has
4659 only two values: on or off.  Ctrl and shift do nothing on toggle
4660 keyframes.
4667 @node AUTOMATIC KEYFRAMES
4668 @section AUTOMATIC KEYFRAMES
4670 You may have noticed when a few fade curves are set up, moving the
4671 insertion point around the curves causes the faders to reflect the
4672 curve value under the insertion point.  This isn't just to look cool. 
4673 The faders themselves can set keyframes in automatic keyframe mode. 
4674 Automatic keyframe mode is usually more useful than dragging curves.
4676 Enable automatic keyframe mode by enabling the automatic keyframe
4677 toggle @image{autokeyframe}.  In automatic keyframe mode, every time
4678 you tweek a keyframeable parameter it creates a keyframe on the
4679 timeline.  Since automatic keyframes affect many parameters, it's best
4680 enabled just before you need a keyframe and disabled immediately
4681 thereafter.
4683 It's useful to go into the @b{View} menu and make the desired
4684 parameter visible before performing a change.  The location where the
4685 automatic keyframe is generated is under the insertion point.  If the
4686 timeline is playing back during a tweek, several automatic keyframes
4687 will be generated as you change the parameter.
4689 When automatic keyframe mode is disabled, a similarly strange thing
4690 happens.  Adjusting a parameter adjusts the keyframe immediately
4691 preceeding the insertion point.  If two fade keyframes exist and the
4692 insertion point is between them, changing the fader changes the first
4693 keyframe.
4695 There are many parameters which can only be keyframed in automatic
4696 keyframe mode.  These are parameters for which curves would take up too
4697 much space on the track or which can't be represented easily by a
4698 curve.
4700 Effects are only keyframable in automatic mode because of the number of
4701 parameters in each individual effect.  
4703 Camera and projector translation can only be keyframed in automatic
4704 keyframe mode while camera and projector zoom can be keyframed with
4705 curves.  It is here that we conclude the discussion of compositing,
4706 since compositing is highly dependant on the ability to change over
4707 time.
4711 @node COMPOSITOR KEYFRAMES
4712 @section COMPOSITOR KEYFRAMES
4714 Camera and projector translation is represented by two parameters: x
4715 and y.  Therefore it is cumbersome to adjust with curves.  Cinelerra
4716 solves this problem by relying on automatic keyframes.  With a video
4717 track loaded, move the insertion point to the beginning of the track
4718 and enable automatic keyframe mode.
4720 Move the projector slightly in the compositor window to create a
4721 keyframe.  Then go forward several seconds.  Move the projector a long
4722 distance to create another keyframe and emphasize motion.  This creates
4723 a second projector box in the compositor, with a line joining the two
4724 boxes.  The joining line is the motion path.  If you create more
4725 keyframes, more boxes are created.  Once all the desired keyframes are
4726 created, disable automatic keyframe mode.
4728 Now when scrubbing around with the compositor window's slider, the
4729 video projection moves over time.  At any point between two keyframes,
4730 the motion path is read for all time before the insertion point and
4731 green for all time after the insertion point.  It's debatable if this
4732 is a very useful feature but it makes you feel good to know what
4733 keyframe is going to be affected by the next projector tweek.
4735 Click-drag when automatic keyframes are off to adjust the preceeding
4736 keyframe.  If you're halfway between two keyframes, the first projector
4737 box is adjusted while the second one stays the same.  Furthermore, the
4738 video doesn't appear to move in step with the first keyframe.  This is
4739 because, halfway between two keyframes the projector translation is
4740 interpolated.  In order to set the second keyframe you'll need to scrub
4741 after the second keyframe.
4743 By default the motion path is a straight line, but it can be curved
4744 with control points.  @b{Ctrl-drag} to set either the in or out
4745 control point of the preceeding keyframe.  Once again, we depart from
4746 The Gimp because @b{shift} is already used for zoom.  After the in
4747 or out control points are extrapolated from the keyframe,
4748 @b{Ctrl-dragging} anywhere in the video adjusts the nearest control
4749 point.  A control point can be out of view entirely yet still
4750 controllable.
4752 When editing the camera translation, the behavior of the camera boxes
4753 is slightly different.  Camera automation is normally used for still
4754 photo panning.  The current camera box doesn't move during a drag, but
4755 if multiple keyframes are set, every camera box except the current
4756 keyframe appears to move.  This is because the camera display shows
4757 every other camera position relative to the current one.
4759 The situation becomes more intuitive if you bend the motion path
4760 between two keyframes and scrub between the two keyframes.  The
4761 division between red and green, the current position between the
4762 keyframes, is always centered while the camera boxes move.
4769 @node EDITING KEYFRAMES
4770 @section EDITING KEYFRAMES
4772 Keyframes can be shifted around and moved between tracks on the
4773 timeline using similar cut and paste operations to editing media.  Only
4774 the keyframes selected in the @b{view} menu are affected by keyframe
4775 editing operations, however.
4777 The most popular keyframe editing operation is replication of some
4778 curve from one track to the other, to make a stereo pair.  The first
4779 step is to solo the source track's record @image{recordpatch_up} patch
4780 by @b{shift-clicking} on it.  Then either set in/out points or
4781 highlight the desired region of keyframes.  Go to @b{keyframes->copy
4782 keyframes} to copy them to the clipboard.  Solo the destination track's
4783 record @image{recordpatch_up} patch by @b{shift-clicking} on it and
4784 go to @b{keyframes->paste keyframes} to paste the clipboard.
4786 The media editing commands are mapped to the keyframe editing commands
4787 by using the @b{shift} key instead of just the keyboard shortcut.  
4789 This leads to the most complicated part of keyframe editing, the
4790 default keyframe.  Remember that when no keyframes are set at all,
4791 there is still a default keyframe which stores a global parameter for
4792 the entire duration.  The default keyframe isn't drawn because it
4793 always exists.  What if the default keyframe is a good value which you
4794 want to transpose between other non-default keyframes?  The
4795 @b{keyframes->copy default keyframe} and @b{keyframes->paste
4796 default keyframe} allow conversion of the default keyframe to a
4797 non-default keyframe.
4799 @b{Keyframes->copy default keyframe} copies the default keyframe to
4800 the clipboard, no matter what region of the timeline is selected.  The
4801 @b{keyframes->paste keyframes} function may then be used to paste
4802 the clipboard as a non-default keyframe.
4804 If you've copied a non-default keyframe, it can be stored as the
4805 default keyframe by calling @b{keyframes->paste default keyframe}. 
4806 After using paste default keyframe to convert a non-default keyframe
4807 into a default keyframe, you won't see the value of the default
4808 keyframe reflected until all the non-default keyframes are removed.
4810 Finally, there is a convenient way to delete keyframes besides
4811 selecting a region and calling @b{keyframes->clear keyframes}. 
4812 Merely click-drag a keyframe before its preceeding keyframe or after
4813 its following keyframe on the track.
4821 @node CAPTURING MEDIA
4822 @chapter CAPTURING MEDIA
4824 Ideally, all media would be stored on hard drives, CD-ROM, flash, or
4825 DVD and loading it into Cinelerra would be a matter of loading a file. 
4826 In reality, very few sources of media can be accessed like a filesystem
4827 but instead rely on tape transport mechanisms and dumb I/O mechanisms
4828 to transfer the data to computers.  These media types are imported into
4829 Cinelerra through the Record dialog.
4831 The first step in recording is to configure the input device.  In
4832 @b{Settings->preferences} are a number of recording parameters
4833 described in configuration @xref{RECORDING}.  These parameters apply to
4834 recording no matter what the project settings are, because the
4835 recording parameters are usually the maximum capability of the
4836 recording hardware while project settings come and go.
4838 Go to @b{File->record} to record a dumb I/O source.  This prompts
4839 for an output format much like rendering does.  Once that's done, the
4840 record window and the record monitor pop up.
4842 The record window has discrete sections.  While many parameters change
4843 depending on if the file has audio or video, the discrete sections are
4844 always the same.
4846 @itemize
4848 @item
4850 The output format area describes the format of the output file and the
4851 current position within it.
4854 @item
4856 The edit batch area lets you change parameters in the current batch.
4858 @item
4860 The transport controls start and stop recording different ways.
4862 @item
4864 The batch list displays all the defined batches.
4866 @item
4868 The confirmation area lets you determine how the output files are
4869 imported into the timeline and quit.
4871 @end itemize
4873 @image{recording}
4874 @sp 2
4875 @b{Recording window areas}
4878 Recording in Cinelerra is organized around batches.  A batch
4879 essentially defines a distinct output file for the recording.  For now
4880 you can ignore the batch concept entirely and record merely by hitting
4881 the record button @image{record}.
4883 The record button opens the current output file if it isn't opened and
4884 writes captured data to it.  Use the stop button to stop the
4885 recording.  Recording can be resumed with the record button without
4886 erasing the file at this point.  In the case of a video file, there is
4887 a single frame record button @image{singleframe} which records a single
4888 frame.
4890 When enough media is recorded, choose an insertion method from the
4891 @b{Insertion Strategy} menu and hit @b{close}.
4896 @menu
4897 * BATCHES::
4898 * EDITING TUNER INFORMATION::
4899 @end menu
4904 @node BATCHES
4905 @section BATCHES
4907 Now we come to the concept of batches.  Batches try to make the dumb
4908 I/O look more like a filesystem.  Batches are traditionally used to
4909 divide tape into different programs and save the different programs as
4910 different files instead of recording straight through an entire tape. 
4911 Because of the high cost of developing frame-accurate deck control
4912 mechanisms, the only use of batches now is recording different programs
4913 during different times of day.  This is still useful for recording TV
4914 shows or time lapse movies as anyone who can't afford proper appliances
4915 knows.
4917 The record window supports a list of batches and two recording modes:
4918 interactive and batch recording.  Interactive recording happens when
4919 the record button is pressed.  Interactive recording starts immediately
4920 and uses the current batch to determine everything except start time. 
4921 By default, the current batch is configured to behave like tape.
4923 Batch recording happens when the @b{start} button is pressed.  In
4924 batch recording, the @b{start time} is the time the batch starts
4925 recording.
4927 First, you'll want to create some batches.  Each batch has certain
4928 parameters and methods of adjustment.  
4933 @itemize
4935 @item 
4937 @b{On} determines whether the batch is included in batch recording
4938 operations.  Click the list row under @b{On} to enable or disable
4939 batches.
4942 @item 
4944 @b{Path} is the file the batch is going to be recorded to.  The
4945 filename specified in the record dialog is the name of the first batch,
4946 to simplify interactive recording, but the filename may be changed in
4947 the record window for any batch in the @b{edit batch} area.
4950 @item
4952 @b{News} shows whether the file exists or not.  This is a very
4953 important attribute since there is no confirmation dialog if the file
4954 exists.  The first time you hit record, the file is opened.  If the
4955 file exists at this point it's erased.  News says @b{File exists} if
4956 it exists and @b{OK} if it doesn't.  Every time you resume recording
4957 in the same batch, the news should say @b{Open}, indicating the file
4958 is already opened and won't be erased in the next record button press.
4960 If you change out of the current batch after recording, the file is
4961 closed.  Next time you change into the batch, the file will be erased.
4963 @item
4965 @b{Start time} is the 24 hour time of day the batch will start
4966 recording if in batch mode.  The start time may become a time of tape
4967 and reel number if deck control is implemented but for now it's a time
4968 of day.
4970 @item
4972 @b{Duration} is the length of the batch.  It only has meaning if the
4973 @b{Mode} of the batch is @b{Timed}.  Once the recording length
4974 reaches @b{duration} the recording stops, whether in interactive or
4975 batch mode.
4977 @item
4979 @b{Source} has meaning only when the capturing hardware has multiple
4980 sources.  Usually the source is a tuner channel or input.  When the
4981 current batch finishes and the next batch begins recording, the source
4982 is changed to what the next batch is set to.  This way multiple TV
4983 stations can be recorded at different times.
4986 @end itemize
4988 The record window has a notion of the @b{current batch}.  The
4989 current batch is not the same as the batch which is highlighted in the
4990 batch list.  The current batch text is colored red in the batch list. 
4991 The highlighted batch is merely displayed in the edit batch section for
4992 editing.
4994 By coloring the current batch red, any batch can be edited by
4995 highlighting it, without changing the batch to be recorded.
4997 All recording operations take place in the current batch.   If there
4998 are multiple batches, highlight the desired batch and hit
4999 @b{activate} to make it the current batch.  If the @b{start}
5000 button is pressed, the current batch flashes to indicate it's waiting
5001 for the start time in batch mode.  If the @b{record} button is
5002 pressed, the current batch is recorded immediately in interactive mode.
5004 In batch and interactive recording modes, when the current batch
5005 finishes recording the next batch is activated and performed.  All
5006 future recording is done in batch mode.  When the first batch finishes,
5007 the next batch flashes until its start time is reached.
5009 Interrupt either the batch or the interactive operation by hitting the
5010 stop button.
5012 Finally there is the @image{rewind} rewind button.  In either
5013 interactive or batch recording, the rewind button causes the current
5014 batch to close its file.  The next recording operation in the current
5015 batch deletes the file.
5022 @node EDITING TUNER INFORMATION
5023 @section EDITING TUNER INFORMATION
5026 Sometimes in the recording process and the configuration process,
5027 you'll need to define and select tuner channels to either record or
5028 play back to.  In the case of the Video4Linux and Buz recording
5029 drivers, tuner channels define the source.  When the Buz driver is also
5030 used for playback, tuner channels define the destination.  
5032 Defining tuner channels is accomplished by pushing the @image{channel}
5033 channel button.  This brings up the channel editing window.  In this
5034 window you add, edit, and sort channels.  Also, for certain video
5035 drivers, you can adjust the picture quality.
5037 The @b{add} operation brings up a channel editing box.  The title of
5038 the channel appears in the channel list.  The source of the channel is
5039 the entry in the physical tuner's frequency table corresponding to the
5040 title.  
5042 Fine tuning in the channel edit dialog adjusts the physical frequency
5043 slightly if the driver supports it.  The norm and frequency table
5044 together define which frequency table is selected for defining
5045 sources.  If the device supports multiple inputs, the input menu
5046 selects these.
5048 To sort channels, highlight the channel in the list and push @b{move
5049 up} or @b{move down} to move it.
5051 Once channels are defined, the @b{source} item in the record window
5052 can be used to select channels for recording.  The same channel
5053 selecting ability also exists in the record monitor window.  Be aware
5054 channel selections in the record monitor window and the record window
5055 are stored in the current batch.
5057 For some drivers an option to @b{swap fields} may be visible.  These
5058 drivers don't get the field order right every time without human
5059 intervention.  Toggle this to get the odd and even lines to record in
5060 the right order.
5065 @node IMPROVING PERFORMANCE
5066 @chapter IMPROVING PERFORMANCE
5069 Let's get one thing perfectly clear.  Linux is not a very good
5070 desktop.  It's a server.  Most of what you'll find on modern Linux
5071 distributions are faceless, network-only programs strategicly designed
5072 to counteract one Microsoft server feature or another and not to
5073 perform very well at user interaction.  There are a number of
5074 parameters on Linux, which ordinary people can adjust to make it behave
5075 more like a thoroughbred in desktop usage.
5078 @menu
5079 * DISABLING SWAP SPACE::
5080 * ENLARGING SOUND BUFFERS::
5081 * FREEING MORE SHARED MEMORY::
5082 * SPEEDING UP THE HARD DRIVE::
5083 * DISABLING CRON::
5084 * REDUCING USB MOUSE SENSITIVITY::
5085 * ASSORTED X TWEEKS::
5086 * SPEEDING UP THE FILE SYSTEM::
5087 * IMPROVING ZORAN VIDEO::
5088 @end menu
5090 @node DISABLING SWAP SPACE
5091 @section DISABLING SWAP SPACE
5093 On systems with lots of memory, Cinelerra sometimes runs better without
5094 a swap space.  If you have 4 GB of RAM, you're probably better off
5095 without a swap space.  If you have 512MB of RAM, you should keep the
5096 swap.  If you want to do recording, you should probably disable swap
5097 space in any case.  There's a reason for this.  Linux only allows half
5098 the available memory to be used.  Beyond that, it starts searching for
5099 free pages to swap, in order to cache more disk access.  In a 4 GB
5100 system, you start waiting for page swaps after using only 2 GB.  
5102 The question then is how to make Linux run without a swap space. 
5103 Theoretically it should be a matter of running
5105 @example
5106 swapoff -a
5107 @end example
5109 Unfortunately, without a swap space the @b{kswapd} tasklet normally
5110 spins at 100%.  To eliminate this problem, edit @b{linux/mm/vmscan.c}.
5111 In this file, put a line saying @b{return 0;} before it says 
5113 @example
5114         /*
5115          * Kswapd main loop.
5116          */
5117 @end example
5119 Then recompile the kernel.
5124 @node ENLARGING SOUND BUFFERS
5125 @section ENLARGING SOUND BUFFERS
5127 In order to improve realtime performance, the audio buffers for all the
5128 Linux sound drivers were limited from 128k to 64k.  For recording audio
5129 and video simultaneously and for most audio recording this causes
5130 dropouts.  Application of low latency and preemtible kernel patches
5131 make it possible to record more audio recordings but it doesn't improve
5132 recording video with audio.  This is where you need to hack the kernel.
5134 To see if your sound buffers are suitable, run the included
5135 @b{soundtest} program with nothing playing or recording.  This
5136 allocates the largest possible buffers and displays them.  If the
5137 @b{TOTAL BYTES AVAILABLE} is under 131072, you need to see about
5138 getting the buffers enlarged in the driver.  While many drivers differ,
5139 we have a hack for at least one driver.
5141 This only applies to the OSS version of the Soundblaster Live driver. 
5142 Since every sound card and every sound driver derivative has a
5143 different implementation you'll need to do some searching for other
5144 sound cards.  Edit @b{linux/drivers/sound/emu10k1/audio.c}
5146 Where is says
5148 @example
5149 if (bufsize >= 0x10000)
5150 @end example
5152 change it to say
5154 @example
5155 if (bufsize > 0x40000)
5156 @end example
5160 Where is says
5162 @example
5163                 for (i = 0; i < 8; i++)
5164                         for (j = 0; j < 4; j++)
5165 @end example
5167 change it to say
5169 @example
5170                 for (i = 0; i < 16; i++)
5171                         for (j = 0; j < 4; j++)
5172 @end example
5176 In @b{linux/drivers/sound/emu10k1/hwaccess.h}
5178 Change
5180 @b{#define MAXBUFSIZE   65536} 
5182 to 
5184 @b{#define MAXBUFSIZE   262144} 
5186 Finally, in @b{linux/drivers/sound/emu10k1/cardwi.h}
5188 @b{#define WAVEIN_MAXBUFSIZE         65536}
5192 @b{#define WAVEIN_MAXBUFSIZE         262144}
5194 Then recompile the kernel modules.
5201 @node FREEING MORE SHARED MEMORY
5202 @section FREEING MORE SHARED MEMORY
5204 The Linux kernel only allows 32MB of shared memory to be allocated by
5205 default.  This needs to be increased to do anything useful.  Run the
5206 following command:
5208 @b{echo "0x7fffffff" > /proc/sys/kernel/shmmax}
5214 @node SPEEDING UP THE HARD DRIVE
5215 @section SPEEDING UP THE HARD DRIVE
5217 This is a very popular command sequence among Linux gurus, which is not
5218 done by default on Linux distributions.
5220 @b{hdparm -c3 -d1 -u1 -k1 /dev/hda}
5222 @b{-c3} puts the hard drive into 32 bit I/O with sync.  This normally
5223 doesn't work due to inept kernel support for most IDE controllers.  If
5224 you get lost interrupt or SeekComplete errors, quickly use @b{-c0}
5225 instead of @b{-c3} in your command.
5227 @b{-d1} enables DMA of course.  This frees up the CPU partially during
5228 data transfers.
5230 @b{-u1} allows multiple interrupts to be handled during hard drive
5231 transactions.  This frees up even more CPU time.
5233 @b{-k1} prevents Linux from resetting your settings in case of a
5234 glitch.
5240 @node DISABLING CRON
5241 @section DISABLING CRON
5243 Linux runs some daily operations like compressing man pages.  These may
5244 be acceptable background tasks while compiling or word processing but
5245 not while playing video.  Disable these operations by editing
5246 @b{/etc/rc.d/init.d/anacron}.
5248 Put @b{exit} before the first line not beginning in @b{#}.
5250 In @b{/etc/rc.d/init.d/crond} put @b{exit} before the first line not
5251 beginning in @b{#}.  Then make like Win 2000 and reboot.
5253 You can't use the @b{at} command anymore, but who uses that command
5254 anyways?
5264 @node REDUCING USB MOUSE SENSITIVITY
5265 @section REDUCING USB MOUSE SENSITIVITY
5267 Gamers like high resolution mice, but this can be painful for precisely
5268 positioning the mouse on a timeline or video screen.  XFree86 once
5269 allowed you to reduce PS/2 mouse sensitivity using commands like
5270 @b{xset m 1 1} but you're out of luck with USB mice or KVM's.
5272 We have a way to reduce USB mouse sensitivity but it requires editing
5273 the kernel source code.  Even though USB mice have been supported for
5274 years, the kernel source code for USB mice is constantly being
5275 rewritten.  These instructions were relevant for 2.6.12.3.  Edit
5276 @b{/usr/src/linux/drivers/input/mousedev.c}.  
5278 After the line saying 
5280 @example
5281 struct mousedev_hw_data @{
5282 @end example
5287 @example
5288 #define DOWNSAMPLE_N 100
5289 #define DOWNSAMPLE_D 350
5290 int x_accum, y_accum;
5291 @end example
5293 Next, the section which says something like:
5295 @example
5296         switch (code) @{
5297                 case REL_X:     mousedev->packet.dx += value; break;
5298                 case REL_Y:     mousedev->packet.dy -= value; break;
5299                 case REL_WHEEL: mousedev->packet.dz -= value; break;
5300         @}
5301 @end example
5303 must be replaced by
5305 @example
5307         switch (code) @{
5308                 case REL_X:
5309                         mousedev->packet.x_accum += value * DOWNSAMPLE_N;
5310                         mousedev->packet.dx += (int)mousedev->packet.x_accum / (int)DOWNSAMPLE_D;
5311                         mousedev->packet.x_accum -= ((int)mousedev->packet.x_accum / (int)DOWNSAMPLE_D) * (int)DOWNSAMPLE_D;
5312                         break;
5313                 case REL_Y:
5314                         mousedev->packet.y_accum += value * DOWNSAMPLE_N;
5315                         mousedev->packet.dy -= (int)mousedev->packet.y_accum / (int)DOWNSAMPLE_D;
5316                         mousedev->packet.y_accum -= ((int)mousedev->packet.y_accum / (int)DOWNSAMPLE_D) * (int)DOWNSAMPLE_D;
5317                         break;
5318                 case REL_WHEEL: mousedev->packet.dz -= value; break;
5319         @}
5323 @end example
5325 Change the value of @b{DOWNSAMPLE_N} to change the mouse sensitivity.
5334 @node ASSORTED X TWEEKS
5335 @section ASSORTED X TWEEKS
5338 XFree86 by default can't display Cinelerra's advanced pixmap rendering
5339 very fast.  The X server stalls during list box drawing.  Fix this by
5340 adding a line to your XF86Config* files.
5342 In the @b{Section "Device"} area, add a line saying:
5344 @b{Option "XaaNoOffscreenPixmaps"}
5346 and restart the X server.
5350 Screen blanking is really annoying, unless you're fabulously rich and
5351 can afford to leave your monitor on 24 hours a day without power saving
5352 mode.  In @b{/etc/X11/xinit/xinitrc} put 
5354 @example
5355 xset s off
5356 xset s noblank
5357 @end example
5359 before the first @b{if} statement.
5361 How about those windows keys which no Linux distribution even thinks to
5362 use.  You can make the window keys provide ALT functionality by editing
5363 @b{/etc/X11/Xmodmap}.  Append the following to it.
5365 @example
5366 keycode 115 = Hyper_L
5367 keycode 116 = Hyper_R
5368 add mod4 = Hyper_L
5369 add mod5 = Hyper_R
5370 @end example
5372 The actual changes to a window manager to make it recognize window keys
5373 for ALT are complex.  In @b{FVWM} at least, you can edit
5374 @b{/etc/X11/fvwm/system.fvwm2rc} and put
5376 @example
5377 Mouse 0 T A move-and-raise-or-raiselower
5378 #Mouse 0 W M move
5379 Mouse 0 W 4 move
5380 Mouse 0 W 5 move
5381 Mouse 0 F A resize-or-raiselower
5382 Mouse 0 S A resize-or-raiselower
5383 @end example
5385 in place of the default section for moving and resizing.  Your best
5386 performance is going to be on FVWM.  Other window managers seem to slow
5387 down video with extra event trapping and aren't as efficient in layout.
5399 @node SPEEDING UP THE FILE SYSTEM
5400 @section SPEEDING UP THE FILE SYSTEM
5402 You'll often store video on an expensive, gigantic disk array separate
5403 from your boot disk.  You'll thus have to manually install an EXT
5404 filesystem on this disk array, using the @b{mke2fs} command.  By far
5405 the fastest file system is 
5407 @example
5409 mke2fs -i 65536 -b 4096 my_device
5410 tune2fs -r0 -c10000 my_device
5412 @end example
5414 This has no journaling, reserves as few blocks as possible for
5415 filenames, and accesses the largest amount of data per block possible.
5416 A slightly slower file system, which is easier to recover after power
5417 failures is
5419 @example
5421 mke2fs -j -i 65536 -b 4096 my_device
5422 tune2fs -r0 -c10000 my_device
5424 @end example
5426 This adds a journal which slows down the writes but makes us immune to
5427 power failures.
5435 @node IMPROVING ZORAN VIDEO
5436 @section IMPROVING ZORAN VIDEO
5438 Video recorded from the ZORAN inputs is normally unaligned or not
5439 completely encoded on the right.  This can be slightly compensated by
5440 adjusting parameters in the driver sourcecode.
5442 In @b{/usr/src/linux/drivers/media/video/zr36067.c} the structures
5443 defined near line 623 affect alignment.  At least for NTSC, the 2.4.20
5444 version of the driver could be improved by changing 
5446 @example
5447 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 16 @};
5448 @end example
5452 @example
5453 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 17 @};
5454 @end example
5457 In @b{/usr/src/linux/drivers/media/video/bt819.c} more structures near
5458 line 76 affect alignment and encoding.
5460 For NTSC 
5462 @example
5463 @{858 - 24, 2, 523, 1, 0x00f8, 0x0000@},
5464 @end example
5466 could be changed to 
5467 @example
5468 @{868 - 24, 2, 523, 1, 0x00f8, 0x0000@},
5469 @end example
5471 Adjusting these parameters may or may not move your picture closer to
5472 the center.  More of the time, they'll cause the driver to lock up
5473 before capturing the first frame.
5476 @subsection NEW IN 2.6.5
5478 In the 2.6 kernels, the video subsystem was rewritten again from
5479 scratch.  To adjust the Zoran parameters go to
5480 @b{drivers/media/video/zoran_card.c} and look for a group of lines like
5482 @example
5483 static struct tvnorm f50sqpixel = @{ 944, 768, 83, 880, 625, 576, 16 @};
5484 static struct tvnorm f60sqpixel = @{ 780, 640, 51, 716, 525, 480, 12 @};
5485 static struct tvnorm f50ccir601 = @{ 864, 720, 75, 804, 625, 576, 18 @};
5486 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 16 @};
5488 static struct tvnorm f50ccir601_lml33 = @{ 864, 720, 75+34, 804, 625, 576, 18 @};
5489 static struct tvnorm f60ccir601_lml33 = @{ 858, 720, 57+34, 788, 525, 480, 16 @};
5491 /* The DC10 (57/16/50) uses VActive as HSync, so HStart must be 0 */
5492 static struct tvnorm f50sqpixel_dc10 = @{ 944, 768, 0, 880, 625, 576, 0 @};
5493 static struct tvnorm f60sqpixel_dc10 = @{ 780, 640, 0, 716, 525, 480, 12 @};
5495 /* FIXME: I cannot swap U and V in saa7114, so i do one
5496  * pixel left shift in zoran (75 -> 74)
5497  * (Maxim Yevtyushkin <max@@linuxmedialabs.com>) */
5498 static struct tvnorm f50ccir601_lm33r10 = @{ 864, 720, 74+54, 804, 625, 576, 18 @};
5499 static struct tvnorm f60ccir601_lm33r10 = @{ 858, 720, 56+54, 788, 525, 480, 16 @};
5500 @end example
5502 These seem to control the image position.  At least for the LML33 the
5503 following definition for @b{f60ccir601_lml33} does the trick.
5505 @example
5506 static struct tvnorm f60ccir601_lml33 = @{ 858, 720, 67+34, 788, 525, 480, 13 @};
5507 @end example
5514 @node TROUBLESHOOTING
5515 @chapter TROUBLESHOOTING
5518 @menu
5519 * BUZ DRIVER CRASHES::
5520 * DRAGGING IN AND OUT POINTS DOESN'T WORK::
5521 * LOCKING UP WHEN LOADING FILES::
5522 * SYNCHRONIZATION LOST WHILE RECORDING::
5523 * APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK::
5524 @end menu
5526 @node BUZ DRIVER CRASHES
5527 @section BUZ DRIVER CRASHES
5529 First, Zoran capture boards must be accessed using the @b{Buz} video
5530 driver in @b{Preferences->Recording} and @b{Preferences->Playback}. 
5531 Some performance tweeks are available in another section. 
5532 @xref{IMPROVING PERFORMANCE}.
5534 Once tweeked, the Buz driver seems to crash if the number of recording
5535 buffers is too high.  Make sure @b{Preferences->Recording->Frames to
5536 buffer in device} is below 10.
5539 @node DRAGGING IN AND OUT POINTS DOESN'T WORK
5540 @section DRAGGING IN AND OUT POINTS DOESN'T WORK
5543 Sometimes there will be two edits really close together.  The point
5544 selected for dragging may be next to the indended edit on an edit too
5545 small to see at the current zoom level.  Zoom in horizontally.
5549 @node LOCKING UP WHEN LOADING FILES
5550 @section LOCKING UP WHEN LOADING FILES
5553 The most common reason loading files locks up is because the codec
5554 isn't supported.  Another reason is because Cinelerra is building
5555 picons for the Resources window.  If you load a large number of images,
5556 it needs to decompress every single image to build a picon.  Go into
5557 settings->preferences->interface and disable @b{Use thumbnails in
5558 resource window} to skip this process.
5564 @node SYNCHRONIZATION LOST WHILE RECORDING
5565 @section SYNCHRONIZATION LOST WHILE RECORDING
5567 If the framerate of the recording is much lower than the framerate of
5568 the source, the video will accumulate in the recording buffers over
5569 time while the audio and video are well out of sync.  Decrease the
5570 @b{number of frames to buffer in the device} in
5571 @b{preferences->recording} so the excess frames are dropped instead of
5572 buffered.
5574 @node APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK
5575 @section APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK
5577 The linearize effect uses the pow function while the blur effect uses a
5578 number of exp functions in the math library.  For some reason, using
5579 the pow function breaks later calls to the exp functions in the math
5580 library.  You need to apply linearize after blur to get it to work.
5591 @node SECRETS OF CINELERRA
5592 @chapter SECRETS OF CINELERRA
5594 In this section, you'll find ways to apply Cinelerra to common
5595 problems.  Other sections are arranged in order of the tools and what
5596 the tools are used for.  This section is arranged in order of the
5597 problems and what tools are used to solve the problems.
5599 @menu
5600 * DOLBY PRO LOGIC ENCODING::
5601 * ANALOG TV CLEANING::
5602 * DEFEATING INTERLACING::
5603 * MAKING VIDEO LOOK LIKE FILM::
5604 * CLEARING OUT HAZE::
5605 * MAKING A DVD::
5606 * MAKING A RINGTONE::
5607 * TIME STRETCHING AUDIO::
5608 * PITCH SHIFTING AUDIO::
5609 @end menu
5612 @node DOLBY PRO LOGIC ENCODING
5613 @section DOLBY PRO LOGIC ENCODING
5615 Dolby pro logic is an easy way to output 6 channel audio from a 2
5616 channel soundcard with degraded but useful results.  Rudimentary Dolby
5617 pro logic encoding can be achieved with clever usage of the effects.
5619 Create 2 audio tracks with the same audio.  Apply @b{invert audio} to
5620 one track.  The signal comes out of the back speakers.
5622 Create a single audio track with monaural audio of a different source. 
5623 Center it in the @b{pan} control.  The signal comes out of the center
5624 speaker.
5626 Create other tracks with different signals and pan them left or right
5627 to put signals in the front left or right speaker.
5629 Finally, if a copy of the signal in the back speakers is desired in any
5630 single front speaker, the signal in the back speakers must be delayed
5631 by at least 0.05 seconds and a single new track should be created.  Pan
5632 the new track to orient the signal in the front speakers.
5634 If the same signal is desired in all the speakers except the center
5635 speaker, delay the back speakers by 0.5 seconds and delay either the
5636 front left or front right by 0.2 seconds.
5638 If you want to hear something from the subwoofer, create a new track,
5639 select a range, drop a synthesizer effect, and set the frequency below
5640 60 Hz.  The subwoofer merely plays anything below around 60Hz.
5642 Other tricks you can perform to separate the speakers are parametric
5643 equalization to play only selected ranges of frequencies through
5644 different speakers and lowpass filtering to play signals through the
5645 subwoofer.
5650 @node ANALOG TV CLEANING
5651 @section ANALOG TV CLEANING
5654 Unless you live in a rich nation like China or are a terrorist, you
5655 probably record analog TV more than you record digital TV.  The picture
5656 quality on analog TV is horrible but you can do things in Cinelerra to
5657 make it look more like it did in the studio.
5659 First, when capturing the video, capture it in the highest resolution
5660 possible.  For Europeans it's 720x576 and for Americans it's 720x480. 
5661 Don't bother adjusting the brightness or contrast in the recording
5662 monitor, although maxing out the color is useful.  Capture it using
5663 MJPEG or uncompressed Component Video if possible.  If those are too
5664 demanding, then capture it using JPEG.  RGB should be a last resort.
5666 Now on the timeline use @b{Settings->Format} to set a YUV colorspace. 
5667 Drop a @b{Downsample} effect on the footage.  Set it for 
5669 @example
5670 Horizontal:        2
5671 Horizontal offset: 0
5672 Vertical:          2
5673 Vertical offset:   0
5675       red
5676   x   green
5677   x   blue
5678       alpha
5679 @end example
5681 Use the camera tool to shift the picture up or down a line to remove
5682 the most color interference from the image.  This is the difference
5683 we're looking for:
5685 @sp 1
5687 @image{cleaning1}
5689 If you have vertical blanking information or crawls which constantly
5690 change in each frame, block them out with the @b{Mask} tool.  This
5691 improves compression ratios.
5693 This is about all you can do without destroying more data than you
5694 would naturally lose in compression.  The more invasive cleaning
5695 techniques involve deinterlacing.
5701 @node DEFEATING INTERLACING
5702 @section DEFEATING INTERLACING
5705 Interlacing is done on most video sources because it costs too much to
5706 build progressive scanning cameras and progressive scanning CRT's. 
5707 Many a consumer has been dissapointed to spend 5 paychecks on a
5708 camcorder and discover what horrible jagged images it produces on a
5709 computer monitor.
5711 As for progressive scanning camcorders, forget it.  Cost factors are
5712 probably going to keep progressive scanning cameras from ever equalling
5713 the spatial resolution of interlaced cameras.  Interlacing is here to
5714 stay.  That's why they made deinterlacing effects in Cinelerra.
5716 We don't believe there has ever been a perfect deinterlacing effect. 
5717 They're either irreversible or don't work.  Cinelerra cuts down the
5718 middle by providing deinterlacing tools that are irreversible sometimes
5719 and don't work sometimes but are neither one or the other.
5721 @b{Line Doubling}
5723 This one is done by the @b{Deinterlace} effect when set to @b{Odd
5724 lines} or @b{Even lines}.  When applied to a track it reduces the
5725 vertical resolution by 1/2 and gives you progressive frames with
5726 stairstepping.  This is only useful when followed by a scale effect
5727 which reduces the image to half its size.
5729 @b{Line averaging}
5731 The @b{Deinterlace} effect when set to @b{Average even lines} or
5732 @b{Average odd lines} does exactly what line doubling does except
5733 instead of making straight copies of the lines it makes averages of the
5734 lines.  This is actually useful for all scaling.
5736 There's an option for adaptive line averaging which selects which lines
5737 to line average and which lines to leave interlaced based on the
5738 difference between the lines.  It doesn't work.
5740 @b{Inverse Telecine}
5742 This is the most effective deinterlacing tool when the footage is an
5743 NTSC TV broadcast of a film.  @xref{INVERSE TELECINE}.
5746 @b{Time base correction}
5748 The first three tools either destroy footage irreversibly or don't work
5749 sometimes.  @b{Time base correction} is last because it's the perfect
5750 deinterlacing tool.  It leaves the footage intact.  It doesn't reduce
5751 resolution, perceptually at least.  It doesn't cause jittery timing.
5753 The @b{Frames to Fields} effect converts each frame to two frames, so
5754 it must be used on a timeline whose project frame rate is twice the
5755 footage's frame rate.  In the first frame it puts a line averaged copy
5756 of the even lines.  In the second frame it puts a line averaged copy of
5757 the odd lines.  When played back at full framerates it gives the
5758 illusion of progressive video with no loss of detail.
5760 Best of all, this effect can be reversed with the @b{Fields to frames}
5761 effect.  That one combines two frames of footage back into the one
5762 original interlaced frame of half the framerate.
5764 Be aware that frames to fields inputs frames at half the framerate as
5765 the project.  Effects before frames to fields process at the reduced
5766 framerate.
5768 Unfortunately, the output of @b{Frames to Fields} can't be compressed
5769 as efficiently as the original because it introduces vertical twitter
5770 and a super high framerate.
5772 Interlaced 29.97fps footage can be made to look like film by applying
5773 @b{Frames to Fields} and then reducing the project frame rate of the
5774 resulting 59.94fps footage to 23.97fps.  This produces no timing jitter
5775 and the occasional odd field gives the illusion of more detail than
5776 there would be if you just line averaged the original.
5779 @b{HDTV exceptions}
5781 1920x1080 HDTV is encoded a special way.  If it's a broadcast of
5782 original HDTV film, an inverse telecine works fine.  If it's a
5783 rebroadcast of a 720x480 source, you need to use a time base and line
5784 doubling algorithm to deinterlace it, @xref{1080 TO 480}.
5789 @node MAKING VIDEO LOOK LIKE FILM
5790 @section MAKING VIDEO LOOK LIKE FILM
5795 Video sweetening is constantly getting better.  Lately the best thing
5796 you can do for dirt cheap consumer camcorder video is to turn it into
5797 progressive 24fps output.  While you can't really do that, you can get
5798 pretty close for the money.  Mind you, this procedure can degrade high
5799 quality video just as easily as it improves low quality video.  It
5800 should only be used for low quality video.
5802 @itemize
5804 @item
5806 Step 1 - Set project framerate to twice the video framerate.
5808 @item
5810 Step 2 - Apply a @b{Sharpen} effect.  Set it to sharpness: 25, no
5811 interlacing, and horizontal only.
5813 @item
5815 Step 3 - Drop a @b{Frame to Fields} effect on the same track.  Set
5816 Average Empty Rows on and play through the video a few times to figure
5817 out which field is first.  If the wrong field is first, the motion is
5818 shaky.  Secondly, any editing in the doubled frame rate may now screw
5819 up the field order.  We're still figuring out the easiest way to
5820 support warnings for field glitches but for now you need to go back to
5821 the normal framerate to do editing or play test to make sure the fields
5822 are right.
5825 @item
5827 Step 4 - Render just the video to the highest quality file possible.
5829 @item
5831 Step 5 - Import the video back to a new track.  Set the project
5832 framerate to 24.  The new track should now display more filmish and
5833 sharper images than the original footage.
5835 @end itemize
5837 This entire procedure could be implemented in one nonrealtime effect,
5838 but the biggest problem with that is you'll most often want to keep the
5839 field based output and the 24fps output for posterity.  A nonrealtime
5840 effect would require all that processing just for the 24fps copy. 
5841 Still debating that one.
5851 @node CLEARING OUT HAZE
5852 @section CLEARING OUT HAZE
5854 Let's face it, if you're employed you live in Silicon Valley.  As such
5855 you probably photograph a lot of haze and never see blue sky ever. 
5856 Even if you can afford to briefly go somewhere where there is blue sky,
5857 horizon shots usually can stand for more depth.  This is what the
5858 @b{gradient effect} is for.
5860 Drop the gradient effect on hazy tracks.  Set the following parameters:
5862 @example
5863 Angle: 0
5864 Inner radius: 0
5865 Outer radius: 40
5866 Inner color: blue 100% alpha
5867 Outer color: blue 0% alpha
5868 @end example
5870 It's important to set the 0% alpha color to blue even though it's 0%
5871 alpha.  The color of the outer alpha is still interpolated with the
5872 inner color.  This is a generally applicable setting for the gradient. 
5873 Some scenes may work better with orange or brown for an evening feel.
5881 @node MAKING A DVD
5882 @section MAKING A DVD
5884 @b{A single chapter DVD}
5886 Make a single chapter DVD by rendering video to an MPEG video file. 
5887 The video should be 720x480, 29.97fps.  The aspect ratio should be 16x9
5888 or 4x3.
5890 Use the YUV 4:2:0 color model and DVD preset.  Set the bitrate to the
5891 desired bitrate.  It's not clear exactly what other parameters the MPEG
5892 encoder uses in the DVD preset but we've enabled the following:
5894 @example
5895 Derivative: MPEG-2
5896 Fixed bitrate
5897 I frame distance: 15
5898 P frame distance: 0
5899 Sequence start codes in every GOP
5900 @end example
5902 Render the audio to an AC3 audio file.  Any bitrate can be used.
5904 @b{Dvdrtools} must be downloaded to generate the actual DVD
5905 filesystem.  The actual usage of dvdrtools changes frequently but
5906 currently it involves the mkisofs and ifogen programs.  Mkisofs is
5907 built automatically in dvdrtools but ifogen may have to be built
5908 manually by entering the @b{video} directory and running @b{make
5909 ifogen}.  Mkisofs and ifogen must be put into /usr/bin manually.
5911 Also, the @b{mplex} program from @b{mjpegtools} must be installed.  The
5912 mjpegtools package is built in the hvirtual distribution and the mplex
5913 utility may be extracted from there.
5915 Given the files audio.ac3 and video.m2v, rendered by Cinelerra, the
5916 following commands pack them into a dvd readable by commercial
5917 appliances.
5919 @example
5920 mplex -M -f 8 -o final.mpg audio.ac3 video.m2v
5921 mkdir -p dvd/VIDEO_TS
5922 ifogen final.mpg -o dvd
5923 ifogen -T -o dvd
5924 mkisofs -dvd-video -udf -o dvd.iso dvd/
5925 @end example
5927 dvd.iso can be burned directly to a DVD with the following:
5929 @example
5930 dvdrecord -ignsize -dao -v dev=0,0,0 fs=67108864 dvd.iso
5931 @end example
5933 The argument to dev= is determined by running @b{dvdrecord -scanbus}
5934 and picking the right 3 digit device number.  This also requires
5935 interfacing the DVD drive through the scsi modules @b{ide-scsi, cdrom,
5936 sg}.
5945 @node MAKING A RINGTONE
5946 @section MAKING A RINGTONE
5948 This is how we made ringtones for the low end Motorola V180's and it'll
5949 probably work with any new phone.  Go to @b{File->Load files...} and
5950 load a sound file with Insertion strategy: @b{Replace current
5951 project}.  Go to @b{Settings->Format} change @b{Channels} to 1 and
5952 @b{Samplerate} to 16000 or 22050.
5954 Either highlight a region of the timeline or set in/out points to use
5955 for the ringtone.  To improve sound quality on the cell phone, you need
5956 the maximum amplitude in as many parts of the sound as possible.  Right
5957 click on track Audio 1 and select @b{Attach effect..}.  Highlight the
5958 @b{Compressor} effect and hit @b{Attach} in the attachment popup.
5960 Make sure the insertion point or highlighted area is in the region with
5961 the Compressor effect. Right click on track Audio 2 and select
5962 @b{Attach effect..}.  Highlight @b{Audio 1: Compressor} and hit
5963 @b{Attach}.  Click the Audio1 Compressor's magnifying glass
5964 @image{magnify} to bring up the compressor GUI.
5966 Set the following parameters:
5968 @example
5969 Reaction secs: @b{-0.1}
5970 Decay secs: @b{0.1}
5971 Trigger Type: @b{Total}
5972 Trigger: @b{0}
5973 Smooth only: @b{No}
5974 @end example
5977 Click @b{Clear} to clear the graph.  Click anywhere in the
5978 grid area and drag a new point to 0 Output and -50 Input.  The graph
5979 should look like this.
5981 @sp 1
5982 @image{compress}
5984 Go to @b{File->Render}.  Specify the name of an mp3 file to output to. 
5985 Set the file format to @b{MPEG Audio}.  Click the wrench @image{wrench}
5986 for Audio and set @b{Layer} to @b{III} and @b{Kbits per second} to
5987 @b{24} or @b{32}.  Check @b{Render audio tracks} and uncheck @b{Render
5988 video tracks}.  Hit OK to render the file.
5990 The resulting .mp3 file must be uploaded to a web server.  Then, the
5991 phone's web browser must download the .mp3 file directly from the URL.
5992 There also may be a size limit on the file.
6000 @node TIME STRETCHING AUDIO
6001 @section TIME STRETCHING AUDIO
6003 It may appear that time stretching audio is a matter of selecting a
6004 region of the audio tracks, enabling recording for the desired tracks,
6005 going to @b{Audio->Render Effect}, and applying @b{Time Stretch}.  In
6006 actuality there are 3 audio effects for time stretching: @b{Time
6007 Stretch}, @b{Resample}, and @b{Asset info dialog}.
6009 Time Stretch applies a fast fourier transform to try to change the
6010 duration without changing the pitch, but this introduces windowing
6011 artifacts to the audio.  It's only useful for large changes in time
6012 because obvious changes in duration make windowing artifacts less
6013 obtrusive.
6015 For smaller changes in duration, in the range of 5%, @b{Resample}
6016 should be used.  This changes the pitch of the audio but small enough
6017 changes aren't noticable.  Resample doesn't introduce any windowing
6018 artifacts, so this is most useful for slight duration changes where the
6019 listener isn't supposed to know what's going on.
6021 Another way to change duration slightly is to go to the @b{Resources}
6022 window, highlight the @b{media} folder, right click on an audio file,
6023 click on @b{Info}.  Adjust the sample rate in the @b{Info} dialog to
6024 adjust the duration.  This method also requires left clicking on the
6025 right boundary of the audio tracks and dragging left or right to
6026 correspond to the length changes.
6029 @node PITCH SHIFTING AUDIO
6030 @section PITCH SHIFTING AUDIO
6032 Like the time stretching methods, there are three pitch shifting
6033 methods: @b{Pitch shift}, @b{Resample}, and @b{Asset info dialog}. 
6034 Pitch shift is a realtime effect which can be dragged and dropped onto
6035 recordable audio tracks.  Pitch shift uses a fast fourier transform to
6036 try to change the pitch without changing the duration, but this
6037 introduces windowing artifacts.
6039 Because the windowing artifacts are less obtrusive in audio which is
6040 obvously pitch shifted, Pitch shift is mainly useful for extreme pitch
6041 changes.  For mild pitch changes, use @b{Resample} from the
6042 @b{Audio->Render Effect} interface.  Resample can change the pitch
6043 within 5% without a noticable change in duration.
6045 Another way to change pitch slightly is to go to the @b{Resources}
6046 window, highlight the @b{media} folder, right click on an audio file,
6047 click on @b{Info}.  Adjust the sample rate in the @b{Info} dialog to
6048 adjust the pitch.  This method also requires left clicking on the right
6049 boundary of the audio tracks and dragging left or right to correspond
6050 to the length changes.
6059 @node SECRETS OF CINELERRA EFFECTS
6060 @chapter SECRETS OF CINELERRA EFFECTS
6062 Most effects in Cinelerra can be figured out just by using them and
6063 tweeking.  Here are brief descriptions of effects which you might not
6064 utilize fully by mere experimentation.
6067 @menu
6068 * 1080 TO 480::       How to convert HDTV into SD
6069 * CHROMA KEY::        Create transparency based on color similarities.
6070 * COMPRESSOR::        How to reduce the dynamic range of audio.
6071 * DECIMATE::          How to reduce frame rates by eliminating similar frames.
6072 * DEINTERLACE::       How to convert interlaced video to progressive video.
6073 * DIFFERENCE KEY::    Create transparency based on color differences.
6074 * FIELDS TO FRAMES::  How to recover interlaced video from bobbed video
6075 * FREEZE FRAME::      How to stop action in the timeline.
6076 * HISTOGRAM::         How to change the mapping of different brightness values.
6077 * INVERSE TELECINE::  How to convert pulled down frames to progressive frames.
6078 * INTERPOLATE VIDEO:: How to create the illusion of higher framerates.
6079 * LINEARIZE::         Fix gamma in raw camera images
6080 * LOOP::              How to loop regions of the timeline.
6081 * MOTION::            The art of motion tracking.
6082 * REFRAMERT::         Changing the number of frames in a sequence.
6083 * REFRAME::           Changing the number of frames in a sequence with rendering.
6084 * RESAMPLE::          Change the number of samples in a sequence with rendering.
6085 * REVERSE VIDEO/AUDIO:: How to play regions in reverse.
6086 * THRESHOLD::         How to get monochrome out of a region of the image.
6087 * TIME AVERAGE::      How to add trail patterns or increase still image quality.
6088 * TITLER::            How to add text to a track from inside Cinelerra.
6089 * VIDEO SCOPE::       How to view the dynamic range of intensity and hue.
6090 @end menu
6095 @node 1080 TO 480
6096 @section 1080 TO 480
6099 Most TV broadcasts are recieved with a 1920x1080 resolution but
6100 originate from a 720x480 source at the studio.  It's a waste of space
6101 to compress the entire 1920x1080 if the only resolvable details are
6102 720x480.  Unfortunately resizing 1920x1080 video to 720x480 isn't as
6103 simple as shrinking it.
6105 At the TV station the original 720x480 footage was first converted to
6106 fields of 720x240.  Each field was then scaled up to 1920x540.  The two
6107 1920x540 fields were finally combined with interlacing to form the
6108 1920x1080 image.  This technique allows a consumer TV to display the
6109 resampled image without extra circuitry to handle 720x480 interlacing
6110 in a 1920x1080 image.
6112 If you merely deinterlaced the 1920x1080 images, you would end up with
6113 resolution of 720x240.  The @b{1080 to 480} effect properly extracts
6114 two 1920x540 size fields from the image, resizes them separately, and
6115 combines them again to restore a 1920x480 interlaced image.  The
6116 @b{scale} effect must then be applied to reduce the horizontal size to
6117 960 or 720 depending on the original aspect ratio.
6119 The tracks to which @b{1080 to 480} is applied need to be at 1920x1080
6120 resolution.  The project settings in @b{settings->format} should be at
6121 least 720x480 resolution.
6123 The effect doesn't know if the first row in the 1920x1080 image belongs
6124 to the first row of the 720x480 original.  You have to specify what the
6125 first row is in the effect configuration.
6127 The output of this effect is a small image in the middle of the
6128 original 1920x1080 frame.  Use the projector to center the output image
6129 in the playback.
6131 Finally, once you have 720x480 interlaced video you can either apply
6132 @b{frames to fields} of @b{inverse telecine} to further recover original
6133 progressive frames.
6141 @node CHROMA KEY
6142 @section CHROMA KEY
6145 This effect erases pixels which match the selected color.  They are
6146 replaced with black if there is no alpha channel and transparency if
6147 there is an alpha channel.  The selection of color model is important
6148 to determine the behavior.
6150 Chroma key uses either the lightness or the hue to determine what is
6151 erased.  @b{Use value} singles out only the lightness to determine
6152 transparency.  Select a center color to erase using the @b{Color}
6153 button.  Alternatively a color can be picked directly from the output
6154 frame by first using the @b{color picker} in the compositor window and
6155 then selecting the @b{Use color picker} button.  This sets the chroma
6156 key color to the current color picker color.
6158 Be aware that the output of the chroma key is fed back to the
6159 compositor, so selecting a color again from the compositor will use the
6160 output of the chroma key effect.  The chroma key should be disabled
6161 when selecting colors with the color picker.
6164 If the lightness or hue is within a certain threshold it's erased. 
6165 Increasing the threshold determines the range of colors to be erased. 
6166 It's not a simple on/off switch, however.  As the color approaches the
6167 edge of the threshold, it gradually gets erased if the slope is high or
6168 is rapidly erased if the slope is low.  The slope as defined here is
6169 the number of extra values flanking the threshold required to go from
6170 opaque to transparent.
6172 Normally threshold is very low when using a high slope.  The two
6173 parameters tend to be exclusive because slope fills in extra threshold.
6175 The slope tries to soften the edges of the chroma key but it doesn't
6176 work well for compressed sources.  A popular softening technique is to
6177 use a maximum slope and chain a blur effect below the chroma key effect
6178 to blur just the alpha.
6188 @node COMPRESSOR
6189 @section COMPRESSOR
6191 Contrary to computer science experience, the audio compressor does not
6192 reduce the amount of data required to store the audio.  The audio
6193 compressor reduces the dynamic range of the audio.  In Cinelerra the
6194 compressor actually performs the function of an expander and
6195 compressor.
6197 The compressor works by calculating the maximum sound level within a
6198 certain time period of the current position.  The maximum sound level
6199 is taken as the input sound level.  For every input sound level there
6200 is an output sound level specified by the user.  The gain at the
6201 current position is adjusted so the maximum sound level in the time
6202 range is the user specified value.
6204 The compressor has a graph which correlates every input sound level to
6205 an output level.  The horizontal direction is the input sound level in
6206 dB.  The vertical direction is the ouptut sound level in dB.  The user
6207 specifies output sound levels by creating points on the graph.  Click
6208 in the graph to create a point.  If 2 points exist, drag one point
6209 across another point to delete it.  The most recent point selected has
6210 its vales displayed in textboxes for more precise adjustment.
6212 To make the compressor reduce the dynamic range of the audio, make all
6213 the output values greater than the input values except 0 db.  To make
6214 the compressor expand the dynamic range of the audio, make all the
6215 output values except 0 db less than the input values.  The algorithm
6216 currently limits all sound levels above 0 db to 0 db so to get an
6217 overloaded effect put a gain effect before the compressor to reduce all
6218 the levels and follow it with another gain effect to amplify all the
6219 levels back over 0 db.
6221 @b{Reaction secs:} This determines where in relation to the current
6222 position the maximum sound level is taken and how fast the gain is
6223 adjusted to reach that peak.  It's notated in seconds.  If it's
6224 negative the compressor reads ahead of the current position to get the
6225 future peak.  The gain is ramped to that peak over one reaction time. 
6226 This allows it to hit the desired output level exactly when the input
6227 peak occurs at the current position.
6229 If the reaction time is positive the compressor scans only the current
6230 position for the gain and ramps gain over one reaction time to hit the
6231 desired output level.  It hits the output level exactly one reaction
6232 time after detecting the input peak.
6234 @b{Decay secs:} If the peak is higher than the current level, the
6235 compressor ramps the gain up to the peak value.  Then if a future peak
6236 is less than the current peak it ramps the gain down.  The time taken
6237 to ramp the gain down can be greater than the time taken to ramp the
6238 gain up.  This ramping down time is the decay seconds.
6240 @b{Trigger type:}  The compressor is a multichannel effect.  Several
6241 tracks can share one compressor.  How the signal from many tracks is
6242 interpreted is determined by the trigger type.
6246 @b{Trigger:} The compressor is a multichannel effect.  Several tracks
6247 can share one compressor.  Normally only one track is scanned for the
6248 input peak.  This track is specified by the @b{Trigger}.  By sharing
6249 several tracks and playing with the trigger value, you can make a sine
6250 wave on one track follow the amplitude of a drum on another track for
6251 example.
6253 @b{Smooth only:} For visualizing what the compressor is doing to the
6254 soundlevel, this option causes it to replace the soundwave with just
6255 the current peak value.  It makes it very easy to see how @b{reaction
6256 secs} affects the detected peak values.
6264 @node DECIMATE
6265 @section DECIMATE
6267 This effect drops frames from a track which are most similar in order
6268 to reduce the frame rate.  This is usually applied to a DVD to convert
6269 the 29.97 fps video to the 23.97 fps film rate but this decimate effect
6270 can take any input rate and convert it to any lower output rate.
6272 The output rate of @b{decimate} is the project frame rate.  The input
6273 rate is set in the @b{decimate} user interface.  To convert 29.97fps
6274 progressive video to 23.97fps film, apply a decimate effect to the
6275 track.  Set the decimate input rate to 29.97 and the project rate to
6276 23.97.
6278 Be aware every effect layered before decimate processes video at the
6279 decimate input rate and every effect layered after decimate processes
6280 video at the project frame rate.  Computationally intensive effects
6281 should come below decimate.
6290 @node DEINTERLACE
6291 @section DEINTERLACE
6293 The deinterlace effect has evolved over the years to deinterlacing and
6294 a whole lot more.  In fact two of the deinterlacing methods, @b{Inverse
6295 Telecine} and @b{Frames to Fields}, are separate effects.  The
6296 deinterlace effect offers several variations of line replication to
6297 eliminate comb artifacts in interlaced video.  It also has some line
6298 swapping tools to fix improperly captured video or make the result of a
6299 reverse effect display fields in the right order.
6308 @node DIFFERENCE KEY
6309 @section DIFFERENCE KEY
6311 The differency key creates transparency in areas which are similar
6312 between 2 frames.  The Difference key effect must be applied to 2
6313 tracks.  One track contains the action in front of a constant
6314 background and another track contains the background with nothing in
6315 front of it.  Apply the difference key to the track with the action and
6316 apply a shared copy of it to the track with the background.  The track
6317 with the background should be muted and underneath the track with the
6318 action and the colormodel should have an alpha channel.
6320 Pixels which are different between the background and action track are
6321 treated as opaque.  Pixels which are similar are treated as
6322 transparent.  Change @b{threshold} in the differency key window to make
6323 more pixels which aren't the same color transparent. Change @b{slope}
6324 to change the rate at which the transparency tapers off as pixels get
6325 more different.
6327 The slope as defined here is the number of extra values flanking the
6328 threshold required to go from opaque to transparent.  A high slope is
6329 more useful with a low threshold because slope fills in extra
6330 threshold.
6332 @b{Use value} causes the intensity of pixels to be compared instead of
6333 the color.
6335 Applying a blur to the top track with just the alpha channel blurred
6336 can soften the transparency border.
6342 @node FIELDS TO FRAMES
6343 @section FIELDS TO FRAMES
6345 This effects reads frames at twice the project framerate, combining 2
6346 input frames into a single interlaced output frame.  Effects preceeding
6347 @b{fields to frames} process frames at twice the project frame rate. 
6348 Each input frame is called a field.
6350 @b{Fields to frames} needs to know what field corresponds to what lines
6351 in the output frame.  The easiest way to figure it out is to try both
6352 options in the window.  If the input fields are the result of a line
6353 doubling process like @b{frames to fields}, the wrong setting results
6354 in blurrier output.  If the input fields are the result of a standards
6355 conversion process like @b{1080 to 480}, the wrong setting won't make
6356 any difference.
6358 The debobber which converts 720x480 interlaced into 1920x1080
6359 interlaced or 1280x720 progressive seems to degrade the vertical
6360 resolution to the point that it can't be recovered.
6368 @node FREEZE FRAME
6369 @section FREEZE FRAME
6371 In its simplest form, highlight a region of the track to freeze, drop
6372 the freeze frame effect on the highlighted region, and the lowest
6373 numbered frame in the affected area will play throughout the entire
6374 region.  
6376 Freezeframe has an @b{enabled} option which can be keyframed.  Regions
6377 of a freeze frame effect which are enabled repeat the lowest numbered
6378 frame since the last keyframe.  This has unique possibilities.
6380 If a freeze frame effect has a keyframe in the middle of it set to
6381 @b{enabled}, the frame in the middle is repeated in the entire effect.
6383 If a freeze frame effect has several keyframes, each set to
6384 @b{enabled}, every time a keyframe is encountered the frame under it
6385 becomes the frozen one.
6387 If a freeze frame effect alternates between @b{enabled} and
6388 @b{disabled}, each time an @b{enabled} keyframe is encountered the
6389 frame under it is replicated until the next @b{disabled} keyframe.  The
6390 disabled regions play through.
6397 @node HISTOGRAM
6398 @section HISTOGRAM
6401 This shows the number of occurances of each value of a certain color
6402 channel on a histogram plot.
6404 It is always performed in floating point RGB regardless of
6405 the project colorspace.  The histogram has two sets of transfer
6406 parameters: the input transfer and the output transfer.
6408 The input transfer is defined by a graph on top of the histogram.  The
6409 horizontal direction corresponds to every possible input color.  The
6410 vertical direction corresponds to the output color for every input
6411 color.  Video entering the histogram is first plotted on the histogram
6412 plot, then it is translated so output values now equal the output
6413 values for each input value on the input graph.
6415 The input graph is edited by adding and removing any number of points. 
6416 Click and drag anywhere in the input graph to create a point and move
6417 it.  Click on an existing point to make it active and move it.  The
6418 active point is always indicated by being filled in.  The active
6419 point's input and output color are given in text boxes on top of the
6420 window.  The input and output color of the point can be changed through
6421 these text boxes.
6423 Points can be deleted by first selecting a point and then dragging it
6424 to the other side of an adjacent point.  They can also be deleted by
6425 selecting them and hitting @b{delete}.
6428 After the input transfer, the image is processed by the output
6429 transfer.  The output transfer is simply a minimum and maximum to scale
6430 the input colors to.  Input values of 100% are scaled down to the
6431 output's maximum.  Input values of 0% are scaled up to the output
6432 minimum.
6435 Input values below 0 are always clamped to 0 and input values above
6436 100% are always clamped to 100%.  Click and drag on the output
6437 gradient's triangles to change it.  It also has textboxes to enter
6438 values into.
6440 Enable the @b{automatic} toggle to have the histogram calculate an
6441 automatic input transfer for every frame.  It does this by setting
6442 minimum and maximum input points to permit only the middle 99% of the
6443 pixels to pass through.  The number of pixels permitted to pass through
6444 is set by the @b{Threshold} textbox.  A threshold of 0.99 scales the
6445 input so 99% of the pixels pass through.  Smaller thresholds permit
6446 fewer pixels to pass through and make the output look more contrasty.
6448 A different automatic input transfer is applied to the R, G, and B
6449 channels but not to the value.
6451 The histogram applies a different set of transfers to R, G, B, and
6452 value.  The value transfers are applied uniformly to R, G, B after
6453 their discrete transfers are applied.  The histogram displayed for the
6454 value transfer is the maximum R, G, or B for every pixel.
6456 Select which transfer to view by selecting one of the channels on the
6457 top of the histogram.
6460 @b{PLOT HISTOGRAM}
6462 @b{SPLIT OUTPUT}
6471 @node INVERSE TELECINE
6472 @section INVERSE TELECINE
6474 This is the most effective deinterlacing tool when the footage is a
6475 video transfer of a film.  Here the film was converted from 24fps to
6476 60fps.  Then the 60fps was downsampled to 30fps by extracting odd and
6477 even lines and interlacing the lines.  The IVTC effect is primarily a
6478 way to convert interlaced video to progressive video.  It undoes three
6479 patterns of interlacing.
6481 @example
6482   A AB BC CD D
6483   AB CD CD DE EF
6484   Automatic
6485 @end example
6487 The first two options are fixed patterns and affected by the @b{pattern
6488 offset} and @b{odd field first} parameters.  The last option creates
6489 several combinations of lines for each frame and picks the most
6490 progressive combination.  It's a brute force algorithm.
6492 This technique doesn't rely on a pattern like other techniques and is
6493 less destructive but the timing is going to be jittery because of the
6494 lack of a frame rate reduction.  In order to smooth out the timing, you
6495 need to follow inverse telecine with a decimate effect.
6501 @node INTERPOLATE VIDEO
6502 @section INTERPOLATE VIDEO
6505 The interpolate video effect tries to create the illusion of a higher
6506 frame rate from source footage of very low framerates by averaging
6507 frames over time.  It averages two input frames for each output frame. 
6508 The input frames are at different times, resulting in a dissolve for
6509 all output frames between the input frames.  There are two ways of
6510 specifying the input frames.  You can specify an input frame rate which
6511 is lower than the project frame rate.  This causes input frames to be
6512 taken at even intervals,
6514 You can also specify keyframe locations as the positions of the input
6515 frames.  In this mode the output frame rate is used as the input frame
6516 rate and you just create keyframes wherever you want to specify an
6517 input frame.
6522 @node LINEARIZE
6523 @section LINEARIZE
6526 Raw camera images store colors in a logarithmic scale.  The blacks in
6527 these images are nearly 0 and the whites are supposed to be infinity. 
6528 The graphics card and most video codecs store colors in a linear scale
6529 but Cinelerra keeps raw camera images in their original logarithmic
6530 scale when it renders them.  This is necessary because the raw image
6531 parser can't always decode the proper gamma values for the images.  It
6532 also does its processing in 16 bit integers, which takes away a lot of
6533 information.
6535 The linearize effect converts the logarithmic colors to linear colors
6536 through a gamma value and a maximum value.  The gamma value determines
6537 how steep the output curve is and the maximum value is where 1.0 in the
6538 output corresponds to maximum brightness in the input.
6540 The linearize effect has 2 more parameters to simplify gamma
6541 correction.  The @b{automatic} option causes it to calculate @b{max}
6542 from the histogram of the image.  Use this when making a preview of a
6543 long list of images since it changes for every image.
6545 The @b{use color picker} option uses the value currently in the color
6546 picker to set the @b{max} value.  Note that every time you pick a color
6547 from the compositor window, you need to hit @b{use color picker} to
6548 apply the new value.
6565 @node LOOP
6566 @section LOOP
6568 Sections of audio or video can be looped by dropping a @b{loop} effect
6569 on them.  Contrary to the the @b{settings->loop playback} option, the
6570 loop effects can be rendered where the @b{settings->loop playback}
6571 option can not be.  The loop effects are also convenient for short
6572 regions.
6574 The loop effects have one option: the number of @b{frames} or
6575 @b{samples} to loop.  This specifies the length of the region to loop
6576 starting from either the beginning of the effect or the latest
6577 keyframe.  The region is replicated for the entire effect.
6579 Every time a keyframe is set in a loop effect, the keyframe becomes the
6580 beginning of the region to loop.  Setting several keyframes in
6581 succession causes several regions to loop.  Setting a single keyframe
6582 causes the region after the keyframe to be looped throughout the
6583 effect, no matter where the keyframe is.  The end of an effect can be
6584 looped from the beginning by setting the keyframe near the end.
6595 @node MOTION
6596 @section MOTION
6598 The motion tracker is almost a complete application in itself.  The
6599 motion tracker tracks two types of motion: translation and rotation. 
6600 It can track both simultaneously or one only.  It can do 1/4 pixel
6601 tracking or single pixel tracking.  It can stabilize motion or cause
6602 one track to follow the motion of another track.
6604 Although the motion tracker is applied as a realtime effect, it usually
6605 must be rendered to see useful results.  The effect takes a long time
6606 to precisely detect motion.
6608 The motion tracker works by using one region of the frame as the region
6609 to track.  It compares this region between 2 frames to calculate the
6610 motion.  This region can be defined anywhere on the screen.  Once the
6611 motion between 2 frames has been calculated, a number of things can be
6612 done with that motion vector.  It can be scaled by a user value and
6613 clamped to a maximum range.  It can be thrown away or accumulated with
6614 all the motion vectors leading up to the current position.
6616 To save time the motion result can be saved for later reuse, recalled
6617 from a previous calculation, or discarded.
6619 The motion tracker has a notion of 2 tracks, the master layer and the
6620 target layer.  The master layer is where the comparison between 2
6621 frames takes place.  The target layer is where motion is applied either
6622 to track or compensate for the motion in the master layer.
6624 The intricacies of motion tracking are enough to sustain entire
6625 companies and build careers around.  The motion tracker in Cinelerra
6626 isn't as sophisticated as some world class motion trackers but it's
6627 enough to sweeten some camcorder footage.
6629 Here is a brief description of the motion tracking parameters:
6631 @itemize
6632 @item
6633 @b{Track translation:} Enables translation operations.  
6634 The motion tracker tracks X and Y motion in the master layer and 
6635 adjusts X and Y motion in the target layer.
6637 @item
6639 @b{Translation block size:} For the translation operations, a block is
6640 compared to a number of neighboring blocks to find the one with the
6641 least difference.  The size of the block to search for is given by this
6642 parameter.
6644 @item
6646 @b{Translation search radius:} The size of the area to scan for the
6647 translation block.
6649 @item
6651 @b{Translation search steps:} Ideally the search operation would
6652 compare the  translation block with every other pixel in the
6653 translation search radius.  To  speed this operation up, a subset of
6654 the total positions is searched.   Then the search area is narrowed and
6655 rescanned by the same number of search steps until the motion is known
6656 to 1/4 pixel accuracy.
6658 @item
6660 @b{Block X, Y:} These coordinates determine the center of the
6661 translation  block based on percentages of the width and height of the
6662 image.  The center of the block should be part of the image which is
6663 visible at all times.
6665 @item 
6667 @b{Maximum absolute offset:} The amount of motion detected by the
6668 motion  tracker is unlimited if this is 100.  If it's under 100 the
6669 amount of motion is limited by that percentage of the image size.
6671 @item
6673 @b{Settling speed:} The motion detected between every frame can be
6674 accumulated to form an absolute motion vector.  If the settling speed
6675 is 100 the absolute vector is added to the next frame.  If the settling
6676 speed is less than 100 the absolute vector is downscaled by the
6677 settling amount before being added to the next frame.
6679 @item
6681 @b{Track rotation:} Enables rotation operations.  The motion tracker
6682 tracks rotation in the master layer and adjusts rotation in the target
6683 layer.
6685 @item
6687 @b{Rotation block size:} For rotation operations a single block is
6688 compared to equally sized blocks, each rotated by a different amount. 
6689 This is the size of the rotation block.
6691 @item
6693 @b{Rotation search radius:} This is the maximum angle of rotation from
6694 the starting frame the rotation scanner can detect.  The rotation scan
6695 is from this angle counterclockwise to this angle clockwise.  Thus the
6696 rotation search radius is half the total range scanned.
6698 @item
6700 @b{Rotation search steps:} Ideally every possible angle would be tested
6701 to get the rotation.  To speed up the rotation search, the rotation
6702 search radius is divided into a finite number of angles and only those
6703 angles compared to the starting frame.  Then the search radius is
6704 narrowed and an equal number of angles is compared in the smaller
6705 radius until the highest possible accuracy is achieved.
6707 Normally you need one search step for every degree scanned.  Since the
6708 rotation scanner scans the rotation search radius in two directions,
6709 you need two steps for every degree in the search radius to search the
6710 complete range.
6712 @item
6714 @b{Draw vectors:} When translation is enabled, 2 boxes are drawn on the
6715 frame.  One box represents the translation block.  Another box outside
6716 the translation block represents the extent of the translation search
6717 radius.  In the center of these boxes is an arrow showing the
6718 translation between the 2 master frames.
6720 When rotation is enabled a single box the size of the rotation block is
6721 drawn rotated by the amount of rotation detected.
6723 @item
6725 @b{Track single frame:} When this option is used the motion between a
6726 single starting frame and the frame currently under the insertion point
6727 is calculated.  The starting frame is specified in the @b{Frame number}
6728 blank.  The motion calculated this way is taken as the absolute motion
6729 vector.  The absolute motion vector for each frame replaces the
6730 absolute motion vector for the previous frame.  Settling speed has no
6731 effect on it since it doesn't contain any previous motion vectors. 
6732 Playback can start anywhere on the timeline since there is no
6733 dependance on previous results.
6735 @item
6737 @b{Track previous frame:} Causes only the motion between the previous
6738 frame and the current frame to be calculated.  This is added to an
6739 absolute motion vector to get the new motion from the start of the
6740 sequence to the current position.  After every frame processed this
6741 way, the block position is shifted to always cover the same region of
6742 the image.  Playback must be started from the start of the motion
6743 effect in order to accumulate all the necessary motion vectors.
6745 @item
6747 @b{Previous frame same block:} This is useful for stabilizing jerky
6748 camcorder footage.  In this mode the motion between the previous frame
6749 and the current frame is calculated.  Instead of adjusting the block
6750 position to reflect the new location of the image, like Track Previous
6751 Frame does, the block position is unchanged between each frame.  Thus a
6752 new region is compared for each frame.
6754 @item
6756 @b{Master layer:} This determines the track which supplies the starting
6757 frame and ending frame for the motion calculation.  If it's @b{Bottom}
6758 the bottom track of all the tracks sharing this effect is the master
6759 layer.  The top track of all the tracks is the target layer.
6761 @item
6763 @b{Calculation:} This determines whether to calculate the motion at all
6764 and whether to save it to disk.  If it's @b{Don't Calculate} the motion
6765 calculation is skipped.  If it's @b{Recalculate} the motion calculation
6766 is performed every time each frame is rendered.  If it's @b{Save} the
6767 motion calculation is always performed but a copy is also saved.  If
6768 it's @b{Load}, the motion calculation is loaded from a previous save
6769 calculation.  If there is no previous save calculation on disk, a new
6770 motion calculation is performed.
6772 @item
6774 @b{Action:} Once the motion vector is known this determines whether to
6775 move the target layer opposing the motion vector or following the
6776 motion vector.  If it's @b{Do Nothing} the target layer is untouched. 
6777 If it's @b{Track...} the target layer is moved by the same amount as
6778 the master layer.  This is useful for matching titles to objects in the
6779 frame.  If it's @b{Stabilize...} the target layer is moved opposite to
6780 the motion vector.  This is useful for stabilizing an object in the
6781 frame.  The motion operations can be accurate to single pixels or
6782 subpixels by changing the action setting.
6788 @end itemize
6792 @menu
6793 * SECRETS OF MOTION TRACKING::
6794 * 2 PASS MOTION TRACKING::
6795 * USING BLUR TO IMPROVE MOTION TRACKING::
6796 * USING HISTOGRAM TO IMPROVE MOTION TRACKING::
6797 @end menu
6800 @node SECRETS OF MOTION TRACKING
6801 @subsection SECRETS OF MOTION TRACKING
6803 Since it is a very slow effect, there is a method to applying the
6804 motion tracker to get the most out of it.  First disable playback for
6805 the track to do motion tracking on.  Then drop the effect on a region
6806 of video with some motion to track.  Then rewind the insertion point to
6807 the start of the region.  Set @b{Action} -> @b{Do Nothing}.  Set
6808 @b{Calculation} -> @b{Don't calculate}.  Enable @b{Draw vectors}. Then
6809 enable playback of the track to see the motion tracking areas.
6811 Enable which of @b{translation motion} or @b{rotation motion} vectors
6812 you want to track.  By watching the compositor window and adjusting the
6813 @b{Block x,y} settings, center the block on the part of the image you
6814 want to track.  Then set search radius, block size, and block
6815 coordinates for translation and rotation.
6817 Once this is configured, set the calculation to @b{Save coords} and do
6818 test runs through the sequence to see if the motion tracker works and
6819 to save the motion vectors.  Once this is done, disable playback for
6820 the track, disable @b{Draw vectors}, set the motion action to perform
6821 on the target layer and change the calculation to @b{Load coords}. 
6822 Finally enable playback for the track.
6824 When using a single starting frame to calculate the motion of a
6825 sequence, the starting frame should be a single frame with the least
6826 motion to any of the other frames.  This is rarely frame 0.  Usually
6827 it's a frame near the middle of the sequence.  This way the search
6828 radius need only reach halfway to the full extent of the motion in the
6829 sequence.
6831 If the motion tracker is used on a render farm, @b{Save coords} and
6832 @b{previous frame} mode won't work.  The results of the save coords
6833 operation are saved to the hard drives on the render nodes, not the
6834 master node.  Future rendering operations on these nodes will process
6835 different frames and read the wrong coordinates from the node
6836 filesystems.  The fact that render nodes only visualize a portion of
6837 the timeline also prevents @b{previous frame} from working since it
6838 depends on calculating an absolute motion vector starting on frame 0.
6840 @node 2 PASS MOTION TRACKING
6841 @subsection 2 PASS MOTION TRACKING
6843 The method described above is 2 pass motion tracking.  One pass is used
6844 just to calculate the motion vectors.  A second pass is used to apply
6845 the motion vectors to the footage.  This is faster than a single pass
6846 because errors in the motion vector calculation can be discovered
6847 quickly.
6849 This also allows the motion tracking to use a less demanding colormodel
6850 like RGB888 in the scanning step and a more demanding colormodel like
6851 RGB Float in the action step.  The scanning step takes much longer than
6852 action.
6854 This suffers the disadvantage of not being practical for extremely long
6855 sequences where some error is acceptable and the picture quality is
6856 lousy to begin with, like stabilizing camcorder footage.
6858 The slower method is to calculate the motion vectors and apply them
6859 simultaneously.  This method can use one track as the motion vector
6860 calculation track and another track as the target track for motion
6861 vector actions.  This is useful for long sequences where some error is
6862 acceptable.
6865 @node USING BLUR TO IMPROVE MOTION TRACKING
6866 @subsection USING BLUR TO IMPROVE MOTION TRACKING
6868 With extremely noisy or interlaced footage, applying a blur effect
6869 before the motion tracking can improve accuracy.  Either save the
6870 motion vectors in a @b{tracking pass} and disable the blur for the
6871 @b{action pass} or apply the blur just to the @b{master layer}.
6874 @node USING HISTOGRAM TO IMPROVE MOTION TRACKING
6875 @subsection USING HISTOGRAM TO IMPROVE MOTION TRACKING
6877 A histogram is almost always applied before motion tracking to clamp
6878 out noise in the darker pixels.  Either save the motion vectors in a
6879 @b{tracking pass} and disable the histogram for the @b{action pass} or
6880 apply the histogram just to the @b{master layer}.
6890 @node REFRAMERT
6891 @section REFRAMERT
6894 ReframeRT changes number of frames in a sequence of video directly from
6895 the timeline.  It has 2 modes, selected by the 2 toggles in the GUI.
6897 @b{Stretch} mode multiplies the current frame number of its output by
6898 the scale factor to arrive at the frame to read from its input.  If its
6899 current output frame is #55 and the scale factor is 2, frame #110 is
6900 read from its input.  The stretch mode has the effect of changing the
6901 length of output video by the inverse of the scale factor.  If the
6902 scale factor is greater than 1, the output will end before the end of
6903 the sequence on the timeline.  If it's less than 1, the output will end
6904 after the end of the sequence on the timeline.  The ReframeRT effect
6905 must be lengthened to the necessary length to accomodate the scale
6906 factor.  Change the length of the effect by clicking on the endpoint of
6907 the effect and dragging.
6909 Although stretch mode changes the number of the frame read from its
6910 input, it doesn't change the frame rate of the input.  Effects before
6911 ReframeRT assume the same frame rate as ReframeRT.
6913 @b{Downsample} mode doesn't change the length of the output sequence. 
6914 It multiplies the frame rate of the output by the scale factor to
6915 arrive at a frame rate rate to read the input.  This has the effect of
6916 replicating the input frames so that they only change at the scaled
6917 frame rate when sent to the output.  It doesn't change the length of
6918 the sequence.  If the scale factor is 0.5 and the output frame rate is
6919 30 fps, only 15 frames will be shown per second and the input will be
6920 read at 15 fps.  Downsample is only useful for scalefactors below 1,
6921 hence the name downsample.
6923 Downsample mode changes the frame rate of the input as well as the
6924 number of the frame to read, so effects before ReframeRT see the frame
6925 rate * the scale factor as their frame rate.  If the scale factor is 2
6926 and the output frame rate is 30, the input frame rate will be 60 and
6927 the input frame number will by doubled.  This won't normally do
6928 anything but some input effects may behave differently at the higher
6929 frame rate.
6934 @node REFRAME
6935 @section REFRAME
6937 This does exactly the same thing as @b{ReframeRT} in @b{Stretch} mode. 
6938 It multiplies the output frame number by the scale factor to arrive at
6939 the input frame number and changes the length of the sequence.  Unlike
6940 ReframeRT, this must run from the @b{Video} menu and render its output.
6942 Be aware @b{Reframe} doesn't write the scaled frame rate as the frame
6943 rate of the rendered file.  It produces a file of scaled length and
6944 equal frame rate as the project.  The new length is 1/scale factor as
6945 big as the original sequence.
6954 @node RESAMPLE
6955 @section RESAMPLE
6957 This multiplies the number of each output sample by a scale factor to
6958 arrive at the number of the input sample.  The output file's sample
6959 rate is set to the project sample rate but its length is changed to
6960 reflect the scaled number of samples.  It also filters the resampled
6961 audio to remove aliasing.
6963 If the scale factor is 2, every 2 input samples will be reduced to 1
6964 output sample and the output file will have half as many samples as the
6965 input sequence.  If it's 0.5, every 0.5 input samples will be stretched
6966 to 1 output sample and the output file will have twice as many samples
6967 as the input sequence.
6978 @node REVERSE VIDEO/AUDIO
6979 @section REVERSE VIDEO/AUDIO
6981 Media can be reversed on the timeline in realtime.  This isn't to be
6982 confused with using the reverse playback on the transport.  The reverse
6983 effects reverse the region covered by the effect regardless of the
6984 transport direction.  Apply @b{reverse audio} to an audio track and
6985 play it backwards.  The sound plays forward.
6987 The region to be reversed is first determined by what part of the track
6988 the effect is under and second by the locations of keyframes in the
6989 effect.  The reverse effects have an @b{enabled} option which allows
6990 you to set keyframes.  This allows may possibilities.
6992 Every @b{enabled} keyframe is treated as the start of a new reversed
6993 region and the end of a previous reversed region.  Several @b{enabled}
6994 keyframes in succession yield several regions reversed independant of
6995 each other.  An @b{enabled} keyframe followed by a @b{disabled}
6996 keyframe yields one reversed region followed by a forward region.
6998 Finally, be aware when reversing audio that the waveform on the
6999 timeline doesn't reflect the actual reversed output.
7007 @node THRESHOLD
7008 @section THRESHOLD
7010 Threshold converts the image to pure luminance.  Then luminance values
7011 below and above the threshold range are converted to black and
7012 luminance values inside the threshold range are converted to white. 
7013 The threshold window shows a histogram of luminance values for the
7014 current frame.  Click dragging inside the histogram creates a range to
7015 convert to white.  Shift-clicking extends one border of this range. 
7016 Values for the threshold range can also be specified in the text boxes.
7018 This effect is basically a primitive luminance key.  A second track
7019 above the track with the threshold effect can be multiplied, resulting
7020 in only the parts of the second track within the threshold being
7021 displayed.
7029 @node TIME AVERAGE
7030 @section TIME AVERAGE
7032 Time average is one effect which has many uses besides creating nifty
7033 trail patterns of moving objects.  It's main use is reducing noise in
7034 still images.  Merely point a video camera at a stationary subject for
7035 30 frames, capture the frames, and average them using TIME AVERAGE and
7036 you'll have a super high quality print.  In floating point colormodels, time
7037 average can increase the dynamic range of lousy cameras.
7039 Inside the time average effect is an accumulation buffer and a
7040 divisor.  A number of frames are accumulated in the accumulation buffer
7041 and divided by the divisor to get the average.
7043 Because the time average can consume enourmous amounts of memory, it is
7044 best applied by first disabling playback for the track, dropping the
7045 time average in it, configuring time average for the desired number of
7046 frames, and re-enabling playback for the track.
7048 @b{Frames to average:} This determines the number of frames to be
7049 accumulated in the accumulation buffer.  For extremely large
7050 integrations it's easier to edit the EDL in a text editor and put in
7051 the number of frames.
7053 @b{Accumulate:} This outputs the accumulation buffer without dividing it.
7055 @b{Average:} This causes the accumulation buffer to be divided before
7056 being output.  This results in the average of all the frames.
7058 @b{Inclusive Or:} This causes the accumulation buffer to be replaced by
7059 any pixels which aren't transparent.  In combination with motion
7060 tracking it allows entire sequences to be combined to form panoramas.
7062 @b{Reprocess frame again:} If an effect before the time average is
7063 adjusted the time average normally doesn't reread the accumulation
7064 buffer to get the change.  This forces it to reread the accumulation
7065 buffer when other effects change.
7067 @b{Disable subtraction:} In order to represent the accumulation of only
7068 the specified number of frames, the time average retains all the
7069 previous frames in memory and subtracts them out as it plays forward. 
7070 It would run out of memory if it had to accumulate thousands of
7071 frames.  By disabling subtraction the previous frames are not stored in
7072 memory and only the average function is affected by the frame count.
7081 @node TITLER
7082 @section TITLER
7084 While it is possible to add text to movies by importing still images
7085 from The Gimp and compositing them, the Titler allows you to add text
7086 from within Cinelerra.  
7088 The titler has standard options for @b{font, size, and style}.  The
7089 best font is a generic, normal font like Arial in a large size.
7091 The titler also has options you'll only find in moving pictures.  The
7092 @b{Justify} operation justifies the text relative to the entire frame. 
7093 Once justified, the @b{X and Y} offset is applied.  This allows text to
7094 be justified while at the same time letting you push it within the
7095 title safe region.
7097 The @b{motion type} scrolls the text in any of the four directions. 
7098 When using this, the text may dissappear.  Move the insertion point
7099 along the timeline until the text is far enough along the animation to
7100 reappear.  The text scrolls on and scrolls off.
7102 Setting @b{loop} causes the text to scroll completely off and repeat. 
7103 Without @b{loop} the text scrolls off and never reappears.
7105 The speed of the animation is determined by @b{speed}  Set it higher to
7106 speed up the animation.
7108 @b{Drop shadow} draws a black copy of the text to the bottom right of
7109 the original text.  Useful when drawing text over changing video to
7110 keep the border always visible.
7112 In addition to the scrolling, @b{Fade in/Fade out} are a second type of
7113 animation.  If the fade seconds are 0, no fading is done.
7115 @b{Color} picks the color to draw the text in.  Usually white is the
7116 only practical color.
7118 @b{Stamp timecode} replaces the text with the current position on the
7119 timeline in seconds and frames.
7121 @menu
7122 * ADDING FONTS TO THE TITLER:: How to add fonts to the titler
7123 * THE TITLE-SAFE REGION::      How to keep text visible on output
7124 @end menu
7126 @node ADDING FONTS TO THE TITLER
7127 @subsection ADDING FONTS TO THE TITLER
7129 The X Window system originally didn't have a suitable font renderer for
7130 video.  It also is restricted to the current bit depth.  It doesn't
7131 have a convenient way to know which fonts work with the suitable font
7132 renderer in the desired bit depth.  The easiest way we've found to
7133 support fonts in the titler is to have a directory for them at
7134 @b{/usr/lib/cinelerra/fonts}.
7136 The titler supports mainly @b{TTF}, true type fonts.  It supports
7137 others but TTF are the most reliable.  To add true type fonts, copy the
7138 @b{.TTF} files to the @b{/usr/lib/cinelerra/fonts} directory.  In that
7139 directory run @b{ttmkfdir && mv fonts.scale fonts.dir} and restart
7140 Cinelerra.  The new fonts should appear.  The usage of ttmkfdir changes
7141 frequently so this technique might not work.
7144 @node THE TITLE-SAFE REGION
7145 @subsection THE TITLE-SAFE REGION
7147 If the video is displayed on a consumer TV, the outer border is going
7148 to be cropped by 5% on each side.  Moreover, text which is too close to
7149 the edge looks sloppy.  Make sure when adding titles to have the
7150 @b{title-safe} @image{titlesafe} tool active in the @b{compositor} window.
7151 The text shouldn't cross the inner rectangle.
7161 @node VIDEO SCOPE
7162 @section VIDEO SCOPE
7164 The video scope plots two views of the image.  One view plots the
7165 intensity of each pixel against horizontal position.  They call this
7166 the WAVEFORM.  Another view translates hue to angle and saturation to
7167 radius for each pixel.  They call this the VECTORSCOPE.
7169 The vectorscope is actually very useful for determining if an image is
7170 saturated.  When adjusting saturation, it's important to watch the
7171 vectorscope to make sure pixels don't extend past the 100 radius.
7173 The waveform allows you to make sure image data extends from complete
7174 black to complete white while adjusting the brightness/contrast.
7176 Some thought is being given to having a video scope for recording. 
7177 Unfortunately, this would require a lot of variations of the video
7178 scope for all the different video drivers.
7184 @node PLUGIN AUTHORING
7185 @chapter PLUGIN AUTHORING
7187 The plugin API in Cinelerra dates back to 1997, before the LADSPA and
7188 before VST became popular.  It's fundamentally the same as it was in
7189 1997, with minor modifications to handle keyframes and GUI feedback. 
7190 The GUI is not abstracted from the programmer.  This allows the
7191 programmer to use whatever toolkit they want and allows more
7192 flexibility in appearance but it costs more.
7194 There are several types of plugins, each with a common procedure of
7195 implementation and specific changes for that particular type.  The
7196 easiest way to implement a plugin is to take the simplest existing one
7197 out of the group and rename the symbols.  
7201 @menu
7202 * INTRODUCING THE PULL METHOD:: The current paradigm for plugin writing
7203 * COMMON PLUGIN FUNCTIONS:: What all effects have to do.
7204 * REALTIME PLUGINS:: What realtime effects have to do.
7205 * NONREALTIME PLUGINS:: What rendered effects have to do.
7206 * AUDIO PLUGINS:: What audio effects have to do.
7207 * VIDEO PLUGINS:: What video effects have to do.
7208 * TRANSITION PLUGINS:: What transitions have to do.
7209 * PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK:: How to use currently playing data to draw the GUI.
7210 * PLUGIN QUERIES:: How plugins get information about the data to be processed.
7211 @end menu
7216 @node INTRODUCING THE PULL METHOD
7217 @section INTRODUCING THE PULL METHOD
7219 Originally plugins were designed with the push method.  The push method
7220 is intuitive and simple.  A source pushes data to a plugin, the plugin
7221 does math operations on it, and the plugin pushes it to a destination. 
7222 For 6 years this was the way all realtime plugins were driven
7223 internally but it didn't allow you to reduce the rate of playback in
7224 realtime.  While plugins can still be designed as if they're pushing
7225 data, this is not the way they're processed internally anymore.
7227 The latest evolution in Cinelerra's plugin design is the pull method. 
7228 The rendering pipeline starts at the final output and the final steps
7229 in the rendering pipeline are reading the data from disk.  Every step
7230 in the rendering chain involves requesting data from the previous
7231 step.  When the rendering pipleline eventually requests data from a
7232 plugin chain, each plugin requests data from the plugin before it.
7234 This is less intuitive than the push method but is much more powerful. 
7235 Realtime plugins written using the pull method can change the rate data
7236 is presented to the viewer and the direction of playback.  The pull
7237 method allows plugins to take in data at a higher rate than they send
7238 it out.
7240 To get the power of rate independance, the pull method requires plugins
7241 to know more about the data than they needed to under the push method. 
7242 Plugins need to know what rate the project is at, what rate their
7243 output is supposed to be at and what rate their input is supposed to be
7244 at.  These different data rates have to be correlated for a plugin to
7245 configure itself properly.
7247 Keyframes for a plugin are stored relative to the project frame rate. 
7248 Queries from a plugin for for the current playback position are given
7249 relative to the project frame rate.  If the plugin's output was
7250 requested to be at twice the project frame rate, the positions need to
7251 be converted to the project rate for keyframes to match up.  Two
7252 classes of data rates were created to handle this problem.
7254 Rate conversions are done in terms of the @b{project rate} and the
7255 @b{requested rate}.  The project rate is identical for all plugins.  It
7256 is determined by the @b{settings->format} window.  The requested rate
7257 is determined by the downstream plugin requesting data from the current
7258 plugin.  The requested rate is arbitrary.  Exactly how to use these
7259 rates is described below.
7263 @node COMMON PLUGIN FUNCTIONS
7264 @section COMMON PLUGIN FUNCTIONS
7266 All plugins inherit from a derivative of PluginClient.  This
7267 PluginClient derivative implements most of the required methods in
7268 PluginClient, but users must still define methods for PluginClient. 
7269 The most commonly used methods are predefined in macros to reduce the
7270 typing yet still allow flexibility.
7272 The files they include depend on the plugin type.  Audio plugins
7273 include @b{pluginaclient.h} and video plugins include
7274 @b{pluginvclient.h}.  They inherit @b{PluginAClient} and
7275 @b{PluginVClient} respectively.
7277 Cinelerra instantiates all plugins at least twice when they are used in
7278 a movie.  Once instance is the GUI.  The other instance is the signal
7279 processor.  User input, through a complicated sequence, is propogated
7280 from the GUI instance to the signal processor instance.  If the signal
7281 processor wants to alter the GUI, it propogates data back to the GUI
7282 instance.  There are utility functions for doing all this.
7284 All plugins define at least three objects:
7286 @itemize
7288 @item
7290 @b{Processing object} - Contains pointers to all the other objects and
7291 performs the signal processing.  This object contains a number of
7292 queries to identify itself and is the object you register to register
7293 the plugin.
7296 @item
7298 @b{User interface object} - This is defined according to the programmer's
7299 discretion.  It can either use Cinelerra's toolkit or another toolkit. 
7300 It shows data on the screen and collects parameters from the user.
7302 Using Cinelerra's toolkit, the only user interface object a developer
7303 needs to worry about is the Window.  The window has pointers to a
7304 number of widgets, a few initialization methods, and a back pointer to
7305 the plugin's processing object.  The documentation refers to the usage
7306 of Cinelerra's toolkit.
7308 Depending on the user interface toolkit, a user interface thread may be
7309 created to run the user interface asynchronous of everything else. 
7310 Synchronizing the user interface to changes in the plugin's
7311 configuration is the most complicated aspect of the plugin, so the user
7312 interface thread and object are heavily supported by macros if you use
7313 Cinelerra's toolkit.
7316 @item
7318 @b{Configuration object} - This stores the user parameters and always
7319 needs interpolation, copying, and comparison functions.  Macros for the
7320 plugin client automatically call configuration methods to interpolate
7321 keyframes.
7323 @end itemize
7325 @menu
7326 * THE PROCESSING OBJECT::
7327 * THE CONFIGURATION OBJECT::
7328 * THE USER INTERFACE OBJECT::
7329 @end menu
7333 @node THE PROCESSING OBJECT
7334 @subsection THE PROCESSING OBJECT
7336 Load up a simple plugin like gain to see what this object looks like.
7337 The processing object should inherit from the intended PluginClient
7338 derivative.  Its constructor should take a PluginServer argument.
7340 @example
7341 MyPlugin(PluginServer *server);
7342 @end example
7344 In the implementation, the plugin must contain a registration line with
7345 the name of the processing object like
7347 @example
7348 REGISTER_PLUGIN(MyPlugin)
7349 @end example
7352 The constructor should contain 
7354 @example
7355 PLUGIN_CONSTRUCTOR_MACRO
7356 @end example
7358 to initialize the most common variables.
7361 The processing object should have a destructor containing
7363 @example
7364 PLUGIN_DESTRUCTOR_MACRO
7365 @end example
7367 to delete the most common variables.
7369 Another function which is useful but not mandatory is
7371 @example
7372 int is_multichannel();
7373 @end example
7375 It should return 1 if one instance of the plugin handles multiple
7376 tracks simultaneously or 0 if one instance of the plugin only handles
7377 one track.  The default is 0 if it is omitted.
7379 Multichannel plugins in their processing function should refer to a
7380 function called @b{PluginClient::get_total_buffers()} to determine the
7381 number of channels.
7386 To simplify the implementation of realtime plugins, a macro for
7387 commonly used members has been created for the class header, taking the
7388 configuration object and user interface thread object as arguments. 
7389 The macro definitions apply mainly to realtime plugins and are not
7390 useful in nonrealtime plugins.  Fortunately, nonrealtime plugins are
7391 simpler.
7393 @example
7394 PLUGIN_CLASS_MEMBERS(config_name, thread_name)
7395 @end example
7397 The commonly used members in PLUGIN_CLASS_MEMBERS are described below.
7399 @itemize
7401 @item
7402 int load_configuration();
7404 Loads the configuration based on surrounding keyframes and current
7405 position.  The class definition for load_configuration should contain 
7407 @example
7408 LOAD_CONFIGURATION_MACRO(plugin_class, config_class)
7409 @end example
7411 to implement the default behavior for load_configuration.  This stores
7412 whatever the current configuration is inside the plugin's configuration
7413 object and returns 1 if the new configuration differs from the previous
7414 configuration.  The return value of load_configuration is used by
7415 another commonly used function, update_gui to determine if the GUI really needs to be updated.
7417 The plugin's configuration object is always called @b{config} inside
7418 PLUGIN_CLASS_MEMBERS.
7420 @item
7421 VFrame* new_picon();
7423 Creates a picon for display in the resource window.  Use
7425 @example
7426 #include "picon_png.h"
7427 NEW_PICON_MACRO(plugin_class)
7428 @end example
7430 to implement new_picon.  In addition, the user should create a
7431 @b{picon_png.h} header file from a PNG image using @b{pngtoh}. 
7432 @b{pngtoh} is compiled in the @b{guicast/ARCH} directory.
7434 The source PNG image should be called picon.png and can be any format
7435 supported by PNG.
7437 @item
7438 char* plugin_title();
7440 Returns a text string identifying the plugin in the resource window. 
7441 The string has to be unique.
7444 @item
7445 void update_gui(); 
7447 Should first load the configuration, test for a return of 1, and then
7448 redraw the GUI with the new parameters.  All the plugins using GuiCast
7449 have a format like
7451 @example
7452 void MyPlugin::update_gui()
7454         if(thread)
7455         @{
7456                 if(load_configuration())
7457                 @{
7458                         thread->window->lock_window();
7459 // update widgets here
7460                         thread->window->unlock_window();
7461                 @}
7462         @}
7464 @end example
7466 to handle concurrency and conditions of no GUI.
7468 @item
7469 int show_gui();
7471 Instantiate the GUI and switch the plugin to GUI mode.  This is implemented with
7473 @example
7474 SHOW_GUI_MACRO(plugin_class, thread_class)
7475 @end example
7477 @item
7478 int set_string();
7480 Changes the title of the GUI window to a certain string.  This is implemented with
7482 @example
7483 SET_STRING_MACRO(plugin_class)
7484 @end example
7487 @item
7488 void raise_window();
7490 Raises the GUI window to the top of the stack.  This is implemented with
7492 @example
7493 RAISE_WINDOW_MACRO(plugin_class)
7494 @end example
7498 @end itemize
7501 Iimportant functions the processing object must define are the
7502 functions which load and save configuration data from keyframes.  These
7503 functions are called by the macros so all you need to worry about is
7504 accessing the keyframe data.
7506 @example
7507 void save_data(KeyFrame *keyframe);
7508 void read_data(KeyFrame *keyframe);
7509 @end example
7511 The read data functions are only used in realtime plugins.  The read
7512 data functions translate the plugin configuration between the KeyFrame
7513 argument and the configuration object for the plugin.  The keyframes
7514 are stored on the timeline and can change for every project.
7516 Use an object called @b{FileXML} to do the translation and some
7517 specific commands to get the data out of the KeyFrame argument.  See
7518 any existing plugin to see the usage of KeyFrame and FileXML.
7521 @example
7522 int load_defaults();
7523 int save_defaults();
7524 @end example
7526 The load defaults functions are used in realtime and non-realtime
7527 plugins.  The load defaults functions translate the plugin
7528 configuration between a BC_Hash object and the plugin's
7529 configuration.  The BC_Hash object stores configurations in a discrete
7530 file on disk for each plugin but doesn't isolate different
7531 configurations for different projects.
7533 The function overriding @b{load_defaults} also needs to create the
7534 BC_Hash object.  See any existing plugin to see the usage of
7535 BC_Hash.
7537 Other standard members may be defined in the processing object,
7538 depending on the plugin type.
7543 @node THE CONFIGURATION OBJECT
7544 @subsection THE CONFIGURATION OBJECT
7546 The configuration object is critical for GUI updates, signal
7547 processing, and default settings in realtime plugins.  Be aware it is
7548 not used in nonrealtime plugins.  The configuration object inherits
7549 from nothing and has no dependancies.  It's merely a class containing
7550 three functions and variables specific to the plugin's parameters.
7552 Usually the configuration object starts with the name of the plugin
7553 followed by Config.
7555 @example
7556 class MyPluginConfig
7558 public:
7559         MyPluginConfig();
7560 @end example
7563 Following the name of the configuration class, we put in three
7564 required functions and the configuration variables.
7566 @example
7567         int equivalent(MyPluginConfig &that);
7568         void copy_from(MyPluginConfig &that);
7569         void interpolate(MyPluginConfig &prev, 
7570                 MyPluginConfig &next, 
7571                 int64_t prev_position, 
7572                 int64_t next_position, 
7573                 int64_t current_position);
7577         float parameter1;
7578         float parameter2;
7579         int parameter3;
7582 @end example
7585 Now you must define the three functions.  @b{Equivalent} is called by
7586 LOAD_CONFIGURATION_MACRO to determine if the local configuration
7587 parameters are identical to the configuration parameters in the
7588 arguement.  If equivalent returns 0, the LOAD_CONFIGURATION_MACRO 
7589 causes the GUI to redraw.  If equivalent returns 1, the
7590 LOAD_CONFIGURATION_MACRO doesn't redraw the GUI.
7592 Then there's @b{copy_from} which transfers the configuration values
7593 from the argument to the local variables.  This is once again used in
7594 LOAD_CONFIGURATION_MACRO to store configurations in temporaries.  Once 
7595 LOAD_CONFIGURATION_MACRO has replicated the configuration, it loads a
7596 second configuration.  Then it interpolates the two configurations to
7597 get the current configuration.  The interpolation function performs the
7598 interpolation and stores the result in the local variables.
7600 Normally the interpolate function calculates a previous and next
7601 fraction, using the arguments.
7603 @example
7604 void MyPluginConfig::interpolate(MyPluginConfig &prev, 
7605                 MyPluginConfig &next, 
7606                 int64_t prev_position, 
7607                 int64_t next_position, 
7608                 int64_t current_position)
7610         double next_scale = (double)(current_position - prev_position) / (next_position - prev_position);
7611         double prev_scale = (double)(next_position - current_position) / (next_position - prev_position);
7612 @end example
7614 Then the fractions are applied to the previous and next configuration
7615 variables to yield the current values.
7617 @example
7619         this->parameter1 = (float)(prev.parameter1 * prev_scale + next.parameter1 * next_scale);
7620         this->parameter2 = (float)(prev.parameter2 * prev_scale + next.parameter2 * next_scale);
7621         this->parameter3 = (int)(prev.parameter3 * prev_scale + next.parameter3 * next_scale);
7624 @end example
7626 Alternatively you can copy the values from the previous configuration
7627 argument if no interpolation is desired.
7629 This usage of the configuration object is the same in audio and video
7630 plugins.  In video playback, the interpolation function is called for
7631 every frame, yielding smooth interpolation.  In audio playback, the
7632 interpolation function is called only once for every console fragment
7633 and once every time the insertion point moves.  This is good enough for
7634 updating the GUI while selecting regions on the timeline but it may not
7635 be accurate enough for really smooth rendering of the effect.
7637 For really smooth rendering of audio, you can still use
7638 load_configuration when updating the GUI.  For process_buffer; however,
7639 ignore load_configuration and write your own interpolation routine
7640 which loads all the keyframes in a console fragment and interpolates
7641 every sample.  This would be really slow and hard to debug, yielding
7642 improvement which may not be audible.  Then of course, every country
7643 has its own wierdos.
7645 An easier way to get smoother interpolation is to reduce the console
7646 fragment to 1 sample.  This would have to be rendered and played back
7647 with the console fragment back over 2048 of course.  The Linux sound
7648 drivers can't play fragments of 1 sample.
7657 @node THE USER INTERFACE OBJECT
7658 @subsection THE USER INTERFACE OBJECT
7661 The user interface object at the very least consists of a pointer to a
7662 window and pointers to all the widgets in the window.  Using
7663 Cinelerra's toolkit, it consists of a @b{BCWindow} derivative and a
7664 @b{Thread} derivative.  The Thread derivative is declared in the plugin
7665 header using
7667 @example
7668 PLUGIN_THREAD_HEADER(plugin_class, thread_class, window_class)
7669 @end example
7671 Then it is defined using
7673 @example
7674 PLUGIN_THREAD_OBJECT(plugin_class, thread_class, window_class)
7675 @end example
7677 This, in combination with the SHOW_GUI macro does all the work in
7678 instantiating the Window.  This two class system is used in realtime
7679 plugins but not in nonrealtime plugins.  Nonrealtime plugins create and
7680 destroy their GUI in their @b{get_parameters} function and there's no
7681 need for a Thread.
7683 Now the window class must be declared in the plugin header.  It's
7684 easiest to implement the window by copying an existing plugin and
7685 renaming the symbols.  The following is an outline of what happens. 
7686 The plugin header must declare the window's constructor using the
7687 appropriate arguments.
7689 @example
7691 #include "guicast.h"
7693 class MyPluginWindow : public BC_Window
7695 public:
7696         MyPluginWindow(MyPluginMain *plugin, int x, int y);
7698 @end example
7700 This becomes a window on the screen, positioned at x and y.
7702 It needs two methods
7704 @example
7705         int create_objects();
7706         int close_event();
7707 @end example
7709 and a back pointer to the plugin
7711 @example
7712         MyPlugin *plugin;
7713 @end example
7716 The constructor's definition should contain extents and flags causing
7717 the window to be hidden when first created.  The create_objects member
7718 puts widgets in the window according to GuiCast's syntax.  A pointer to
7719 each widget which you want to synchronize to a configuration parameter
7720 is stored in the window class.  These are updated in the @b{update_gui}
7721 function you earlier defined for the plugin.  The widgets are usually
7722 derivatives of a GuiCast widget and they override functions in GuiCast
7723 to handle events.  Finally create_objects calls 
7725 @example
7726         show_window();
7727         flush();
7728 @end example
7730 to make the window appear all at once.
7732 The close_event member should be implemented using
7734 @example
7735 WINDOW_CLOSE_EVENT(window_class)
7736 @end example
7738 Every widget in the GUI needs to detect when its value changes.  In
7739 GuiCast the @b{handle_event} method is called whenever the value
7740 changes.  In @b{handle_event}, the widget then needs to call
7741 @b{plugin->send_configure_change()} to propogate the change to any
7742 copies of the plugin which are processing data.
7752 @node REALTIME PLUGINS
7753 @section REALTIME PLUGINS
7755 Realtime plugins should use PLUGIN_CLASS_MEMBERS to define the basic
7756 set of members in their headers.  All realtime plugins must define an
7758 @example
7759 int is_realtime()
7760 @end example
7762 member returning 1.  This causes a number of methods to be called
7763 during live playback and the plugin to be usable on the timeline.
7765 Realtime plugins must override a member called
7767 @example
7768 process_buffer 
7769 @end example
7771 This function takes different arguments depending on if the plugin
7772 handles video or audio.  See an existing plugin to find out which usage
7773 applies.
7775 The main features of the process_buffer function are a buffer to store
7776 the output, the starting position of the output, and the requested
7777 output rate.  For audio, there's also a size argument for the number of
7778 samples.
7780 The starting position of the output buffer is the lowest numbered
7781 sample on the timeline if playback is forward and the highest numbered
7782 sample on the timeline if playback is reverse.  The direction of
7783 playback is determined by one of the plugin queries described below.
7785 The position and size arguments are all relative to the frame rate and
7786 sample rate passed to process_buffer.  This is the requested data rate
7787 and may not be the same as the project data rate.
7789 The process_realtime function should start by calling
7790 @b{load_configuration}.  The LOAD_CONFIGURATION_MACRO returns 1 if the
7791 configuration changed.
7793 After determining the plugin's configuration, input media has to be
7794 loaded for processing.  Call
7796 @example
7797 read_frame(VFrame *buffer, 
7798                 int channel, 
7799                 int64_t start_position,
7800                 double frame_rate)
7801 @end example
7805 @example
7806 read_samples(double *buffer,
7807                 int channel,
7808                 int sample_rate,
7809                 int64_t start_position,
7810                 int64_t len)
7811 @end example
7813 to request input data from the object which comes before this plugin. 
7814 The read function needs a buffer to store the input data in.  This can
7815 either be a temporary you create in the plugin or the output buffer
7816 supplied to process_buffer if you don't need a temporary.
7818 It also needs a set of position arguments to determine when you want to
7819 read the data from.  The start position, rate, and len passed to a read
7820 function need not be the same as the values recieved by the
7821 process_buffer function.  This way plugins can read data at a different
7822 rate than they output data.
7824 The channel argument is only meaningful if this is a multichannel
7825 plugin.  They need to read data for each track in the
7826 get_total_buffers() value and process all the tracks.  Single channel
7827 plugins should pass 0 for channel.
7830 Additional members are implemented to maintain configuration in
7831 realtime plugins.  Some of these are also needed in nonrealtime
7832 plugins.
7834 @itemize
7835 @item
7836 void read_data(KeyFrame *keyframe);
7838 Loads data from a keyframe into the plugin's configuration.  Inside the
7839 keyframe is an XML string.  It's most easily parsed by creating a
7840 @b{FileXML} object.  See an existing plugin to see how the read_data
7841 function is implemented.
7843 Read data loads data out of the XML object and stores values in the
7844 plugin's configuration object.  Since configuration objects vary from
7845 plugin to plugin, these functions can't be automated.
7847 @item
7848 void save_data(KeyFrame *keyframe);
7850 Saves data from the plugin's configuration to a keyframe.  Inside the
7851 keyframe you'll put an XML string which is normally created by a
7852 FileXML object.  See an existing plugin to see how the save_data
7853 function is implemented.
7855 Save data saves data from the plugin's configuration object into the
7856 XML object.
7858 @item
7859 int load_defaults();
7861 Another way the plugin gets parameters is from a defaults file.  The
7862 load and save defaults routines use a BC_Hash object to parse the
7863 defaults file.  The defaults object is created in @b{load_defaults} and
7864 destroyed in the plugin's destructor.  See an existing plugin to see
7865 how the BC_Hash object is used.
7867 @item
7868 int save_defaults();
7870 Saves the configuration in the defaults object.
7872 @end itemize
7879 @node NONREALTIME PLUGINS
7880 @section NONREALTIME PLUGINS
7882 Some references for non-realtime plugins are @b{Normalize} for audio
7883 and @b{Reframe} for video.
7885 Like realtime plugins, @b{load_defaults} and @b{save_defaults} must be
7886 implemented.  In nonrealtime plugins, these are not just used for
7887 default parameters but to transfer values from the user interface to
7888 the signal processor.  There doesn't need to be a configuration class
7889 in nonrealtime plugins.
7891 Unlike realtime plugins, the LOAD_CONFIGURATION_MACRO can't be used in
7892 the plugin header.  Instead, the following methods must be defined.
7894 The nonrealtime plugin should contain a pointer to a defaults object.
7896 @example
7898 BC_Hash *defaults;
7900 @end example
7902 It should also have a pointer to a MainProgressBar.
7904 @example
7906 MainProgressBar *progress;
7907 @end example
7909 The progress pointer allows nonrealtime plugins to display their
7910 progress in Cinelerra's main window.
7912 The constructor for a nonrealtime plugin can't use
7913 PLUGIN_CONSTRUCTOR_MACRO but must call @b{load_defaults} directly.
7915 The destructor, likewise, must call @b{save_defaults} and @b{delete
7916 defaults} directly instead of PLUGIN_DESTRUCTOR_MACRO.
7918 @itemize
7920 @item
7921 VFrame* new_picon();
7923 char* plugin_title();
7925 The usage of these is the same as realtime plugins.
7927 @item
7928 int is_realtime();
7930 This function must return 0 to indicate a nonrealtime plugin.
7932 @item
7934 int get_parameters();
7936 Here, the user should create a GUI, wait for the user to hit an OK
7937 button or a cancel button, and store the parameters in plugin
7938 variables.  This routine must return 0 for success and 1 for failure. 
7939 This way the user can cancel the effect from the GUI.
7941 Unlike the realtime plugin, this GUI need not run asynchronously of the
7942 plugin.  It should block the get_parameters function until the user
7943 selects OK or Cancel.
7945 @item
7946 int load_defaults();
7948 This should create a defaults object and load parameters from the
7949 defaults object into plugin variables.
7951 @item
7952 int save_defaults();
7954 This should save plugin variables to the defaults object.
7957 @item
7958 int start_loop();
7960 If @b{get_parameters} returned 0 for success, this is called once to
7961 give the plugin a chance to initialize processing.  The plugin should
7962 instantiate the progress object with a line like
7964 @example
7966 progress = start_progress("MyPlugin progress...", 
7967         PluginClient::get_total_len());
7969 @end example
7971 The usage of @b{start_progress} depends on whether the plugin is
7972 multichannel or single channel.  If it's multichannel you always call
7973 start_progress.  If it's single channel, you first need to know whether
7974 the progress bar has already started in another instance of the plugin.
7976 If @b{PluginClient::interactive} is 1, you need to start the progress
7977 bar.  If it's 0, the progress bar has already been started.
7979 The PluginClient defines @b{get_total_len()} and @b{get_source_start()}
7980 to describe the timeline range to be processed.  The units are either
7981 samples or frames and in the project rate.
7983 @item
7984 int process_loop
7986 This is called repeatedly until the timeline range is processed.  It
7987 has either a samples or frames buffer for output and a reference to
7988 write_length to store the number of samples processed.  If this is an
7989 audio plugin, the user needs to call @b{get_buffer_size()} to know how
7990 many samples the output buffer can hold.
7992 The plugin must use @b{read_samples} or @b{read_frame} to read the
7993 input.  These functions are a bit different for a non realtime plugin
7994 than they are for a realtime plugin.
7996 They take a buffer and a position relative to the start of the
7997 timeline, in the timeline's rate.  Then you must process it and put the
7998 output in the buffer argument to process_loop.  write_length should
7999 contain the number of samples generated if it's audio.
8001 Finally, process_loop must test @b{PluginClient::interactive} and
8002 update the progress bar if it's 1.
8004 @example
8005 progress->update(total_written);
8006 @end example
8008 returns 1 or 0 if the progress bar was cancelled.  If it's 1,
8009 process_loop should return 1 to indicate a cancellation.  In addition
8010 to progress bar cancellation, @b{process_loop} should return 1 when the
8011 entire timeline range is processed.
8013 @item
8014 int stop_loop();
8016 This is called after process_loop processes its last buffer.  
8018 If PluginClient::is_interactive is 1, this should call
8019 @b{stop_progress} in the progress bar pointer and delete the pointer. 
8020 Then it should delete any objects it created for processing in
8021 @b{start_loop}.
8024 @end itemize
8028 @node AUDIO PLUGINS
8029 @section AUDIO PLUGINS
8031 The simplest audio plugin is Gain.  The processing object should
8032 include @b{pluginaclient.h} and inherit from @b{PluginAClient}.  Realtime audio plugins need to
8033 define 
8035 @example
8036 int process_buffer(int64_t size, 
8037                 double **buffer,
8038                 int64_t start_position,
8039                 int sample_rate);
8040 @end example
8042 if it's multichannel or 
8044 @example
8045 int process_buffer(int64_t size, 
8046                 double *buffer,
8047                 int64_t start_position,
8048                 int sample_rate);
8049 @end example
8051 if it's single channel.  These should return 0 on success and 1 on
8052 failure.  In the future, the return value may abort failed rendering.
8054 The processing function needs to request input samples with 
8056 @example
8057 int read_samples(double *buffer,
8058                 int channel,
8059                 int sample_rate,
8060                 int64_t start_position,
8061                 int64_t len);
8062 @end example
8064 It always returns 0.  The user may specify any desired sample rate and
8065 start position.
8067 Nonrealtime audio plugins need to define
8069 @example
8070 int process_loop(double *buffer, int64_t &write_length);
8071 @end example
8073 for single channel or
8075 @example
8076 int process_loop(double **buffers, int64_t &write_length);
8077 @end example
8079 for multi channel.  Non realtime plugins use a different set of
8080 read_samples functions to request input data.  These are fixed to the
8081 project sample rate.
8085 @node VIDEO PLUGINS
8086 @section VIDEO PLUGINS
8091 The simplest video plugin is Flip.  The processing object should
8092 include @b{pluginvclient.h} and inherit from @b{PluginVClient}. 
8093 Realtime video plugins need to define 
8095 @example
8096 int process_buffer(VFrame **frame,
8097         int64_t start_position,
8098         double frame_rate);
8099 @end example
8101 if it's multichannel or 
8103 @example
8104 int process_buffer(VFrame *frame,
8105         int64_t start_position,
8106         double frame_rate);
8107 @end example
8109 if it's single channel.  
8111 The nonrealtime video plugins need to define
8113 @example
8114 int process_loop(VFrame *buffer);
8115 @end example
8117 for single channel or
8119 @example
8120 int process_loop(VFrame **buffers);
8121 @end example
8123 for multi channel.  The amount of frames generated in a single
8124 process_loop is always assumed to be 1, hence the lack of a
8125 write_length argument.  Returning 0 causes the rendering to continue. 
8126 Returning 1 causes the rendering to abort.
8128 A set of read_frame functions exist for requesting input frames in
8129 non-realtime video plugins.  These are fixed to the project frame rate.
8132 @node TRANSITION PLUGINS
8133 @section TRANSITION PLUGINS
8138 The simplest video transition is @b{wipe} and the simplest audio
8139 transition is @b{crossfade}.  These use a subset of the default class
8140 members of realtime plugins, but so far no analogue to
8141 PLUGIN_CLASS_MEMBERS has been done for transitions.
8143 The processing object for audio transitions still inherits from
8144 PluginAClient and for video transitions it still inherits from
8145 PluginVClient.
8147 Transitions may or may not have a GUI.  If they have a GUI, they must
8148 also manage a thread like realtime plugins.  Do this with the same
8149 PLUGIN_THREAD_OBJECT and PLUGIN_THREAD_HEADER macros as realtime
8150 plugins.  Since there is only one keyframe in a transition, you don't
8151 need to worry about updating the GUI from the processing object like
8152 you do in a realtime plugin.
8154 If the transition has a GUI, you can use PLUGIN_CONSTRUCTOR_MACRO and 
8155 PLUGIN_DESTRUCTOR_MACRO to initialize the processing object.  You'll
8156 also need a BC_Hash object and a Thread object for these macros.
8158 Since the GUI is optional, overwrite a function called @b{uses_gui()}
8159 to signifiy whether or not the transition has a GUI.  Return 1 if it
8160 does and 0 if it doesn't.
8162 Transitions need a @b{load_defaults} and @b{save_defaults} function so
8163 the first time they're dropped on the timeline they'll have useful
8164 settings.
8166 A @b{read_data} and @b{save_data} function takes over after insertion
8167 to access data specific to each instance of the transition.
8169 The most important difference between transitions and realtime plugins
8170 is the addition of an @b{is_transition} method to the processing
8171 object.  @b{is_transition} should return 1 to signify the plugin is a
8172 transition.
8174 Transitions process data in a @b{process_realtime} function.
8176 @example
8177 int process_realtime(VFrame *input, 
8178                 VFrame *output);
8179 @end example
8181 @example
8182 int process_realtime(int64_t size, 
8183                 double *input_ptr, 
8184                 double *output_ptr);
8185 @end example
8187 The input argument to process_realtime is the data for the next edit. 
8188 The output argument to process_realtime is the data for the previous
8189 edit.
8191 Routines exist for determining where you are relative to the
8192 transition's start and end.
8194 @itemize
8196 @item @b{PluginClient::get_source_position()} - returns the current
8197 position since the start of the transition of the lowest sample in the
8198 buffers.
8200 @item @b{PluginClient::get_total_len()} - returns the integer length of
8201 the transition.  The units are either samples or frames, in the data
8202 rate requested by the first plugin.
8204 @end itemize
8206 Users should divide the source position by total length to get the
8207 fraction of the transition the current @b{process_realtime} function is
8210 Transitions run in the data rate requested by the first plugin in the
8211 track.  This may be different than the project data rate.  Since
8212 process_realtime lacks a rate argument, use @b{get_framerate()} or
8213 @b{get_samplerate} to get the requested rate.
8219 @node PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK
8220 @section PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK
8222 Effects like @b{Histogram} and @b{VideoScope} need to update the GUI
8223 during playback to display information about the signal.  This is
8224 achieved with the @b{send_render_gui} and @b{render_gui} methods. 
8225 Normally in process_buffer, when the processing object wants to update
8226 the GUI it should call @b{send_render_gui}.  This should only be called
8227 in process_buffer.  Send_render_gui goes through a search and
8228 eventually calls @b{render_gui} in the GUI instance of the plugin.
8230 Render_gui should have a sequence like
8232 @example
8233 void MyPlugin::render_gui(void *data)
8235         if(thread)
8236         @{
8237                 thread->window->lock_window();
8239 // update GUI here
8241                 thread->window->unlock_window();
8242         @}
8245 @end example
8248 Send_render_gui and render_gui use one argument, a void pointer to
8249 transfer information from the processing object to the GUI.  The user
8250 should typecast this pointer into something useful.
8262 @node PLUGIN QUERIES
8263 @section PLUGIN QUERIES
8266 There are several useful queries in PluginClient which can be accessed
8267 from the processing object.  Some of them have different meaning in
8268 realtime and non-realtime mode.  They all give information about the
8269 operating system or the project which can be used to improve the
8270 quality of the processing.
8272 @menu
8273 * SYSTEM QUERIES:: Utilities for determining the system resources.
8274 * TIMING QUERIES:: Utilities for performing time-dependant processing.
8275 @end menu
8281 @node SYSTEM QUERIES
8282 @subsection SYSTEM QUERIES
8285 @itemize
8287 @item 
8289 @b{get_interpolation_type()} returns the type of interpolation the user
8290 wants for all scaling operations.  This is a macro from
8291 overlayframe.inc.  It can be applied to any call to the
8292 @b{OverlayFrame} object.
8294 @item
8296 @b{get_project_smp()} Gives the number of CPU's on the system minus 1. 
8297 If it's a uniprocessor it's 0.  If it's a dual processor, it's 1.  This
8298 number should be used to gain parallelism.
8300 @item
8302 @b{get_total_buffers()} Gives the number of tracks a multichannel
8303 plugin needs to process.
8306 @end itemize
8313 @node TIMING QUERIES
8314 @subsection TIMING QUERIES
8317 There are two rates for media a realtime plugin has to be aware of: the
8318 project rate and the requested rate.  Functions are provided for
8319 getting the project and requested rate.  In addition, doing time
8320 dependant effects requires using several functions which tell where you
8321 are in the effect.
8323 @itemize
8324 @item
8326 @b{get_project_framerate()} Gives the frames per second of the video as
8327 defined by the project settings.
8330 @item
8332 @b{get_project_samplerate()} Gives the samples per second of the audio as
8333 defined by the project settings.
8335 @item
8337 @b{get_framerate()} Gives the frames per second requested by the plugin
8338 after this one.  This is the requested frame rate and is the same as
8339 the frame_rate argument to process_buffer.
8341 @item
8343 @b{get_samplerate()} Gives the samples per second requested by the plugin
8344 after this one.  This is the requested sample rate and is the same as
8345 the sample_rate argument to process_buffer.
8347 @item
8349 @b{get_total_len()} Gives the number of samples or frames in the
8350 range covered by the effect, relative to the requested data rate.
8352 @item
8354 @b{get_source_start()} For realtime plugins it gives the lowest sample
8355 or frame in the effect range in the requested data rate.  For
8356 nonrealtime plugins it's the start of the range of the timeline to
8357 process.
8359 @item
8361 @b{get_source_position()} For realtime plugins it's the lowest numbered
8362 sample in the requested region to process if playing forward and the
8363 highest numbered sample in the region if playing backward.  For video
8364 it's the start of the frame if playing forward and the end of the frame
8365 if playing in reverse.  The position is relative to the start of the
8366 EDL and in the requested data rate.
8368 For transitions this is always the lowest numbered sample of the region
8369 to process relative to the start of the transition.
8371 @item
8373 @b{get_direction()} Gives the direction of the current playback
8374 operation.  This is a macro defined in transportque.inc.  This is
8375 useful for calling read functions since the read functions position
8376 themselves at the start or end of the region to read, depending on the
8377 playback operation.
8379 @item
8381 @b{local_to_edl()}
8383 @item
8385 @b{edl_to_local()}
8387 These convert between the requested data rate and the project data
8388 rate.  They are used to convert keyframe positions into numbers which
8389 can be interpolated at the requested data rate.  The conversion is
8390 automatically based on frame rate or sample rate depending on the type
8391 of plugin.
8393 @item
8394 @b{get_prev_keyframe(int64_t position, int is_local)}
8396 @item
8397 @b{get_next_keyframe(int64_t position, int is_local)}  
8399 These give the nearest keyframe before or after the position given. 
8400 The macro defined version of load_configuration automatically retrieves
8401 the right keyframes but you may want to do this on your own.
8403 The position argument can be either in the project rate or the
8404 requested rate.  Set is_local to 1 if it's in the requested rate and 0
8405 if it's in the project rate.
8407 In each keyframe, another position value tells the keyframe's position
8408 relative to the start of the timeline and in the project rate.
8410 The only way to get smooth interpolation between keyframes is to
8411 convert the positions in the keyframe objects to the requested rate. 
8412 Do this by using edl_to_local on the keyframe positions.
8414 @end itemize
8428 @node KEYBOARD SHORTCUTS
8429 @chapter KEYBOARD SHORTCUTS
8431 Alex Ferrer started summarizing most of the keyboard shortcuts.  Most
8432 of the keys work without any modifier like shift or ctrl.  Most windows
8433 can be closed with a @b{Ctrl-w}.  Most operations can be cancelled with
8434 @b{ESC} and accepted with @b{Enter}.
8436 @section PROGRAM WINDOW
8439 @subsection Editing Media
8441 @example
8442 z         Undo
8443 Shift Z   Re-Do
8444 x         Cut
8445 c         Copy
8446 v         Paste
8447 Del       Clear
8448 Shift Spc Paste Silence
8449 m         Mute region
8450 a         Select all
8451 shift + click   When done over an edit causes the highlighted selection to extend to the cursor position.
8452                 When done over the boundary of an effect causes the trim operation to apply to one effect.
8453 @end example
8455 @subsection Editing Labels & In/Out Points
8457 @example
8458 [             Toggle In point 
8459 ]             Toggle Out point 
8460 l             Toggle label at current position
8461 Ctrl <-       Go to Previous Label
8462 Ctrl ->       Go to Next Label
8463 @end example
8466 @subsection Navigation
8468 @example
8469 Right arrow      Move right*
8470 Left arrow       Move left*
8471 Up arrow         Zoom out*
8472 Down arrow       Zoom in*
8473 Ctrl Up          Expand waveform amplitude
8474 Ctrl Dn          Shrink waveform amplitude
8475 Alt Up           Expand curve amplitude
8476 Alt Dn           Shrink curve amplitude
8477 f                Fit time displayed to selection
8478 Alt f            Fit curve amplitude to highlighted section of curves
8479 Alt Left         Move left one edit
8480 Alt Right        Move right one edit
8481 Page Up          Move up*
8482 Page Dn          Move down*
8483 Ctrl Page Up     Expand track height
8484 Ctrl Page Dn     Shrink track height
8485 Home             Go to beginning of timeline*
8486 End              Go to end of timeline*
8488 @end example
8490 * You may have to click on the timeline to deactivate any text boxes or
8491 tumblers before these work.
8496 @subsection File operations
8498 @example
8499 n         New project
8500 o         Load Files
8501 s         Save Project
8502 r         Record
8503 Shift R   Render
8504 q         Quit
8505 Shift P   Preferences
8506 Shift B   Batch Render
8507 Shift F   Set Format
8508 @end example
8510 @subsection Key Frame Editing
8512 @example
8514 Shift X    Cut keyframes
8515 Shift C    Copy keyframes
8516 Shift V    Paste keyframes
8517 Shift Del  Clear keyframes
8518 Alt c      Copy default keyframe
8519 Alt v      Paste default keyframe
8521 @end example
8524 @subsection Track Manipulation
8526 @example
8528 t          Add Audio Track
8529 u          Insert default Audio Transition
8530 Shift T    Add Video Track
8531 Shift U    Insert Default Video Transition
8532 d          Delete last Track
8533 Shift L    Loop playback
8534 Tab        Toggle single track arming status
8535 Shift-Tab  Toggle every other track's arming status
8537 @end example
8539 @subsection What's drawn on the timeline
8541 @example
8543 1         Show titles
8544 2         Show transitions
8545 3         Fade keyframes
8546 4         Mute keyframes
8547 5         Mode keyframes
8548 6         Pan keyframes
8549 7         Camera keyframes
8550 8         Projector keyframes
8551 9         Plugin keyframes
8552 0         Mask keyframes
8553 -         Camera Zoom
8554 =         Projector Zoom
8556 @end example
8559 @section VIEWER & COMPOSITOR WINDOWS
8561 @example
8563 x         Cut
8564 c         Copy
8565 v         Paste
8566 v         Splice
8567 b         Overwrite
8568 [         Toggle In point 
8569 ]         Toggle Out point 
8570 l         Toggle label at current position
8571 Ctrl <-   Go to Previous Label
8572 Ctrl ->   Go to Next Label
8573 Home      Go to beginning
8574 End       Go to end
8575 z         Undo
8576 Shift Z   Re-Do
8577 +         Zoom in
8578 -         Zoom out
8580 @end example
8584 @section PLAYBACK TRANSPORT
8586 Transport controls work in any window which has a playback transport.  They are
8587 accessed through the number pad with num lock disabled.
8589 @example
8590 4 Frame back         5 Reverse Slow     6 Reverse      + Reverse Fast
8591 1 Frame Forward      2 Forward Slow     3 Play     Enter Fast Forward
8592 0 Stop
8594 @end example
8596 [ Space bar ] is normal Play, Hitting any key twice is Pause.
8599 Hitting any transport control with CTRL down causes only the region
8600 between the in/out points to be played, if in/out points are defined.
8602 @section RECORD WINDOW
8604 @example
8606 Space              Start and pause recording of the current batch
8607 l                  Toggle label at current position.
8609 @end example
8611 @bye