r822: maybe not depend on xorg-dev
[cinelerra_cv/mob.git] / doc / cinelerra.texi
blobb0485cbd984555ea35c7ee0ef3698835ccf63620
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{} 2005 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 * THE MAIN WINDOWS::         The most often used user interface.
29 * LOADING AND SAVING FILES:: Moving media between disk and Cinelerra.
30 * NAVIGATING THE PROJECT::   Moving around the media.
31 * EDITING::                  Moving the media in time.
32 * USING EFFECTS::            Altering the media.
33 * SETTING PROJECT ATTRIBUTES:: Changing the way the media is displayed.
34 * COMPOSITING::              Overlaying different sources of video.
35 * KEYFRAMES::                Making effects change over time.
36 * CAPTURING MEDIA::          Moving media from the real world to disk.
37 * IMPROVING PERFORMANCE::    Making Cinelerra run better on Linux.
38 * TROUBLESHOOTING::          Problems with Cinelerra.
39 * SECRETS OF CINELERRA::     Unusual applications of Cinelerra to common problems.
40 * SECRETS OF CINELERRA EFFECTS::      Secrets of the more complicated effects.
41 * PLUGIN AUTHORING::         How to write new effects.
42 * KEYBOARD SHORTCUTS::       How to accelerate most commands with the keyboard.
43 @end menu
47 @contents
49 @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.
141 Organizing information in the easiest manner for users to find out what
142 they need to know is sort of like cataloging the internet.  They've
143 been trying to get it right for 30 years and will probably keep trying
144 until the end of time.
146 There a lot of fragments of documentation scattered throughout the
147 internet about Cinelerra.  This document attempts to combine all the
148 pieces of information in one piece.
150 Like the operating system and compiler for a piece of software, the
151 document writing format is the most important thing in choosing our
152 document format.  We wanted a format which would be readable regardless
153 of corporate whims and fads.  A piece of software which compiles on GCC
154 and Linux will be usable as long as there are C compilers.  Documents
155 written in Texinfo will be readable as long as there's a C compiler.
157 After many years of searching for the perfect documentation format
158 we've arrived at TexInfo.  This format can be converted to HTML,
159 printed, automatically indexed, but most importantly is not bound to
160 any commercial word processor.
162 There are no screenshots in this manual.  Screenshots become obsolete
163 quickly and as a result confuse the users.  What looks one way in a
164 screenshot will always look different in the real program because the
165 real program and the manual are always evolving, never perfectly
166 synchronized.  It is true that manuals should have screenshots, but our
167 objective in omitting screenshots is to keep the software costs minimal
168 so you don't have to pay for it.  That includes additional labor to
169 synchronize the manual with the software.
171 In addition to telling you the basic editing features of Cinelerra this
172 manual covers tricks that won't be described anywhere else.  We're
173 going to try to come up with certain things you can do with Cinelerra
174 that you wouldn't think of on your own.
192 @node INSTALLATION
193 @chapter INSTALLATION
196 The Cinelerra package contains Cinelerra and most of the libraries
197 needed to run it.  We try to include all the dependancies because of
198 the difficulty in tracking down the right versions.  Also included are
199 some utilities for handling files.  The following are the general
200 contents of all Cinelerra packages.
202 @itemize
204 @item
206 @b{Foreign language translations} - These go into /usr/share/locale.
208 @item
210 @b{Cinelerra executable} - This goes into /usr/bin
212 @item
214 @b{Cinelerra plugins} - These go into /usr/lib/cinelerra in 32 bit
215 systems and /usr/lib64/cinelerra in 64 bit systems.
217 @item
219 @b{soundtest} - Utility for determining sound card buffer size.
221 @item
223 @b{mplexlo} - Multiplexing of MPEG elementary streams without standards
224 conformance but more efficiently.
226 @item
228 @b{mpeg3cat} - Utility for reading an MPEG file from a certain standard
229 and outputting it to stdout.
231 @item
233 @b{mpeg3toc, mpeg3cat, mpeg3dump} - Utilities/ for indexing and reading MPEG files.
235 @item
237 @b{mpeg3peek} - Utility for displaying the byte offset of a frame in an
238 MPEG file.
240 @end itemize
244 @menu
245 * INSTALLING AN RPM::
246 * COMPILING FROM SCRATCH::
247 * RUNNING CINELERRA::
248 @end menu
257 @node INSTALLING AN RPM
258 @section INSTALLING AN RPM
260 Cinelerra is easiest installed by downloading an RPM and running
262 @example
263 rpm -U --force --nodeps hvirtual*.rpm
264 @end example
266 on a Fedora 4 system.
268 On systems which don't support RPM look for a utility called
269 @b{rpm2cpio}.  Download a Cinelerra RPM and from the /
270 directory run
272 @example
273 rpm2cpio hvirtual*.rpm | cpio -i --make-directories
274 @end example
276 This doesn't always work because there are many forks of the C library,
277 each incompatible with the others.  This is the biggest reason to
278 compile from scratch.
286 @node COMPILING FROM SCRATCH
287 @section COMPILING FROM SCRATCH
289 It should be noted that the compiler used in building Cinelerra
290 binaries is the free GNU compiler and very conservative optimization
291 flags.  Alternative optimization flags and compilers produce varying
292 results.  Compiling the source is hard and there's no warranty if the
293 source code fails to compile, but the method for compiling starts by
294 downloading the source code and decompressing.
296 The compilation is verified on a vanilla Fedora 4 installation,
297 workstation mode.  Fedora doesn't install a lot of dependancies like
298 @b{nasm} and @b{yasm}.  Yes, 3 assemblers are now required to assemble
299 x86 code.  Compiling the source is hard and there's no warranty if the
300 source code fails to compile, but the method for compiling starts by
301 downloading the source code and decompressing.
303 @example
304 tar jxf cinelerra*.tar.bz2
305 @end example
308 The compilation is verified on a Fedora 4 installation.  Fedora 4
309 doesn't install a lot of the reqiured compilers.  Mainly @b{nasm} and
310 @b{yasm}, 2 of the 3 assemblers.  These have to be installed manually
311 for compilation to succeed.
313 Enter the hvirtual directory
315 @example
316 cd cinelerra
317 @end example
319 Then run
321 @example
322 ./configure
323 @end example
325 This checks the build environment for the right tools and should give
326 you an error if a tool is missing.  Once that succeeds run
328 @example
329 make
330 @end example
332 The make procedure should run through all the directories and put
333 binaries in the @b{i686} or @b{x86_64} directories.  When NFS was
334 a lot faster, we compiled Alpha and i686 binaries in the same
335 filesystem with the objects in different subdirectories, so all the
336 binaries are still put in subdirectories.
338 A lot of libraries are included to get the version numbers right.  Some
339 of the libraries don't compile on SMP systems.  One solution is to
340 disable SMP when rebooting and reenable it when compilation is
341 finished.  Another solution is to rerun make over and over until it
342 gets through the offending libraries.
345 Once finished, make sure you are root and run
347 @example
348 make install
349 @end example
351 to install the binaries.  If installation fails it means something
352 failed to compile or you weren't root.  Run @b{make} again and watch
353 for errors.
355 Sometimes you'll want to run @b{make clean} if you're programming
356 something or the system libraries change.  In this case, you'll
357 probably need to run @b{configure} again because some libraries delete
358 their configuration files in @b{make clean}.
360 @node RUNNING CINELERRA
361 @section RUNNING CINELERRA
364 The simplest way to run Cinelerra is by running
367 @example
368 /usr/bin/cinelerra
369 @end example
371 This command hides a much more capable command line interface.  Run
372 @b{cinelerra -h} to get a listing of command line options.  The use of
373 these options is described in several sections.
375 For rendering from the command line @xref{RENDERING FILES}.
388 @node CONFIGURATION
389 @chapter CONFIGURATION
392 Because of the variety of uses, Cinelerra cannot be run optimally
393 without some intimate configuration for your specific needs. Very few
394 parameters are adjustible at compile time.  Runtime configuration is
395 the only option for most configuration because of the multitude of
396 parameters.
398 Here we discuss not only the configuration options but which of the
399 different API's in Linux are supported.
401 Go to @b{settings->preferences} and to see the options.
404 @menu
405 * ENVIRONMENT VARIABLES::  These environment variables are recognized by Cinelerra
406 * PLAYBACK::               Configuring parameters related to playback.
407 * RECORDING::              Configuring parameters related to recording.
408 * PERFORMANCE::            Configuring parameters related to how fast things go.
409 * INTERFACE::              Configuring the user interface.
410 * ABOUT::                  Viewing information about the program.
411 @end menu
414 @node ENVIRONMENT VARIABLES
415 @section ENVIRONMENT VARIABLES
417 In UNIX derivatives, environment variables are global variables in the
418 shell which all applications can read.  They are set with a command
419 like @b{set VARIABLE=value}.  All the environment variables can be
420 viewed with a command like @b{env}.  Cinelerra recognizes the following
421 environment variables:
423 @itemize
425 @item @b{LADSPA_PATH} - If you want to use LADSPA plugins, this must be
426 defined: a colon separated list of directories to search for LADSPA
427 plugins.  These are not native Cinelerra plugins.  @xref{LADSPA
428 EFFECTS}.
431 @end itemize
433 @node PLAYBACK
434 @section PLAYBACK
438 @menu
439 * AUDIO OUT::
440 * VIDEO OUT::
441 @end menu
445 @node AUDIO OUT
446 @subsection AUDIO OUT
448 These determine what happens when you play sound from the timeline.
450 @itemize 
452 @item
453 SAMPLES TO SEND TO CONSOLE:
455 For playing audio, small fragments of sound are read from disk and
456 processed in a virtual console sequentially.  A larger value here
457 causes more latency when you change mixing parameters but gives more
458 reliable playback.
460 Some sound drivers don't allow changing of the console fragment so
461 latency is unchanged no matter what this value is.
463 A good way of ensuring high quality playback was to read bigger
464 fragments from the disk and break them into smaller fragments for the
465 soundcard.  That changed when the virtual console moved from the push
466 model to the pull model.  Since different stages of the rendering
467 pipeline can change the rate of the incoming data, it would now be real
468 hard to disconnect size of the console fragments from the size of the
469 fragments read from disk.
471 @item
473 AUDIO OFFSET:
475 The ability to tell the exact playback position on Linux sound drivers
476 is pretty bad if it's provided at all.  Since this information is
477 required for proper video synchronization, it has to be accurate.  The
478 @b{AUDIO OFFSET} allows users to adjust the position returned by the
479 sound driver to reflect reality.  The audio offset doesn't affect the
480 audio playback or rendering at all.  It merely changes the
481 synchronization of video playback.
483 The easiest way to set the audio offset is to create a timeline with 1
484 video track and one audio track.  Expand the audio track and center the
485 audio pan.  The frame rate should be something over 24fps and the
486 sampling rate should be over 32000.  The frame size should be small
487 enough for your computer to render it at the full framerate.  Highlight
488 a region of the timeline starting at 10 seconds and ending at 20
489 seconds.  Drop a @b{gradient} effect on the video track and configure
490 it to be clearly visible.  Drop a @b{synthesizer} effect on the audio
491 and configure it to be clearly audible.
493 Play the timeline from 0 and watch to see if the gradient effect starts
494 exactly when the audio starts.  If it doesn't, expand the audio track
495 and adjust the nudge.  If the audio starts ahead of the video, decrease
496 the nudge value.  If the audio starts after the video, increase the
497 nudge value.  Once the tracks play back synchronized, copy the nudge
498 value to the @b{AUDIO OFFSET} value in preferences.
500 @b{Note:} if you change sound drivers or you change the value of @b{USE
501 SOFTWARE FOR POSITIONING INFORMATION}, you'll need to change the audio
502 offset because different sound drivers are unequally inaccurate.
504 @item
506 VIEW FOLLOWS PLAYBACK
508 Causes the timeline window to scroll when the playback cursor moves. 
509 This can bog down the X Server or cause the timeline window to lock up
510 for long periods of time while drawing the assetse.
512 @item
513 USE SOFTWARE FOR POSITIONING INFORMATION
515 Most soundcards and sound drivers don't give reliable information on
516 the number of samples the card has played. When playing video you need
517 this information for synchronization. This option causes the sound
518 driver to be ignored and a software timer to be used for
519 synchronization.
521 @item
522 AUDIO PLAYBACK IN REALTIME:
524 Back in the days when 150Mhz was the maximum, this allowed
525 uninterrupted playback on heavy loads.  It forces the audio playback to
526 the highest priority in the kernel.  Today it's most useful for
527 achieving very low latency between console tweeks and soundcard
528 output.  You must be root to get realtime priority.
530 @item
531 AUDIO DRIVER
533 There are many sound drivers for Linux.  This allows selecting one
534 sound driver and setting parameters specific to it.  Here is a
535 description of the sound drivers.
537 @end itemize
539 @menu
540 * COMMON SOUND DRIVER ATTRIBUTES::
541 * OSS::
542 * OSS Envy24::
543 * ALSA::
544 * ESOUND::
545 * RAW 1394::
546 * DV 1394::
547 * IEC 61883::
548 @end menu
550 @node COMMON SOUND DRIVER ATTRIBUTES
551 @subsubsection COMMON SOUND DRIVER ATTRIBUTES
553 @itemize
555 @item
556 DEVICE PATH
558 Usually a file in the @b{/dev/} directory which controls the
559 device.
561 @item
563 BITS
565 The number of bits of precision Cinelerra should set the device for. 
566 This sometimes has a figuritive meaning.  Some sound drivers need to be
567 set to 32 bits to perform 24 bit playback and won't play anything when
568 set to 24 bits.  Some sound drivers need to be set to 24 bits for 24
569 bit playback.
571 @item
573 CHANNELS
575 The number of channels Cinelerra should set the device for.  Regardless
576 of the number of channels in the project, the number of channels set
577 here will be written to the device.  When this is set to 2 and the
578 project has 1 channel you'll hear sound through the left speaker and
579 not centered as expected for a monaural project.  When this is set to 1
580 and the project has 2 channels you'll hear the left channel centered
581 and not 2 channels mixed together.
583 @end itemize
587 @node OSS
588 @subsubsection OSS
590 This was the first Linux sound driver.  It had an open source
591 implementation and a commercial implementation with more sound cards
592 supported.  It was the standard sound driver up to linux 2.4.  It still
593 is the only sound driver which an i386 binary can use when running on
594 an x86_64 system.
596 @node OSS Envy24
597 @subsubsection OSS Envy24
599 The commercial version of OSS had a variant for 24 bit 96 Khz
600 soundcards.  This variant required significant changes to the way the
601 sound drivers were used, which is what the OSS Envy24 variant is for.
604 @node ALSA
605 @subsubsection ALSA
607 ALSA is the most common sound driver in Linux 2.6.  It supports the
608 most sound cards now.  It takes advantage of low latency features in
609 Linux 2.6 to get better performance than OSS had in 2.4 but roughly the
610 same performance that OSS had in 2.0.  Unfortunately ALSA is constantly
611 changing.  A program which works with it one day may not the next day. 
612 New wrappers are being developed on top of ALSA at such a pace, we plan
613 to support them at regular intervals, not at every new release of a new
614 wrapper.
616 ALSA is no longer portable between i386 and x86_64.  If an i386 binary
617 tries to play back on an x86_64 kernel it'll crash.  For this scenario,
618 use OSS.
620 @node ESOUND
621 @subsubsection ESOUND
623 ESOUND is a sound server that sits on top of OSS.  It was written for a
624 window manager.  It supports a limited number of bits and has high
625 latency compared to modern times.
627 @node RAW 1394
628 @subsubsection RAW 1394
630 The first interface between linux software and firewire camcorders. 
631 This was the least reliable way to play audio to a camcorder.  It
632 consisted of a library on top of the kernel commands.
634 @node DV 1394
635 @subsubsection DV 1394
637 The second rewrite of DV camcorder support in Linux.  This was the most
638 reliable way to play audio to a camcorder.  This consisted of direct
639 kernel commands.
641 @node IEC 61883
642 @subsubsection IEC 61883
644 The third rewrite of DV camcorder support in Linux.  This is a library
645 on top of RAW 1394 which is a library on top of the kernel commands. 
646 It's less reliable than DV 1394 but more reliable than RAW 1394.  The
647 next rewrite ought to fix that.
656 @node VIDEO OUT
657 @subsection VIDEO OUT
659 These determine how video gets from the timeline to your eyes.
661 @itemize
663 @item
665 FRAMERATE ACHIEVED
667 The number of frames per second being displayed during playback.  Start
668 playback and stare at this intently.
670 @item
672 SCALING EQUATION
674 When video playback involves any kind of scaling or translation, this
675 algorithm is used.  This doesn't affect 1:1 playback.
677 @itemize
679 @item
680 NEAREST NEIGHBOR ENLARGE AND REDUCE
682 lowest but fastest
683 quality.  Produces jagged edges and uneven motion.
686 @item
688 BICUBIC ENLARGE AND BILINEAR REDUCE
690 highest but slowest
691 quality.  For enlarging a bicubic interpolation is used, which blurs
692 slightly but doesn't reveal stair steps.  For reduction a bilinear
693 interpolation is used, which produces very sharp images and reduces
694 noise.  The bilinear reduced images can be sharpened with a sharpen
695 effect with less noise than a normal sized image.
697 @item
699 BILINEAR ENLARGE AND BILINEAR REDUCE
701 when slight enlargement
702 is needed a bilinear enlargement looks better than a bicubic
703 enlargement.
705 @end itemize
708 @item
710 PRELOAD BUFFER FOR QUICKTIME
712 The Quicktime/AVI decoder can handle DVD sources better when this is
713 around 10000000.  This reduces the amount of seeking required. 
714 Unfortunately when reading high bitrate sources from a hard drive, this
715 tends to slow it down.  For normal use this should be 0.
717 @item
720 VIDEO DRIVER
722 Normally video on the timeline goes to the compositor window during
723 continuous playback and when the insertion point is repositioned. 
724 Instead of sending video to the Compositor window the video driver can
725 be set to send video to another output device during continuous
726 playback.  This doesn't affect where video goes when the insertion
727 point is repositioned, however.
729 The video drivers are now described.
731 @end itemize
733 @menu
734 * COMMON VIDEO DRIVER ATTRIBUTES::
735 * X11::
736 * X11-XV::
737 * BUZ::
738 * RAW 1394 VIDEO PLAYBACK::
739 * DV 1394 VIDEO PLAYBACK::
740 * IEC 61883 VIDEO PLAYBACK::
741 @end menu
743 @node COMMON VIDEO DRIVER ATTRIBUTES
744 @subsubsection COMMON VIDEO DRIVER ATTRIBUTES
747 @itemize
749 @item
751 DISPLAY
753 The is intended for dual monitor
754 displays.  Depending on the value of Display, the Compositor window
755 will appear on a different monitor from the rest of the windows.
757 @item
759 DEVICE PATH
761 Usually a file in the @b{/dev/} directory
762 which controls the device.
764 @item
766 SWAP FIELDS
768 Make the even lines odd and the odd lines even
769 when sending to the device.  On an NTSC or 1080i monitor the fields may
770 need to be swapped to prevent jittery motion.
772 @item
774 OUTPUT CHANNEL
776 Devices with multiple outputs may need a
777 specific connector to send video on.
779 @item
781 PORT
783 The IEEE1394 standard specifies something known as the
784 @b{port}.  This is probably the firewire card number in the system
785 to use.
787 @item
789 CHANNEL
791 The IEEE1394 standard specifies something known as the
792 @b{channel}.  For DV cameras it's always @b{63}.
794 @end itemize
796 @node X11
797 @subsubsection X11
799 This was the first method of video playback on any UNIX system, valid
800 all the way until 1999.  It just writes the RGB triplet for each pixel
801 directly to the window.  It's the slowest playback method.  It's still
802 useful as a fallback when graphics hardware can't handle very large
803 frames.
805 @node X11-XV
806 @subsubsection X11-XV
808 This was the second big method of video playback in UNIX starting in
809 1999.  It converts YUV to RGB in hardware with scaling.  It's the
810 preferred playback method but can't handle large frame sizes.
812 @node BUZ
813 @subsubsection BUZ
815 This is a method for playing motion JPEG-A files directly to a
816 composite analog signal.  It uses a hack of the Video4Linux 1 driver to
817 decompress JPEG in hardware.
819 @node RAW 1394 VIDEO PLAYBACK
820 @subsubsection RAW 1394 VIDEO PLAYBACK
822 The first interface between linux software and firewire camcorders. 
823 This was the least reliable way to play video to a camcorder.  It
824 consisted of a library on top of the kernel commands.
827 @node DV 1394 VIDEO PLAYBACK
828 @subsubsection DV 1394 VIDEO PLAYBACK
830 The second rewrite of DV camcorder support in Linux.  This was the most
831 reliable way to play video to a camcorder.  This consisted of direct
832 kernel commands.
834 @node IEC 61883 VIDEO PLAYBACK
835 @subsubsection IEC 61883 VIDEO PLAYBACK
838 The third rewrite of DV camcorder support in Linux.  This is a library
839 on top of RAW 1394 which is a library on top of the kernel commands. 
840 It's less reliable than DV 1394 but more reliable than RAW 1394.  The
841 next rewrite ought to fix that.
845 @node RECORDING
846 @section RECORDING
848 @menu
849 * AUDIO IN::
850 * VIDEO IN::
851 @end menu
853 @node AUDIO IN
854 @subsection AUDIO IN
856 These determine what happens when you record audio.
858 @itemize
859 @item
861 RECORD DRIVER
863 This is used for recording audio in the Record window.  It may be
864 shared with the Record Driver for video if the audio and video are
865 wrapped in the same stream.  It takes variable parameters depending on
866 the driver.  The parameters have the same meaning as they do for
867 playback.
869 @itemize
870 @item
872 DEVICE PATH
874 Usually a file in the @b{/dev/} directory which controls the
875 device.
877 @item
879 BITS
881 The number of bits of precision Cinelerra should set the device for. 
882 This sometimes has a figuritive meaning.  Some sound drivers need to be
883 set to 32 bits to perform 24 bit recording and won't record anything
884 when set to 24 bits.  Some sound drivers need to be set to 24 bits for
885 24 bit recording.
887 @item
888 CHANNELS
890 The number of channels Cinelerra should set the device for.  Regardless
891 of the number of channels in the record operation, the number of
892 channels set here will be read from the device.  When this is set to 2
893 and the record operation has 1 channel you'll record the left speaker
894 and not a mix of the left and right speakers as expected for a monaural
895 project.  When this is set to 1 and the project has 2 channels you'll
896 record the left and right channels mixed into the left speaker and not
897 1 channel spead across two speakers.
899 @end itemize
901 @item
903 SAMPLES TO WRITE AT A TIME
905 Audio is first read in small fragments from the device.  Many small
906 fragments are combined into a large fragment before writing to disk. 
907 The disk writing process is done in a different thread.  The value here
908 determines how large the combination of fragments is for each disk
909 write.
911 @item
913 SAMPLE RATE FOR RECORDING
915 Regardless of what the project settings are.  This is the sample rate
916 used for recording.  This should be the highest the audio device
917 supports.
919 @end itemize
921 @node VIDEO IN
922 @subsection VIDEO IN
924 These determine what happens when you record video.
926 @itemize
927 @item
929 RECORD DRIVER
931 This is used for recording video in the Record window.  It may be
932 shared with the Record Driver for audio if the audio and video are
933 wrapped in the same stream.  It takes variable parameters depending on
934 the driver.  The parameters have the same meaning as they do for
935 playback.
937 @item
939 FRAMES TO RECORD TO DISK AT A TIME
941 Frames are recorded in a pipeline.  First frames are buffered in the
942 device.  Then they're read into a larger buffer for writing to disk. 
943 The disk writing is done in a different thread as the device reading. 
944 For certain codecs the disk writing uses multiple processors.  This
945 value determines how many frames are written to disk at a time.
947 @item
949 FRAMES TO BUFFER IN DEVICE
951 The number of frames to store in the device before reading.  This
952 determines how much latency there can be in the system before frames
953 are dropped.
955 @item
956 USE SOFTWARE FOR POSITIONING INFORMATION
958 Video uses audio for
961 synchronization but most soundcards don't give accurate position
962 information.  This calculates an estimation of audio position in
963 software instead of the hardware for synchronization.
965 @item
967 SYNC DRIVES AUTOMATICALLY
969 For high bitrate recording the drives may be fast enough to store the
970 data but Linux may wait several minutes and stall as it writes several
971 minutes of data at a time.  This forces Linux to flush its buffers
972 every second instead of every few minutes and produce slightly better
973 realtime behavior.
975 @item
977 SIZE OF CAPTURED FRAME
979 This is the size of the frames recorded.  It is independant of the
980 project frame size because most video devices only record a fixed frame
981 size.  If the frame size given here isn't supported by the device it
982 might crash Cinelerra.
984 @item
985 FRAME RATE FOR RECORDING
987 The frame rate recorded is different from the project settings.  This
988 sets the recorded frame rate.
990 @end itemize
999 @node PERFORMANCE
1000 @section PERFORMANCE
1003 You'll spend most of your time configuring this section.  The main
1004 focus of performance is rendering parameters not available in the
1005 rendering dialog.  
1011 @itemize 
1013 @item
1014 CACHE ITEMS
1018 To speed up rendering, several assets are kept open simultaneously.
1019 This determines how many are kept open.  A number too large may exhaust
1020 your memory pretty fast and result in a crash.  A number too small may
1021 result in slow playback as assets need to be reopened more frequently.
1024 @item
1026 SECONDS TO PREROLL RENDERS
1028 Some effects need a certain amount of time to settle in.  This sets a
1029 number of seconds to render without writing to disk before the selected
1030 region is rendered.  When using the renderfarm you'll sometimes need to
1031 preroll to get seemless transitions between the jobs.  Every job in a
1032 renderfarm is prerolled by this value.  This does not affect background
1033 rendering, however.  Background rendering uses a different preroll
1034 value.
1036 @item
1038 FORCE SINGLE PROCESSOR USE
1040 Cinelerra tries to use all processors on the system by default but
1041 sometimes you'll only want to use one processor, like in a renderfarm
1042 client.  This forces only one processer to be used.  The operating
1043 system, however, usually uses the second processor anyway for disk
1044 access so this option is really a 1.25 processor mode.  The value of
1045 this parameter is used in renderfarm clients.
1047 @end itemize
1050 @menu
1051 * BACKGROUND RENDERING::
1052 * RENDERFARM::
1053 @end menu
1056 @node BACKGROUND RENDERING
1057 @subsection BACKGROUND RENDERING
1059 Background rendering was originally concieved to allow HDTV effects to
1060 be displayed in realtime.  Background rendering causes temporary output
1061 to constantly be rendered while the timeline is being modified.  The
1062 temporary output is played during playack whenever possible.  It's very
1063 useful for transitions and previewing effects which are too slow to
1064 display in a reasonable amount of time.  If renderfarm is enabled, the
1065 renderfarm is used for background rendering, giving you the potential
1066 for realtime effects if enough network bandwidth and CPU nodes exist.
1068 @itemize
1074 @item
1075 FRAMES PER BACKGROUND RENDERING JOB
1077 This only works if renderfarm is being used, otherwise background
1078 rendering creates a single job for the entire timeline.  The number of
1079 frames specified here is scaled to the relative CPU speed of rendering
1080 nodes and used in a single renderfarm job.  The optimum number is 10 -
1081 30 since network bandwidth is used to initialize each job.
1085 @item
1086 FRAMES TO PREROLL BACKGROUND
1088 This is the number of frames to render ahead of each background
1089 rendering job.  Background rendering is degraded when preroll is used
1090 since the jobs are small.  When using background rendering, this number
1091 is ideally 0.  Some effects may require 3 frames of preroll.
1097 @item
1098 OUTPUT FOR BACKGROUND RENDERING
1100 Background rendering generates a sequence of image files in a certain
1101 directory.  This parameter determines the filename prefix of the image
1102 files.  It should be on a fast disk, accessible to every node in the
1103 renderfarm by the same path.  Since hundreds of thousands of image
1104 files are usually created, @b{ls} commands won't work in the
1105 background rendering directory.  The @image{magnify} browse button for
1106 this option normally won't work either, but the @image{wrench}
1107 configuration button for this option works.
1109 @item
1110 FILE FORMAT
1112 The file format for background rendering has to be a sequence of
1113 images. The format of the image sequence determines the quality and
1114 speed of playback.  JPEG is good most of the time.
1117 @end itemize
1119 @node RENDERFARM
1120 @subsection RENDERFARM
1122 To use the renderfarm set these options.  Ignore them for a standalone
1123 system
1125 @itemize
1127 @item
1129 USE RENDER FARM FOR RENDERING
1131 When selected, all the
1132 @b{file->render} operations use the renderfarm.
1134 @item
1136 NODES
1138 Displays all the nodes on the renderfarm and which ones are active. 
1140 Nodes are added by entering the host name of the node, verifying the
1141 value of @b{port} and hitting @b{add node}.
1143 Computer freaks may be better off editing the
1144 @b{~/.bcast/.Cinelerra_rc} file than this if they have hundreds of
1145 nodes.  Remember that .Cinelerra_rc is overwritten whenever a copy of
1146 Cinelerra exits.
1148 Select the @b{ON} column to activate and deactivate nodes once they
1149 are created.
1151 Nodes may be edited by highlighting a row and hitting @b{apply changes}.
1153 @item
1155 HOSTNAME
1157 Edit the hostname of an existing node or enter the hostname of a new
1158 node here.
1160 @item
1162 PORT
1164 Edit the port of an existing node or enter the port of a new node here.
1166 @item
1168 REPLACE NODE
1170 When editing an existing node, hit this to commit the changes to
1171 @b{HOSTNAME} and @b{PORT}.  The changes won't be committed if you
1172 don't hit this button.
1174 @item
1176 ADD NODE
1178 Create a new node with the @b{HOSTNAME} and @b{PORT} settings.
1180 @item
1182 DELETE NODE
1184 Deletes whatever node is highlighted in the @b{NODES} list.
1186 @item
1188 SORT NODES
1190 Sorts the @b{NODES} list based on the hostname.
1192 @item
1194 RESET RATES
1196 This sets the framerate for all the nodes to 0.  Frame rates are used
1197 to scale job sizes based on CPU speed of the node.  Frame rates are
1198 only calculated when renderfarm is enabled.
1205 @item
1207 TOTAL JOBS TO CREATE
1209 Determines the number of jobs to dispatch to the renderfarm.  The more
1210 jobs you create, the more finely balanced the renderfarm becomes.
1212 Determine the total jobs to create by multiplying the number of nodes
1213 including the master node by some number.  Multiply them by 1 to have
1214 one job dispatched for every node.  Multiply them by 3 to have 3 jobs
1215 dispatched for every node.  If you have 10 slave nodes and one master
1216 node, specify 33 to have a well balanced renderfarm.
1218 @end itemize
1224 @node INTERFACE
1225 @section INTERFACE
1227 These parameters affect purely how the user interface works.
1229 @itemize
1231 @item
1233 INDEX FILES GO HERE
1235 Back in the days when 4 MB/sec was unearthly speed for a hard drive,
1236 index files were introduced to speed up drawing the audio tracks.  This
1237 option determines where index files are placed on the hard drive.
1240 @item
1242 SIZE OF INDEX FILE
1244 Determines the size of an index file. Larger index sizes allow smaller
1245 files to be drawn faster while slowing down the drawing of large files.
1246 Smaller index sizes allow large files to be drawn faster while slowing
1247 down small files.
1249 @item
1251 NUMBER OF INDEX FILES TO KEEP
1253 To keep the index directory from becoming unruly, old index files are
1254 deleted. This determines the maximum number of index files to keep in
1255 the directory.
1257 @item
1259 DELETE ALL INDEXES
1261 When you change the index size or you want to clean out excessive index
1262 files, this deletes all the index files.
1264 @item
1265 USE HOURS:MINUTES:SECONDS.XXX
1267 Various representations of time are given.  Select the most convenient
1268 one.  The time representation can also be changed by @b{CTRL}
1269 clicking on the time ruler.
1271 @item
1272 USE THUMBNAILS
1274 The Resource Window displays thumbnails of assets by default.  This can
1275 take a long time to set up.  This option disables the thumbnails.
1277 @item
1278 CLICKING IN/OUT POINTS DOES WHAT
1280 Cinelerra not only allows you to perform editing by dragging in/out
1281 points but also defines three seperate operations which occur when you
1282 drag an in/out point. For each mouse button you select the behavior in
1283 this window. The usage of each editing mode is described in editing.
1285 @item
1286 MIN DB FOR METER
1288 Some sound sources have a lower noise threshold than others. 
1289 Everything below the noise threshold is meaningless.  This option sets
1290 the meters to clip below a certain level.  Consumer soundcards usually
1291 bottom out at -65.  Professional soundcards bottom out at -90.
1292 @xref{SOUND LEVEL METERS}.
1294 @item
1295 MAX DB FOR METER
1297 This sets the maximum sound level represented by the sound meters.  No
1298 matter what this value is, no soundcard can play sound over 0 db.  This
1299 value is presented merely to show how far over the limit a sound wave
1301 @xref{SOUND LEVEL METERS}.
1303 @item
1304 THEME
1306 Cinelerra supports variable themes.  Select one here and restart
1307 Cinelerra to see it.
1309 @end itemize
1313 @node ABOUT
1314 @section ABOUT
1316 This section gives you information about the copyright, the time of the
1317 current build, the lack of a warranty, and the versions of some of the
1318 libraries.  Be sure to agree to the terms of the lack of the warranty.
1324 @node THE MAIN WINDOWS
1325 @chapter THE MAIN WINDOWS
1327 When Cinelerra first starts, you'll get four main windows.  Hitting
1328 @b{CTRL-w} in any window closes it.
1331 @menu
1332 * VIEWER::
1333 * COMPOSITOR::
1334 * PROGRAM::
1335 * RESOURCES::
1336 * SOUND LEVEL METERS::
1337 * OTHER WINDOWS::
1338 @end menu
1340 @node VIEWER
1341 @section VIEWER
1344 In here you'll scrub around source media and clips, selecting regions
1345 to paste into the project.  Operations done in the viewer affect a
1346 temporary EDL or a clip but not the timeline.
1348 @node COMPOSITOR
1349 @section COMPOSITOR
1352 This window displays the output of the timeline.  It's the interface
1353 for most compositing operations or operations that affect the
1354 appearance of the timeline output.  Operations done in the Compositor
1355 affect the timeline but don't affect clips.
1357 The video output has several navigation functions.  The video output
1358 size is either locked to the window size or unlocked with scrollbars
1359 for navigation.  The video output can be zoomed in and out and panned. 
1360 Navigating the video output this way doesn't affect the rendered
1361 output, it just changes the point of view in the compositor window.
1363 If it is unlocked from the window size, middle clicking and dragging
1364 anywhere in the video pans the point of view.
1366 Hitting the + and - keys zooms in and out of the video output.
1368 Underneath the video output are copies of many of the functions
1369 available in the main window.  In addition there is a
1370 @image{cwindow_zoom} zoom menu and a @image{cwindow_light} tally light.
1372 The zoom menu jumps to all the possible zoom settings and, through the
1373 @b{Auto} option, locks the video to the window size.  The zoom menu
1374 does not affect the window size.
1376 The tally light turns red when rendering is happening.  This is useful
1377 for knowing if the output is current.
1379 Right clicking anywhere in the video output brings up a menu with all
1380 the zoom levels and some other options.  In this particular case the
1381 zoom levels resize the entire window and not just the video.  
1383 The @b{reset camera} and @b{reset projector} options center the camera
1384 and projector @xref{COMPOSITING}.
1386 The @b{Hide controls} option hides everything except the video.
1388 On the left of the video output is a toolbar specific to the compositor
1389 window.  Here are the functions in the toolbar:
1391 @menu
1392 * PROTECT VIDEO::
1393 * MAGNIFYING GLASS::
1394 * MASKS TOOL::
1395 * CAMERA::
1396 * PROJECTOR::
1397 * CROP TOOL::
1398 * EYEDROPPER::
1399 * TOOL INFO::
1400 * SAFE REGIONS TOOL::
1401 @end menu
1403 @node PROTECT VIDEO
1404 @subsection PROTECT VIDEO
1406 @image{protect}
1408 This disables changes to the compositor output from clicks in it.  It
1409 is an extra layer on top of the track arming toggle to prevent
1410 unwanted changes.
1412 @node MAGNIFYING GLASS
1413 @subsection MAGNIFYING GLASS
1415 @image{magnify}
1417 This zooms in and out of the compositor output without resizing the
1418 window.  If the video output is currently locked to the size of the
1419 window, clicking in it with the magnifying glass unlocks it and
1420 creates scrollbars for navigation.
1422 Left clicking in the video zooms in.
1424 Ctrl clicking in the video zooms out.
1426 Rotating the wheel on a wheel mouse zooms in and out.
1429 @node MASKS TOOL
1430 @subsection MASKS TOOL
1432 @image{mask}
1434 This brings up the mask editing tool @xref{MASKS}.  Enable the
1435 @image{toolwindow} tool window to see options for this tool.
1437 @node CAMERA
1438 @subsection CAMERA
1441 @image{camera}
1443 This brings up the camera editing tool @xref{THE CAMERA AND
1444 PROJECTOR}.  Enable the @image{toolwindow} tool window to see options
1445 for this tool.
1447 @node PROJECTOR
1448 @subsection PROJECTOR
1450 @image{projector}
1452 This brings up the projector editing tool @xref{THE CAMERA AND
1453 PROJECTOR}.  Enable the @image{toolwindow} tool window to see options
1454 for this tool.
1456 @node CROP TOOL
1457 @subsection CROP TOOL
1459 @image{crop}
1461 This brings up the cropping tool @xref{CROPPING}.  The
1462 @image{toolwindow} tool window must be enabled to use this tool.
1464 @node EYEDROPPER
1465 @subsection EYEDROPPER
1467 @image{eyedrop}
1469 This brings up the eyedropper.  The eyedropper detects whatever color
1470 is under it and stores it in a temporary area.  Enabling the
1471 @image{toolwindow} tool info shows the currently selected color.  Click
1472 anywhere in the video output to select the color at that point.
1474 The eyedropper not only lets you see areas which are clipped, but its
1475 value can be applied to many effects.  Different effects handle the
1476 eyedropper differently.
1479 @node TOOL INFO
1480 @subsection TOOL INFO
1482 @image{toolwindow}
1484 This brings up a window containing options for the currently selected
1485 tool.
1488 @node SAFE REGIONS TOOL
1489 @subsection SAFE REGIONS TOOL
1491 @image{titlesafe}
1493 This draws the safe regions in the video output.  This doesn't affect
1494 the rendered output @xref{SAFE REGIONS}.
1506 @node PROGRAM
1507 @section PROGRAM
1510 This contains the timeline and the entry point for all menu driven
1511 operations.  The timeline consists of a vertical stack of tracks with
1512 horizontal representation of time.  This defines the output of
1513 rendering operations and what is saved when you save files.  Left of
1514 the timeline is the patchbay which contains options affecting each
1515 track.
1517 Under the @b{Window} menu you'll find options affecting the main
1518 windows.  @b{default positions} repositions all the windows to a 4
1519 screen editing configuration.  On dual headed displays, the
1520 @b{default positions} operation fills only one monitor with windows.
1523 @node RESOURCES
1524 @section RESOURCES
1527 Effects, transitions, clips, and assets are accessed here.  Most of the
1528 resources are inserted into the project by dragging them out of the
1529 resource window.  Management of resource allocation is also performed
1530 here.
1532 @node SOUND LEVEL METERS
1533 @section SOUND LEVEL METERS
1535 An additional window, the @b{levels window} can be brought up from
1536 the @b{Window} menu.  The @b{levels} window displays the output
1537 audio levels after all mixing is done.
1539 Sound level meters appear in many locations.  They can be toggled in
1540 the viewer and compositor windows with the @image{show_meters} level
1541 toggle. They appear in the patchbay when a track is expanded (@xref{THE
1542 PATCHBAY}.)  They appear in the recording monitor when audio is being
1543 recorded.  
1545 The sound levels in the @b{levels window, compositor, and viewer}
1546 correspond to the final output levels before they are clipped to the
1547 soundcard range.  In the @b{record monitor} they are the input values
1548 from the sound card.  In the @b{patchbay} they are the sound levels for
1549 each track after all effects are processed and before downmixing for
1550 the output.
1552 Most of the time, audio levels have numerical markings in DB but in the
1553 patchbay there isn't enough room.
1555 The sound level is color coded as an extra means of determining the
1556 sound level.  Even without numerical markings, the sound level color
1557 can distinguish between several ranges and overload.  Look at the color
1558 codings in a meter with numerical markings to see what colors
1559 correspond to what sound level.  Then for meters in the patchbay in
1560 expanded audio tracks, use the color codings to see if it's overloading.
1562 Be aware that sound levels in Cinelerra can go above 0DB.  This allows
1563 not only seeing if a track is overloading but how much information is
1564 being lost by the overloading.  Overloading by less than 3DB is usually
1565 acceptable.  While overloading is treated as positive numbers in
1566 Cinelerra, it is clipped to 0 when sent to a sound card or file.
1568 The visible range of the sound level meters is configurable in
1569 @b{settings->preferences->interface} (@xref{INTERFACE}.)
1571 @node OTHER WINDOWS
1572 @section OTHER WINDOWS
1574 The @b{Overlays window} can be brought up from the @b{Window}
1575 menu.  This is a quick way to toggle what is drawn in the timeline. 
1576 Every option in the @b{View} menu is available here.
1584 @node LOADING AND SAVING FILES
1585 @chapter LOADING AND SAVING FILES
1588 @menu
1589 * SUPPORTED FILE FORMATS::     What formats Cinelerra can import and export
1590 * LOADING FILES::              Loading all types of files
1591 * LOADING THE BACKUP::         Recovering the session from before a crash
1592 * SAVING FILES::               Saving edit decision lists
1593 * RENDERING FILES::            Saving media files
1594 @end menu
1605 @node SUPPORTED FILE FORMATS
1606 @section SUPPORTED FILE FORMATS
1608 Here are most of the supported file formats and notes regarding their
1609 compression.  You may be able to load other formats not described here.
1611 The format of the file affects what Cinelerra does with it.  Edit
1612 decision lists replace the project settings.  Formats which contain
1613 media but no edit decisions just add data to the tracks.  If your
1614 project sample rate is 48khz and you load a sound file with 96khz,
1615 you'll still be playing it at 48khz.   If you load an EDL file at 96khz
1616 and the current project sample rate is 48khz, you'll change it to
1617 96khz.
1619 Some file formats are very slow to display on the timeline.  These
1620 usually have video which is highly compressed.  Drawing highly
1621 compressed video picons can be very slow.  Disable picon drawing for
1622 these files with the @b{draw media} toggle to speed up operations.
1625 @sp 1
1626 @image{track_attributes}
1627 @b{Track attributes}
1629 Supported file formats are currently:
1631 @itemize
1632 @item
1634 @item
1636 @item
1637 AIFF
1638 @item
1639 AC3 audio
1640 @end itemize
1642 @menu
1643 * QUICKTIME::
1644 * MPEG-4 AUDIO::
1645 * IMAGE SEQUENCES::
1646 * STILL IMAGES::
1647 * AVI::
1648 * MPEG FILES CONTAINING VIDEO::
1649 * DVD MOVIES::
1650 * MPEG 1 AUDIO::
1651 * OGG THEORA/VORBIS::
1652 * EDIT DECISION LIST::
1653 @end menu
1656 @node QUICKTIME
1657 @subsection QUICKTIME
1658 Quicktime is not the standard for UNIX but we use it because it's well
1659 documented.  All of the Quicktime movies on the internet are
1660 compressed.  Cinelerra doesn't support most compressed Quicktime movies
1661 but does support some.  If it crashes when loading a Quicktime movie,
1662 that means the format probably wasn't supported.
1664 @b{NOTES ON QUICKTIME ENCODING}
1666 Here are some notes regarding making Quicktime movies in Cinelerra:
1668 Quicktime is a wrapper for 2 codecs, a video codec and an audio codec. 
1669 The video and audio codecs are picked separately.  The preferred
1670 encoding for Quicktime output is MPEG-4 Video and MPEG-4 Audio.  This
1671 format plays in the commercial players for Windows and has good
1672 compression quality.  For better compression, use H-264 Video. 
1673 Unfortunately H-264 decoding is so slow it can't play very large frame
1674 sizes.
1676 Cinelerra supports 2 nonstandard codecs: Dual MPEG-4 video and dual
1677 H.264 video.  These won't play in anything but Cinelerra and XMovie. 
1678 They are designed for movies where the frames have been divided into 2
1679 fields, each field displayed sequentially.  The dual codecs interleave
1680 2 video streams to improve efficiency without requiring major changes
1681 to the player.
1683 @node MPEG-4 AUDIO
1684 @subsection MPEG-4 AUDIO
1686 This is the same as Quicktime with MPEG-4 Audio as the audio codec.
1688 @node IMAGE SEQUENCES
1689 @subsection IMAGE SEQUENCES
1692 Rendering an image sequence is not the same as rendering a single
1693 image.  When rendering an image sequence Cinelerra generates a table of
1694 contents file for the image sequence and makes a different image file
1695 for every timeline position.  The table of contents can be loaded
1696 instead of the individual images to get better performance.  To learn
1697 more about the different image formats supported in an image sequence,
1698 read about still images.
1701 @node STILL IMAGES
1702 @subsection STILL IMAGES
1705 Rendering a single image causes the image file to be overwritten for
1706 every timeline position.  No table of contents is created.  When
1707 loaded, the image takes up one frame in length and doesn't change the
1708 project attributes.
1710 Several still image formats not normally found in other programs are
1711 described here.
1713 @menu
1714 * OPEN EXR IMAGES::
1715 * RAW DIGITAL CAMERA IMAGES::
1716 @end menu
1718 @node OPEN EXR IMAGES
1719 @subsubsection OPEN EXR IMAGES
1721 You may not know about Open EXR.  This format stores floating point RGB
1722 images.  It also supports a small amount of compression.  Projects
1723 which render to EXR should be in a floating point color model to take
1724 advantage of it @xref{SETTING PROJECT ATTRIBUTES}.  Several compression
1725 options are available for EXR.
1727 @itemize
1729 @item
1731 @b{PIZ} Lossless wavelet compression.  This is the best compression.
1733 @item
1734 @b{ZIP} Lossless gzip algorithm.
1736 @item
1737 @b{RLE} Lossless run length encoding.  This is the fastest and worst
1738 compression.
1740 @item
1741 @b{PXR24} Lossy compression where the floating point numbers are
1742 converted to 24 bits and compressed with gzip.
1744 @end itemize
1746 Select @b{Use Alpha} if the project colormodel has an alpha channel and
1747 you want to retain it in the file.  Otherwise the primary colors are
1748 multiplied by the alpha channel.
1750 @node RAW DIGITAL CAMERA IMAGES
1751 @subsubsection RAW DIGITAL CAMERA IMAGES
1753 RAW digital camera images are a special kind of image file which
1754 Cinelerra only imports.  These must be processed in a floating point
1755 color space once they are on the timeline.  Raw images from Canon
1756 cameras are the only ones tested.  They need to have the @b{Linearize}
1757 effect applied to correct gamma.  Because raw images take a long time
1758 to interpolate, they are usually viewed first in a proxy file and then
1759 touched up.
1761 First apply the Linearize effect to a track of raw images and set it to
1762 @b{automatic} with @b{0.6} gamma.  Then render the timeline to a
1763 Quicktime JPEG file.  Append the Quicktime JPEG file in a new track and
1764 disable playback of the old track.  Now the gamma corrected copy of
1765 each raw image can be previewed relatively fast in the same timeline
1766 position as the original image.
1770 @node AVI
1771 @subsection AVI
1773 AVI with assorted audio and video codecs.  Because AVI is so
1774 fragmented, your luck will vary.
1777 @node MPEG FILES CONTAINING VIDEO
1778 @subsection MPEG FILES CONTAINING VIDEO
1781 MPEG files containing video can be loaded directly into Cinelerra.  If
1782 the file is supported, a table of contents is built.  If the file is
1783 unsupported, it usually crashes or shows very short tracks. 
1784 Unfortunately, this method of loading MPEG files isn't good enough if
1785 you intend to use the files in a renderfarm.  
1787 To use MPEG files in a renderfarm you need to run @b{mpeg3toc} to
1788 generate a table of contents for the file, then load the table of
1789 contents.  Mpeg3toc needs the absolute path of the MPEG file.  If you
1790 don't use an absolute path, it assumes the MPEG file is in the same
1791 directory that Cinelerra is run from.
1793 MPEG streams are structured into multiple tracks.  Each track can be
1794 video or audio.  Each audio track can have 1-6 channels.  Cinelerra
1795 converts each channel of audio into a track.
1797 @b{NOTES ON MPEG VIDEO ENCODING}
1799 MPEG video encoding is done separately from MPEG audio encoding.  In
1800 MPEG video there are 2 colormodels.  The YUV 4:2:0 colormodel is
1801 encoded by a highly optimized version of mpeg2enc with presets for
1802 standard consumer electronics.  In the process of optimizing mpeg2enc,
1803 they got rid of YUV 4:2:2 encoding.  The YUV 4:2:2 colormodel is
1804 encoded by a less optimized version of mpeg2enc.
1806 YUV 4:2:2 encoding was kept around because the NTSC version of DV video
1807 loses too much quality when transferred to YUV 4:2:0.  This DV video
1808 must be transferred to YUV 4:2:2.
1810 When encoding YUV 4:2:0, the bitrate parameter changes meaning
1811 depending on whether the bitrate or quantization is fixed.  If the
1812 bitrate is fixed, it's the target bitrate.  If the quantization is
1813 fixed, it's the maximum bitrate allowed.  This is a quirk of the
1814 mpeg2enc version.
1816 @node DVD MOVIES
1817 @subsection DVD MOVIES
1820 DVD's are spit into a number of programs, each identified by a unique
1821 @b{IFO} file.  If you want to load a DVD, find the corresponding
1822 @b{IFO} file for the program of interest.  Load the IFO file directly
1823 and a table of contents will be built.  Alternatively for renderfarm
1824 usage, a table of contents can be created separately.
1826 @example
1827 mpeg3toc /cdrom/video_ts/vts_01_0.ifo dvd.toc
1828 @end example
1830 or something similar.  Then load @b{dvd.toc}.
1832 You need to run @b{mpeg3toc} on these just like MPEG 1,2 video. 
1835 @node MPEG 1 AUDIO
1836 @subsection MPEG 1 AUDIO
1838 These are .mp2 and .mp3 files.  If fixed bitrate, they can be loaded
1839 directly with no table of contents.  Variable bitrate streams need to
1840 have a table of contents created with @b{mpeg3toc}.
1842 @node OGG THEORA/VORBIS
1843 @subsection OGG THEORA/VORBIS
1846 The OGG format is an antiquated but supposedly unpatented way of
1847 compressing audio and video.  The quality isn't as good as H.264 or
1848 MPEG-4 Audio.  In reality, anyone with enough money and desire can find
1849 a patent in anything so the justification for OGG is questionable.
1851 @node EDIT DECISION LIST
1852 @subsection EDIT DECISION LIST
1855 Edit decision lists are generated by Cinelerra for storing projects. 
1856 They end in .xml.  They change project attributes when loaded.
1858 Because edit decision lists consist of text, they can be edited in a
1859 text editor.
1878 @node LOADING FILES
1879 @section LOADING FILES
1881 All data that you work with in Cinelerra is acquired either by
1882 @b{recording from a device} or by @b{loading from disk}.  This
1883 section describes loading.
1885 The loading and playing of files is just as you would expect. Just go
1886 to @b{file->Load}, select a file for loading, and hit @b{ok}. Hit
1887 the forward play button and it should start playing, regardless of
1888 whether a progress bar has popped up.
1890 Another way to load files is to pass the filenames as arguments on the
1891 command line.  This creates new tracks for every file and starts the
1892 program with all the arguments loaded.
1894 If the file is a still image, the project's attributes are not changed
1895 and the first frame of the track becomes the image.  If the file has
1896 audio, Cinelerra may build an index file for it to speed up drawing. 
1897 You can edit and play the file while the index file is being built.
1899 @menu
1900 * INSERTION STRATEGY::
1901 * LOADING MULTIPLE FILES::
1902 @end menu
1914 @node INSERTION STRATEGY
1915 @subsection INSERTION STRATEGY
1917 Usually three things happen when you load a file.  First the existing
1918 project is cleared from the screen, second the project's attributes are
1919 changed to match the file's, and finally the new file's tracks are
1920 created in the timeline.
1922 But Cinelerra lets you change what happens when you load a file.
1924 In the file selection box go to the @b{Insertion strategy} box and
1925 select it.  Each of these options loads the file a different way.
1927 @itemize
1930 @item
1931 Replace current project
1933 All tracks in the current project are deleted and new tracks are
1934 created to match the source.  Project attributes are only changed when
1935 loading XML.  If multiple files are selected it adds new tracks for
1936 every file.
1938 @item
1939 Replace current project and concatenate tracks
1941 Same as replace current project except if multiple files are selected
1942 it concatenates the tracks of every file after the first.
1944 @item
1945 Append in new tracks
1947 The current project is not deleted and new tracks are created for the
1948 source.
1950 @item
1951 Concatenate to existing tracks
1953 The current project is not deleted and new files are concatenated to
1954 the existing tracks.
1956 @item
1957 Paste at insertion point
1959 The file is pasted in like a normal paste operation.
1961 @item
1962 Create new resources only
1964 The timeline is unchanged and new resources are created in the Resource
1965 Window.
1967 @end itemize
1970 The insertion strategy is a recurring option in many of Cinelerra's
1971 functions.  In each place the options do the same thing.  With these
1972 options you can almost do all your editing by loading files.
1974 If you load files by passing command line arguments to Cinelerra, the
1975 files are loaded with @b{Replace current project} rules.
1981 @node LOADING MULTIPLE FILES
1982 @subsection LOADING MULTIPLE FILES
1984 In the file selection box go to the list of files.  Select a file.  Go
1985 to another file and select it while holding down @b{CTRL}.  This
1986 selects one additional file.  Go to another file and select it while
1987 holding down @b{SHIFT}.  This selects every intervening file.  This
1988 behavior is available in most every list box.
1990 Select a bunch of mp3 files and @b{Replace current project and
1991 concatenate tracks} in the insertion strategy to create a song
1992 playlist.
1997 @node LOADING THE BACKUP
1998 @section LOADING THE BACKUP
2000 There is one special XML file on disk at all times.  After every
2001 editing operation Cinelerra saves the current project to a backup in
2002 @b{$HOME/.bcast/backup.xml}.  In the event of a crash go to
2003 @b{file->load backup} to load the backup.  It is important after a
2004 crash to reboot Cinelerra without performing any editing operations. 
2005 Loading the backup should be the first operation or you'll overwrite
2006 the backup.
2009 @node SAVING FILES
2010 @section SAVING FILES
2012 When Cinelerra saves a file it saves an edit decision list of the
2013 current project but doesn't save any media.  Go to @b{File->save
2014 as...}.  Select a file to overwrite or enter a new file.  Cinelerra
2015 automatically concatenates @b{.xml} to the filename if no
2016 @b{.xml} extension is given.
2018 The saved file contains all the project settings and locations of every
2019 edit but instead of media it contains pointers to the original media
2020 files on disk.
2022 For each media file the XML file stores either an absolute path or just
2023 the relative path.  If the media is in the same directory as the XML
2024 file a relative path is saved.  If it's in a different directory an
2025 absolute path is saved.
2027 In order to move XML files around without breaking the media linkages
2028 you either need to keep the media in the same directory as XML file
2029 forever or save the XML file in a different directory than the media
2030 and not move the media ever again.
2032 If you want to create an audio playlist and burn it on CD-ROM, save the
2033 XML file in the same directory as the audio files and burn the entire
2034 directory.  This keeps the media paths relative.
2036 XML files are useful for saving the current state before going to sleep
2037 and saving audio playlists but they're limited in that they're specific
2038 to Cinelerra.  You can't play XML files in a dedicated movie player. 
2039 Realtime effects in an XML file have to be resynthesized every time you
2040 play it back.  The XML file also requires you to maintain copies of all
2041 the source assets on hard drives, which can take up space and cost a
2042 lot of electricity to spin.  For a more persistent storage of the
2043 output there's rendering.
2050 @node RENDERING FILES
2051 @section RENDERING FILES
2053 Rendering takes a section of the timeline, performs all the editing,
2054 effects and compositing, and stores it in a pure movie file.  You can
2055 then delete all the source assets, play the rendered file in a movie
2056 player, or bring it back into Cinelerra for more editing.  It's very
2057 difficult to retouch any editing decisions in the pure movie file,
2058 however, so keep the original assets and XML file around several days
2059 after you render it.
2061 All rendering operations are based on a region of the timeling to be
2062 rendered.  You need to define this region on the timeline.  The
2063 navigation section describes methods of defining regions. 
2064 @xref{NAVIGATING THE PROJECT}.  The rendering functions define the
2065 region based on a set of rules.  When a region is highlighted or in/out
2066 points are set, the affected region is rendered.  When no region is
2067 highlighted, everything after the insertion point is rendered.  Merely
2068 by positioning the insertion point at the beginning of a track and
2069 unsetting all in/out points, the entire track is rendered.
2073 @menu
2074 * SINGLE FILE RENDERING::      Rendering a single file
2075 * BATCH RENDERING::            Rendering several files unattended
2076 * THE RENDER FARM::            Rendering using many computers
2077 * COMMAND LINE RENDERING::     Rendering from the command line without a GUI
2078 @end menu
2082 @node SINGLE FILE RENDERING
2083 @subsection SINGLE FILE RENDERING
2085 The fastest way to get media to disk is to use the single file
2086 rendering function.
2088 Go to @b{File->render} to bring up the render dialog.  Select the
2089 magnifying glass @image{magnify} to bring up a file selection dialog.  This determines
2090 the filename to write the rendered file to and the encoding parameters.
2092 In the render dialog select a format from the @b{File Format} menu. 
2093 The format of the file determines whether you can render audio or video
2094 or both.  Select the @b{Render audio tracks} toggle to generate
2095 audio tracks and @b{Render video tracks} to generate video tracks.
2098 Select the wrench @image{wrench} next to each toggle to set compression
2099 parameters.  If the file format can't store audio or video the
2100 compression parameters will be blank.  If @b{Render audio tracks} or
2101 @b{Render video tracks} is selected and the file format doesn't
2102 support it, trying to render will pop up an error.
2104 The @b{Create new file at each label} option causes a new file to be
2105 created when every label in the timeline is encountered.  This is
2106 useful for dividing long audio recordings into individual tracks.  When
2107 using the renderfarm, @b{Create new file at each label} causes one
2108 renderfarm job to be created at every label instead of using the
2109 internal load balancing algorithm to space jobs.
2111 When @b{Create new file at each label} is selected, a new filename
2112 is created for every output file.  If the filename given in the render
2113 dialog has a 2 digit number in it, the 2 digit number is overwritten
2114 with a different incremental number for every output file.  If no 2
2115 digit number is given, Cinelerra automatically concatenates a number to
2116 the end of the given filename for every output file.
2118 In the filename @b{/hmov/track01.wav} the @b{01} would be
2119 overwritten for every output file.  The filename
2120 @b{/hmov/track.wav}; however, would become @b{/hmov/track.wav001}
2121 and so on and so forth.  Filename regeneration is only used when either
2122 renderfarm mode is active or creating new files for every label is
2123 active.
2125 Finally the render dialog lets you select an insertion mode.  The
2126 insertion modes are the same as with loading files.  In this case if
2127 you select @b{insert nothing} the file will be written out to disk
2128 without changing the current project.  For other insertion strategies
2129 be sure to prepare the timeline to have the output inserted at the
2130 right position before the rendering operation is finished. 
2131 @xref{EDITING}.  Editing describes how to cause output to be inserted
2132 at the right position.
2134 It should be noted that even if you only have audio or only have video
2135 rendered, a @b{paste} insertion strategy will behave like a normal
2136 paste operation, erasing any selected region of the timeline and
2137 pasting just the data that was rendered.  If you render only audio and
2138 have some video tracks armed, the video tracks will get truncated while
2139 the audio output is pasted into the audio tracks.
2143 @node BATCH RENDERING
2144 @subsection BATCH RENDERING
2148 If you want to render many projects to media files without having to
2149 repeatedly attend to the @b{Render} dialog, @b{batch rendering} is the
2150 function to use.  In this function, you specify many EDL files to
2151 render and the unique output files for each.  Then Cinelerra loads each
2152 EDL file and renders it automatically, without any user intervention. 
2153 Each EDL file and its output to be rendered is called a @b{batch}. 
2154 This allows a huge amount of media to be processed and greatly
2155 increases the value of an expensive computer.
2157 The first thing to do when preparing to do batch rendering is define
2158 projects to be rendered.  The batch renderer requires a separate EDL
2159 file for every batch to be rendered.  Set up a project and define the
2160 region to be rendered either by highlighting it, setting in/out points
2161 around it, or positioning the insertion point before it.  Then save the
2162 project as an EDL.  Define as many projects as needed this way.  The
2163 batch renderer takes the active region from the EDL file for rendering.
2165 With all the EDL files prepared with active regions, go to
2166 @b{File->batch render}.  This brings up the batch rendering dialog. 
2167 The interface for batch rendering is a bit more complex than for single
2168 file rendering.
2171 A list of batches must be defined before starting a batch rendering
2172 operation.  The table of batches appears on the bottom of the batch
2173 render dialog and is called @b{batches to render}.  Above this are
2174 the configuration parameters for a single batch.
2176 Set the @b{output path}, @b{file format}, @b{Audio}, @b{Video}, and
2177 @b{Create new file at each label} parameters as if it was a single
2178 file.  These parameters apply to only one batch.  In addition to the
2179 standard rendering parameters, you must select the source EDL to use in
2180 the batch.  Do this by setting the @b{EDL path}.
2182 If the @b{batches to render} list is empty or nothing is highlighted,
2183 click @b{New} to create a new batch.  The new batch will contain all
2184 the parameters you just set.
2186 Repeatedly press the @b{New} button to create more batches with the
2187 same parameters.  Highlight any batch and edit the configuration on the
2188 top of the batch render window.  The highlighted batch is always
2189 synchronized to the information displayed.
2191 Click and drag batches to change the order in which they're rendered. 
2192 Hit @b{delete} to permanently remove the highlighted batch.
2194 In the list box is a column which enables or disables the batch.  This
2195 way batches can be skipped without being deleted.  Click on the
2196 @b{Enabled} column in the list box to enable or disable a batch.  If it
2197 is checked, the batch is rendered.  If it is blank, the batch is
2198 skipped.
2200 The other columns in the batch list are informative.
2202 @itemize
2204 @item
2205 @b{Output} The output path of the batch.
2206 @item
2207 @b{EDL} The source EDL of the batch.
2208 @item
2209 @b{Elapsed} The amount of time taken to render the batch if it is finished.
2211 @end itemize
2213 To start rendering from the first enabled batch, hit @b{Start}.
2215 Once rendering, the main window shows the progress of the batch.  Once
2216 the batch finishes, the elapsed column in the batch list is updated and
2217 the next batch is rendered until all the enabled batches are finished.
2218 The currently rendering batch is always highlighted red.
2221 To stop rendering before the batches are finished without closing the
2222 batch render dialog, hit @b{Stop}.
2224 To stop rendering before the batches are finished and close the batch
2225 render dialog, hit @b{Cancel}.
2227 To exit the batch render dialog whether or not anything is being
2228 rendered, hit @b{Cancel}.
2236 @node THE RENDER FARM
2237 @subsection THE RENDER FARM
2239 When bicubic interpolation and HDTV was first done on Cinelerra, the
2240 time needed to produce the simplest output became unbearable even on
2241 the fastest dual 1.7Ghz Xeon of the time.  Renderfarm support even in
2242 the simplest form brings HDTV times back in line with SD while making
2243 SD faster than realtime.
2245 While the renderfarm interface isn't spectacular, it's simple enough to
2246 use inside an editing suite with less than a dozen nodes without going
2247 through the same amount of hassle you would with a several hundred node
2248 farm.  Renderfarm is invoked transparently for all file->render
2249 operations when it is enabled in the preferences.
2251 Cinelerra divides the selected region of the timeline into a certain
2252 number of jobs which are then dispatched to the different nodes
2253 depending on the load balance.  The nodes process the jobs and write
2254 their output to individual files on the filesystem.  The output files
2255 are not concatenated.  It's important for all the nodes to have access
2256 to the same filesystem on the same mount point for assets.
2258 If a node can't access an input asset it'll display error messages to
2259 its console but probably not die.  If it can't access an output asset
2260 it'll cause the rendering to abort.
2262 It should be noted that in the render dialog, the @b{Create new file at
2263 each label} option causes a new renderfarm job to be created at each
2264 label instead of by the load balancer.  If this option is selected when
2265 no labels exist, only one job will be created.
2267 A Cinelerra renderfarm is organized into a master node and any number
2268 of slave nodes.  The master node is the computer which is running the
2269 GUI.  The slave nodes are anywhere else on the network and are run from
2270 the command line.  Run a slave node from the command line with 
2272 @b{cinelerra -d}
2274 That is the simplest configuration.  Type @b{cinelerra -h} to see more
2275 options.  The default port number may be overridden by passing a port
2276 number after the -d.
2279 Most of the time you'll want to bring in the rendered output and fine
2280 tune the timing on the timeline.  Also some file formats like MPEG
2281 can't be direct copied.  Because of this, the jobs are left in
2282 individual files.
2284 You can load these by creating a new track and specifying
2285 @b{concatenate to existing tracks} in the load dialog.  Files which
2286 support direct copy can be concatenated into a single file by rendering
2287 to the same file format with renderfarm disabled.  Also to get direct
2288 copy, the track dimensions, output dimensions, and asset dimensions
2289 must be equal.
2291 MPEG files or files which don't support direct copy have to be
2292 concatenated with a command line utility.  MPEG files can be
2293 concatenated with @b{cat}.
2295 Configuration of the renderfarm is described in the configuration
2296 chapter @xref{RENDERFARM}.  The slave nodes traditionally read and
2297 write data to a common filesystem over a network, thus they don't need
2298 hard drives.
2300 Ideally all the nodes on the renderfarm have similar CPU performance. 
2301 Cinelerra load balances on a first come first serve basis.  If the last
2302 segment is dispatched to the slowest node, all the fastest nodes may
2303 end up waiting for the slowest node to finish while they themselves
2304 could have rendered it faster.
2310 @node COMMAND LINE RENDERING
2311 @subsection COMMAND LINE RENDERING
2313 The command line rendering facility consists of a way to load the
2314 current set of batch rendering jobs and process them without a GUI. 
2315 This is useful if you're planning on crashing X repeatedly or want to
2316 do rendering on the other side of a low bandwidth network.  You might
2317 have access to a supercomputer in India but still be stuck in America,
2318 exhiled you might say.  A command line interface is ideal for this.
2320 To perform rendering from the command line, first run Cinelerra in
2321 graphical mode.  Go to @b{file->batch render}.  Create the batches you
2322 intend to render in the batch window and close the window.  This saves
2323 the batches in a file.  Set up the desired renderfarm attributes in
2324 @b{settings->preferences} and exit Cinelerra.  These settings are used
2325 the next time command line rendering is used.
2327 On the command line run 
2329 @b{cinelerra -r}
2331 to processes the current batch jobs without a GUI.  Setting up all the
2332 parameters for this operation is hard.  That's why the command line
2333 aborts if any output files already exist.
2335 Other parameters exist for specifying alternative files for the
2336 preferences and the batches.  Attempting to use anything but the
2337 defaults is very involved so it hasn't been tested.
2343 @node NAVIGATING THE PROJECT
2344 @chapter NAVIGATING THE PROJECT
2346 The thing you want to do most of the time is get to a certain time and
2347 place in the media.  Internally the media is organized into tracks. 
2348 Each track extends across time.  Navigation involves both getting to a
2349 track and getting to a certain time in the track.
2353 @menu
2354 * NAVIGATING THE PROGRAM WINDOW::
2355 * NAVIGATING THE VIEWER AND COMPOSITOR::
2356 * NAVIGATING THE RESOURCES::
2357 * USING THE TRANSPORT CONTROLS::
2358 * USING BACKGROUND RENDERING::
2359 @end menu
2363 @node NAVIGATING THE PROGRAM WINDOW
2364 @section NAVIGATING THE PROGRAM WINDOW
2366 The program window contains many features for navigation and displays
2367 the timeline as it is structured in memory: tracks stacked vertically
2368 and extending across time horizontall.  The horizontal scroll bar
2369 allows you to scan across time.  The vertical scroll bar allows you to
2370 scan across tracks.
2372 Below the timeline you'll find the zoom panel.  The zoom panel contains
2373 values for @b{sample zoom}, @b{amplitude}, @b{track zoom}, and
2374 @b{curve zoom}.  These values in addition to the scrollbars are the
2375 main tools for positioning the timeline.
2384 @sp 1
2386 @image{zoompanel}
2389 Changing the @b{sample zoom} causes the amount of time visible to
2390 change.  @b{If your mouse has a wheel and it works in X11 go over
2391 the tumblers and use the wheel to zoom in and out.}
2393 The @b{amplitude} only affects audio.  It determines how big the
2394 waveform is if the waveform is drawn.
2396 The @b{track zoom} affects all tracks.  It determines the height of
2397 each track.  If you change the track zoom the amplitude zoom
2398 compensates so  audio waveforms look proportional.
2400 The @b{curve zoom} affects the curves in all the tracks.  It
2401 determines the amplitude and offset of the curves.  The tumbler affects
2402 curve amplitude but the only way to change curve offset is to use the
2403 @b{fit curves} button.  @image{fit_curves,,,,}
2406 In addition to the graphical tools, you'll probably more often use the
2407 keyboard to navigate.  Use @b{PAGE UP} and @b{PAGE DOWN} to
2408 scroll up and down the tracks.
2410 Use the @b{LEFT} and @b{RIGHT} arrows to move across time in
2411 small increments.  You'll often need to scroll beyond the end of the
2412 timeline but scrollbars won't let you do it.  Instead use the
2413 @b{RIGHT} arrow to scroll past the end of timeline.
2415 Use the @b{HOME} and @b{END} keys to instantly go to the
2416 beginning or end of the timeline.  In @b{I-beam} mode, hold down
2417 shift while pressing @b{HOME} or @b{END} to select the region of
2418 the timeline between the insertion point and the key pressed.
2420 Use the @b{UP} and @b{DOWN} arrows to change the sample zoom by a
2421 power of 2.
2423 @b{CTRL-UP} and @b{CTRL-DOWN} cause the amplitude zoom to change.
2425 @b{CTRL-PGUP} and @b{CTRL-PGDOWN} cause the track zoom to change.
2427 @b{ALT-UP} and @b{ALT-DOWN} cause the curve amplitude to change.
2431 @menu
2432 * THE INSERTION POINT::
2433 * THE IN/OUT POINTS::
2434 * USING LABELS IN THE PROGRAM WINDOW::
2435 @end menu
2449 @node THE INSERTION POINT
2450 @subsection THE INSERTION POINT
2452 By default you'll see a flashing insertion point in the program window
2453 the first time you boot it up.  This is where new media is pasted onto
2454 the timeline.  It's also the starting point of all playback
2455 operations.  When rendering, it defines the region of the timeline to
2456 be rendered.
2458 The insertion point is normally moved by clicking inside the timebar. 
2459 Any region of the timebar not obscured by labels and in/out points is a
2460 hotspot for repositioning the insertion point.
2462 @sp 1
2463 @image{main_timebar,,,,}
2464 @b{The main timebar}
2466 The insertion point also can be moved by clicking in the timeline
2467 itself, but not always.  The insertion point has two modes of
2468 operation: 
2470 @itemize
2471 @item
2472 drag and drop mode 
2474 @item
2475 cut and paste mode
2477 @end itemize
2479 The mode of operation is determined by selecting the arrow or the
2480 i-beam in the buttonbar.
2482 @sp 1
2483 @image{editing_mode,,,,}
2484 @b{The editing mode buttons}
2486 If the arrow is highlighted it enables @b{drag and drop} mode.  In
2487 drag and drop mode, clicking in the timeline doesn't reposition the
2488 insertion point.  Instead it selects an entire edit.  Dragging in the
2489 timeline repositions the edit, snapping it to other edit boundaries. 
2490 This is normally useful for reordering audio playlists and moving
2491 effects around.
2493 If the i-beam is highlighted it enables @b{cut and paste mode}.  In
2494 cut and paste mode clicking in the timeline repositions the insertion
2495 point.  Dragging in the timeline highlights a region.  The highlighted
2496 region becomes the playback range during the next playback operation,
2497 the rendered range during the next render operation, and the region
2498 affected by cut and paste operations.
2500 @b{Shift-clicking} in the timeline extends the highlighted region.
2502 @b{Double-clicking} in the timeline selects the entire edit the
2503 cursor is over.
2505 It should be noted that when moving the insertion point and selecting
2506 regions, the positions are either aligned to frames or aligned to
2507 samples.  When editing video you'll want to align to frames.  When
2508 editing audio you'll want to align to samples.  This is set in
2509 @b{settings->align cursor on frames}.
2511 If the highlighted region is the region affected by cut and paste
2512 operations, how do I cut and paste in @b{drag and drop} mode?  In
2513 this case you need to set @b{in/out points} to define an affected region.
2519 @node THE IN/OUT POINTS
2520 @subsection THE IN/OUT POINTS
2522 In both editing modes you can set in/out points.  The in/out points
2523 define the affected region.  In drag and drop mode they are the only
2524 way to define an affected region.  In both cut and paste mode and drag
2525 and drop mode the highlighted area overrides the in/out points.  If a
2526 highlighted area and in/out points are set, the highlighted area is
2527 affected by editing operations and the in/out points are ignored.  If
2528 no region is highlighted, the in/out points are used.
2530 Normally, in/out points do not affect the playback region.  Only if you
2531 hold down CTRL while issuing a playback command do the in/out points
2532 determine the playback region.
2534 To set in/out points go to the timebar and position the insertion point
2535 somewhere.  Hit the @image{in_point_button} @b{in point button}.  Go
2536 to a position after the in point and hit the @image{out_point_button}
2537 @b{out point button}.
2539 @sp 1
2540 @image{inout_points} @b{Timebar with in/out points set}.
2542 Select either the in point or the out point and the insertion point
2543 jumps to that location.  After selecting an in point, if you hit the
2544 @b{in point button} the in point will be deleted.  After selecting
2545 an out point, if you hit the @b{out point button} the out point will
2546 be deleted.
2548 If you select a region somewhere else while in/out points already
2549 exist, the existing points will be repositioned when you hit the in/out
2550 buttons.
2552 @b{Shift-clicking} on an in/out point extends the highlighted region
2553 to that point.
2555 Instead of using the button bar you can use the @b{[} and @b{]}
2556 keys to toggle in/out points.
2558 The insertion point and the in/out points allow you to define an
2559 affected region but they don't let you jump to exact points on the
2560 timeline very easily.  For this purpose there are labels.
2566 @node USING LABELS IN THE PROGRAM WINDOW
2567 @subsection USING LABELS IN THE PROGRAM WINDOW
2569 Labels are an easy way to set exact locations on the timeline you want
2570 to jump to.  When you position the insertion point somewhere and hit
2571 the @image{label_button} @b{label button} a new label appears on the
2572 timeline.  
2574 @sp 1
2575 @image{timebar_label} @b{Timebar with a label on it}
2577 No matter what the zoom settings are, clicking on the label positions
2578 the insertion point exactly where you set it.  Hitting the label button
2579 again when a label is selected deletes it.
2581 @b{Shift-clicking} on a label extends the highlighted region.
2583 @b{Double-clicking} between two labels highlights the region between
2584 the labels.
2586 Hitting the @b{l} key has the same effect as the label button.
2588 If you hit the label button when a region is highlighted, two labels
2589 are toggled at each end of the highlighted region.  If one end already
2590 has a label, then the existing label is deleted and a label is created
2591 at the opposite end.
2593 Labels can reposition the insertion point when they are selected but
2594 they can also be traversed with the @image{label_traversal} @b{label
2595 traversal} buttons.  When a label is out of view, the label traversal
2596 buttons reposition the timeline so the label is visible.  There are
2597 keyboard shortcuts for label traversal, too.
2599 @b{CTRL-LEFT} repositions the insertion point on the previous label.
2601 @b{CTRL-RIGHT} repositions the insertion point on the next label.
2603 With label traversal you can quickly seek back and forth on the
2604 timeline but you can also select regions.
2606 @b{SHIFT-CTRL-LEFT} extends the highlighted region to the previous
2607 label.
2609 @b{SHIFT-CTRL-RIGHT} extends the highlighted region to the next label.
2611 Manually hitting the label button or @b{l} key over and over again
2612 to delete a series of labels can get tedious.  For deleting a set of
2613 labels, first highlight a region and second use the @b{Edit->Clear
2614 labels} function.  If in/out points exist, the labels between the
2615 in/out points are cleared and the highlighted region ignored.
2624 @node NAVIGATING THE VIEWER AND COMPOSITOR
2625 @section NAVIGATING THE VIEWER AND COMPOSITOR
2627 The navigation features of the Viewer and Compositor behave very
2628 similarly.  Each has a timebar and slider below the video output.  The
2629 timebar and slider are critical for navigation.
2631 @sp 1
2633 @image{timebarslider,,,,}
2635 The timebar represents the entire time covered by the program.  When
2636 you define labels and in/out points it defines those, too.  Finally the
2637 timebar defines a region known as the @b{preview region}.
2639 The @b{preview region} is the region of the timeline which the
2640 slider effects.  The slider only covers the time covered by the preview
2641 region.  By using a preview region inside the entire program and using
2642 the slider inside the preview region you can quickly and precisely seek
2643 in the compositor and viewer.
2645 When you replace the current project with a file the preview region
2646 automatically resizes to cover the entire file.  When you append data
2647 or change the size of the current project, the preview region stays the
2648 same size and shrinks.  Therefore, you need to resize the preview
2649 region.
2651 Load a file and then slide around it using the compositor slider.  The
2652 insertion point in the main window follows the compositor.  Move the
2653 pointer over the compositor's timebar until it turns into a left resize
2654 pointer.  The click and drag right.  The preview region should have
2655 changed and the slider resized proportionally.
2657 Go to the right of the timebar until a right resize pointer appears. 
2658 Drag left so the preview region shrinks.
2660 Go to the center of the preview region in the timebar and drag it
2661 around to convince yourself if can be moved.
2664 @sp 1
2666 @image{previewregion,,,,}
2668 @b{Preview region in compositor}
2670 If you go to the slider and slide it around with the preview region
2671 shrunk, you'll see the slider only affects the preview region.  The
2672 timebar and slider in the viewer window work exactly the same.
2674 Labels and in/out points are fully supported in the viewer and
2675 compositor.  The only difference between the viewer and compositor is
2676 the compositor reflects the state of the program while the viewer
2677 reflects the state of a clip but not the program.
2679 When you hit the @b{label button} in the compositor, the label
2680 appears both in the compositor timebar and the program timebar.
2682 When you select a label or in/out point in the compositor, the program
2683 window jumps to that position.
2685 @sp 1
2686 @image{viewer_labels} @b{Labels and in/out points in the viewer}.
2688 In the viewer and compositor, labels and in/out points are displayed in
2689 the timebar.  Instead of displaying just a region of the program, the
2690 timebar displays the entire program here.
2694 Like the Program window, the Compositor has a zoom capability.  First,
2695 the pulldown menu on the bottom of the compositor window has a number
2696 of zoom options.  When set to @b{Auto} the video is zoomed to match
2697 the compositor window size as closely as possible.  When set to any
2698 other percentage, the video is zoomed a power of 2 and scrollbars can
2699 be used to scroll around the output.  When the video is zoomed bigger
2700 than the window size, not only do scrollbars scan around it but
2701 @b{middle mouse button} dragging in the video output scans around
2702 it.  This is exactly when The Gimp does.
2704 Furthermore, the zoom @image{magnify} toggle causes the Compositor
2705 window to enter zoom mode.  In zoom mode, clicking in the video output
2706 zooms in while @b{ctrl-clicking} in the video output zooms out.  If
2707 you have a wheel mouse, rotating the wheel zooms in or out too.
2709 Zooming in or out with the zoom tool does not change the rendered
2710 output, mind you.  It's merely for scrutinizing video or fitting it in
2711 the desktop.
2718 @node NAVIGATING THE RESOURCES
2719 @section NAVIGATING THE RESOURCES
2721 The resource window is divided into two areas.  One area lists folders
2722 and another area lists folder contents.  Going into the folder list and
2723 clicking on a folder updates the contents area with the contents of
2724 that folder.
2726 The folder and contents can be displayed as icons or text.
2728 @b{Right clicking} in the folder or contents area brings up a menu
2729 containing formatting options.  Select @b{Display text} to display a
2730 text listing.  Select @b{Sort items} to sort the contents of the
2731 folder alphabetically.
2740 @node USING THE TRANSPORT CONTROLS
2741 @section USING THE TRANSPORT CONTROLS
2743 Transport controls are just as useful in navigation as they are in
2744 playing back footage, hence they are described here in the navigation
2745 section.  Each of the Viewer, Compositor, and Program windows has a
2746 transport panel.
2748 @sp 1
2749 @image{transport_panel} @b{The transport panel}.
2751 The transport panel is controlled by the keyboard as well as the
2752 graphical interface.  For each of the operations it performs, the
2753 starting position is the position of the insertion point in the Program
2754 window and the slider in the Compositor window.  The ending position is
2755 either the end or start of the timeline or the end or start of the
2756 selected region if there is one.
2758 The orientation of the end or start depends on the direction of
2759 playback.  If it's forward the end position is the end of the selected
2760 region.  If it's backward the end position is the start of the selected
2761 region.
2763 The insertion point moves to track playback.  When playback stops, the
2764 insertion point stays where playback stopped.  Thus, by playing back
2765 you change the position of the insertion point.
2767 The keyboard interface is usually the fastest and has more speeds.  The
2768 transport keys are arranged in a sideways @b{T} on the number pad.
2770 @itemize
2772 @item
2773 @b{+} Fast reverse
2774 @item
2775 @b{6} Normal reverse
2776 @item
2777 @b{5} Slow reverse
2778 @item
2779 @b{4} Frame reverse
2780 @item
2781 @b{1} Frame forward
2782 @item
2783 @b{2} Slow forward
2784 @item
2785 @b{3} Normal forward
2786 @item
2787 @b{Enter} Fast forward
2788 @item
2789 @b{0} Stop
2790 @item
2791 @b{Spacebar} Normal forward
2792 @end itemize
2794 Hitting any key on the keyboard twice pauses it.
2796 When using frame advance functions the behavior may seem odd.  If you
2797 frame advance forward and then frame advance backward, the displayed
2798 frame doesn't change.  This is because the playback position isn't the
2799 frame but the time between two frames.  The rendered frame is the area
2800 that the playback position crosses.  When you increment the time
2801 between two frames by one and decrement it by one, you cross the same
2802 frame both times and so the same frame is displayed.
2804 The transport behavior changes if you hold down CTRL when issuing any
2805 of the transport commands.  This causes the starting point to be the in
2806 point if playing forward and the out point if playing backward.  If
2807 playing forward, the out point becomes the ending point and if playing
2808 backward, the in point becomes the ending point.  If no in/out points
2809 are specified, the behavior falls back to using the insertion point and
2810 track boundaries as the starting and ending points.
2814 @node USING BACKGROUND RENDERING
2815 @section USING BACKGROUND RENDERING
2819 Background rendering allows impossibly slow effects to play back in
2820 realtime shortly after the effect is pasted in the timeline.  It
2821 continuously renders temporary output.  When renderfarm is enabled,
2822 background rendering uses the renderfarm continuously.  This way, any
2823 size video can be seen in realtime merely by creating a fast enough
2824 network with enough nodes.
2826 Background rendering is enabled in settings->preferences->performance. 
2827 It has one interactive function: @b{settings->set background render}.  This
2828 sets the point where background rendering begins to where the in point
2829 is.  If any video exists, a red bar appears in the time bar showing
2830 what has been background rendered.
2832 It's often useful to insert an effect or a transition and then select
2833 settings->set background render right before the effect to preview it
2834 in full framerates.
2838 @node EDITING
2839 @chapter EDITING
2842 Editing comprises both the time domain and the track domain.  Since the
2843 timeline consists of a stack of tracks, you need to worry about how to
2844 sort and create tracks in addition to what time certain media appears
2845 on a track.
2847 In the time domain, Cinelerra offers many ways to approach the editing
2848 process.  The three main methods are two screen editing, drag and drop
2849 editing, and cut and paste editing.
2851 There are several concepts Cinelerra uses when editing which apply to
2852 all the methods.  The @b{timeline} is where all editing decisions are
2853 represented.  This is a stack of tracks in the center of the main
2854 window.  It can be scrolled up, down, left and right with the
2855 scrollbars on the right and bottom of it.  It can also be scrolled up
2856 and down with a mouse wheel.
2858 The @b{active region} is the range of time which is affected by editing
2859 commands on the timeline.  The active region is determined first by the
2860 presence of in/out points in the timeline.  If those don't exist the
2861 highlighted region is used.  If no highlighted region exists the
2862 insertion point is used as the start of the active region.  Some
2863 commands treat all the space to the right of the insertion point as
2864 active, like @b{Render}, while others treat the active length as 0 if no
2865 end point for the active region is defined.
2867 Finally, editing decisions never affect source material.  This is
2868 @b{non destructive editing} and it became popular with audio because it
2869 was much faster than if you had to copy all the media affected by an
2870 edit.  Editing only affects pointers to source material, so if you want
2871 to have a media file at the end of your editing session which
2872 represents the editing decisions, you need to @b{render} it.
2873 @xref{RENDERING FILES}.
2875 Every track on the timeline has a set of attributes on
2876 the left, the most important of which is the @b{arm track}
2877 attribute.
2881 @menu
2882 * THE PATCHBAY::           Enabling different features on different tracks
2883 * NUDGING TRACKS::         Moving entire tracks horizontally
2884 * MANIPULATING TRACKS::    Moving whole tracks around
2885 * TWO SCREEN EDITING::     Using two video windows to edit
2886 * DRAG AND DROP EDITING::  Dragging objects to edit
2887 * CUT AND PASTE EDITING::  Editing media like text
2888 * TRIMMING::               Changing in and out points
2889 @end menu
2892 @node THE PATCHBAY
2893 @section THE PATCHBAY
2896 On the left of the timeline is a region affectionately known as the
2897 patchbay.  The patchbay enables features specific to each track.  All
2898 tracks have a text area for naming the track.
2900 All tracks have an @b{expander} @image{expandpatch_checked} for viewing
2901 more options and for viewing the effects on the track.  Click on the
2902 expander to expand or collapse the track.  If it's pointing sideways,
2903 the track is collapsed.  If it's pointing down, the track is expanded. 
2904 The effects appear below the media for the track if they exist.
2906 All tracks have the following row of toggles for several features.
2908 @sp 1
2909 @image{track_attributes}
2910 @b{Track attributes}
2913 If the toggle is colored, it is enabled.  If the toggle is the
2914 background color of most of the windows, it is disabled.  Click on the
2915 toggle to enable or disable the feature.  Several mouse operations
2916 speed up the configuration of several tracks at a time.
2918 Click on an attribute and drag across adjacent tracks to copy the same
2919 attribute to those tracks.
2921 Hold down @b{shift} while clicking a track's attribute to enable the
2922 attribute in the current track and toggle the attribute in all the
2923 other tracks.
2925 Hold down @b{shift} while clicking an attribute.  Click until all the
2926 tracks except the selected one are disabled.  Then drag the cursor over
2927 the adjacent track to enable the attribute in the adjacent track.
2930 The other attributes affect the output of the track.
2932 @itemize
2934 @item
2936 @b{Play track} determines whether the track is rendered or not.  If
2937 it's off, the track is not rendered.  However, if the track is chained
2938 to any other tracks, the other tracks perform all the effects in the
2939 chained track, regardless of play status.
2940 @sp 1
2942 @item
2944 @b{Arm track} determines whether the track is armed or not.   Only the
2945 @b{armed tracks} are affected by editing operations.  Make sure you
2946 have enough armed destination tracks when you paste or splice material
2947 or some tracks in the material will get left out.
2949 In addition to restricting editing operations, the armed tracks in
2950 combination with the active region determine where material is inserted
2951 when loading files.  If the files are loaded with one of the insertion
2952 strategies which doesn't delete the existing project, the armed tracks
2953 will be used as destination tracks.
2955 Press @b{Tab} while the cursor is anywhere over a track to toggle the
2956 track arming status.
2958 Press @b{Shift-Tab} while the cursor is over a track to toggle the
2959 arming status of every other track.
2961 @item
2963 @b{Gang fader} causes the fader to track the movement of whatever other
2964 fader you're adjusting.  A fader is only ganged if the @b{arm track} is
2965 also on.  This is normally used to adjust audio levels on all the
2966 tracks simultaneously.  Gang also causes @b{Nudge} parameters to
2967 synchronise across all the ganged tracks.
2970 @sp 1
2972 @item
2974 @b{Draw media} determines if picons or waveforms are drawn on the
2975 track.  By default, some file formats load with this off while other
2976 file formats load with it on.  This depends on whether the file format
2977 takes a long time to draw on the timeline.  Merely set it to on if you
2978 want to see picons for any file format.
2979 @sp 1
2981 @item
2983 @b{Mute track} causes the output to be thrown away once the track is
2984 completely rendered.  This happens whether or not @b{play track} is
2985 on.  If the track is part of an effect chain, the output of the effect
2986 chain track is overlayed on the final output even though it's routed
2987 back to another track.  Mute track is used to keep the effect chain
2988 track from overlapping the output of the source track.
2989 @sp 1
2991 @item
2993 @b{Fader} All tracks have a fader, but the units of each fader depend
2994 on whether it's audio or video.  Click and drag the fader to fade the
2995 track in and out.  If it is ganged to other tracks of the same media
2996 type, with the @b{arm} option enabled, the other faders should follow.
2998 Hold down @b{shift} and drag a fader to center it on 0.
3000 @end itemize
3004 @node NUDGING TRACKS
3005 @section NUDGING TRACKS
3007 Each track has a nudge textbox in the patchbay under the fader and on
3008 the right.  You may have to expand the track to see it.  The nudge is
3009 the amount the track is shifted left or right during playback.  The
3010 track is not displayed shifted on the timeline, but it is shifted when
3011 it's played back.  This is useful for synchronizing audio with video,
3012 creating fake stereo, or compensating for an effect which shifts time,
3013 all without tampering with any edits.
3015 Merely enter in the amount of time to shift by to instantly shift the
3016 track.  Negative numbers make the track play later.  Positive numbers
3017 make the track play sooner.  The nudge units are either @b{seconds} or
3018 the native units for the track.  Select the units by @b{right clicking}
3019 on the nudge textbox and using the context sensitive menu.
3021 Nudge settings are ganged with the @b{Gang faders} toggle and the
3022 @b{Arm track} toggle.
3024 Use the mouse wheel over the nudge textbox to increment and decriment
3030 @node MANIPULATING TRACKS
3031 @section MANIPULATING TRACKS
3033 Tracks in Cinelerra either contain audio or video.  There is no special
3034 designation for tracks other than the type of media they contain.  When
3035 you create a new project, it contains a certain mumber of default
3036 tracks.  You can still add or delete tracks from a number of menus. 
3037 The @b{Tracks} menu contains a number of options for dealing with
3038 multiple tracks simultaneously.  Each track itself has a popup menu
3039 which affects one track.
3041 Bring up the popup menu by moving over a track and right clicking.  The
3042 popup menu affects the track whether it's armed or not.
3044 @b{Move up} and @b{move down} moves the one track up or down in
3045 the stack.  @b{Delete track} deletes the track.
3047 Operations in the @b{Tracks} menu affect only tracks which are
3048 armed.
3050 @b{Move tracks up} and @b{Move tracks down} shift all the armed
3051 tracks up or down the stack.
3053 @b{Delete tracks} deletes the armed tracks.
3055 @b{Delete last track} deletes the last track, whether it's armed or
3056 not.  Holding down the @b{d} key quickly deletes all the tracks.
3058 @b{Concatenate tracks} is more complicated.  It takes every
3059 @b{playable} track and concatenates it to the end of the first
3060 @b{armed tracks}.  If there are two armed tracks followed by two
3061 playable tracks, the concatenate operation puts the two playable tracks
3062 after the two armed tracks.  If there are three playable tracks
3063 instead, two tracks are put after the armed tracks and a third track is
3064 put on the end of the first armed track.  The destination track wraps
3065 around until all the playable tracks are concatenated.
3067 Finally, you'll want to create new tracks.  The @b{Audio} and
3068 @b{Video} menus each contain an option to add a track of their
3069 specific type.  In the case of audio, the new track is put on the
3070 bottom of the timeline and the output channel of the audio track is
3071 incremented by one.  In the case of video, the new track is put on the
3072 top of the timeline.  This way, video has a natural compositing order. 
3073 New video tracks are overlayed on top of old tracks.
3083 @node TWO SCREEN EDITING
3084 @section TWO SCREEN EDITING
3086 This is the fastest way to construct a program out of movie files.  The
3087 idea consists of viewing a movie file in one window and viewing the
3088 program in another window.  Sections of the movie file are defined in
3089 one window and transferred to the end of the program in the other
3090 window.
3092 The way to begin a two screen editing session is to load some
3093 resources.  In @b{file->load} load some movies with the insertion
3094 mode @b{create new resources}.  You want the timeline to stay
3095 unchanged while new resources are brought in.  Go to the Resource
3096 Window and select the @b{media} folder.  The newly loaded resources
3097 should appear.  Drag a resource from the media side of the window over
3098 the Viewer window.
3100 There should be enough armed tracks on the timeline to put the sections
3101 of source material that you want.  If there aren't, create new tracks
3102 or arm more tracks.
3104 In the viewer window seek to the starting point of a clip you want to
3105 use.  Use either the @b{slider} or the @b{transport controls}. 
3106 Use the @b{preview region} to narrow down the search.  Set the
3107 starting point with the @image{in_point_button} @b{in point button}.
3109 Seek to the ending point of the clip you want to use.  Set the ending
3110 point with the @image{out_point_button} @b{out point button}.  The
3111 two points should now appear on the timebar and define a clip.
3113 There are several things you can do with the clip now.
3115 @itemize
3117 @item
3119 Splice @image{splice_button} inserts the clip in the timeline, pushing
3120 everything back.  If an @b{in point} or @b{out point} exists on
3121 the timeline it's inserted there, otherwise it's inserted after the
3122 insertion point.  After that, the insertion point moves to the end of
3123 the clip.  If there is no in/out point, the insertion point will be
3124 used as the next splice location.  This way you can continuously build
3125 up the program by splicing.
3127 @item
3129 Overwrite @image{overwrite_button} overwrites the region of the
3130 timeline with the clip.  If an @b{in point} or @b{out point}
3131 exists on the timeline it's overwritten there, otherwise it's
3132 overwritten after the insertion point.  If a region is highlighted or
3133 both in and out points exist the difference between the active region
3134 and the clip length is deleted.
3138 @item
3140 Create a clip @image{toclip_button} generates a new clip for the
3141 resource window containing the affected region but doesn't change the
3142 timeline.  Every clip has a title and a description.  These are
3143 optional.
3145 @item
3147 Copy behaves the same as in cut and paste editing.
3149 @end itemize
3151 Two screen editing can be done purely by keybard shortcuts.  When you
3152 move the pointer over any button a tooltip should appear, showing what
3153 key is bound to that button.  In the Viewer window, the number pad keys
3154 control the transport and the @b{[ ] v} keys perform in/out points
3155 and splicing.
3167 @node DRAG AND DROP EDITING
3168 @section DRAG AND DROP EDITING
3170 The answer is yes, you can you create a bunch of clips and drag them on
3171 the timeline.  You can also drag edits around the timeline.
3173 Load some files using @b{file->load}.  Set the insertion mode to
3174 @b{Create new resources}.  This loads the files into the Resource
3175 Window.  Create some audio and video tracks on the timeline using the
3176 video and audio menus.
3178 Open the @b{Media} folder in the resource window.  Drag a media file
3179 from the resource window to the timeline.  If the media has video, drag
3180 it onto a video track.  If the media is pure audio, drag it onto an
3181 audio track.
3183 Cinelerra fills out the audio and video tracks below the dragging
3184 cursor with data from the file.  This affects what tracks you should
3185 create initially and which track to drag the media onto.  If the media
3186 has one video track and two audio tracks, you'll need one video track
3187 and two audio tracks on the timeline and the media should be dragged
3188 over the first video track.  If the media has audio only you'll need
3189 one audio track on the timeline for every audio track in the media and
3190 the media should be dragged over the first audio track.
3192 When dragging, the media snaps to the start of track if the track is
3193 empty.  If there are edits on the track, the media snaps to the nearest
3194 edit boundary.
3196 You can also drag multiple files from the resource window.  Either draw
3197 a box around the files, use SHIFT, or use CTRL when selecting files. 
3198 When you drop the files in the timeline, they are concatenated.  The
3199 behavior of SHIFT and CTRL changes depending on if the resources are in
3200 text or icons.
3202 To display the resources as text or icons, right click inside the media
3203 list.  Select either @b{display icons} or @b{display text} to
3204 change the list format.
3206 When displaying text in the resource window @b{SHIFT-clicking} on
3207 media files extends the number of highlighted selections. 
3208 @b{CTRL-clicking} on media files in text mode selects additional
3209 files one at a time.
3211 When displaying icons in the resource window @b{SHIFT-clicking} or
3212 @b{CTRL-clicking} selects media files one at a time.
3214 In addition to dragging media files, if you create clips and open the
3215 @b{clip} folder you can drag clips on the timeline.
3217 In the timeline there is further dragging functionality.  To enable the
3218 dragging functionality of the timeline, select the arrow toggle
3219 @image{arrow}.  Move over an edit and drag it.  If more than one
3220 track is armed, Cinelerra will drag any edits which start on the same
3221 position as the edit the cursur is currently over.  During a dragging
3222 operation the edit snaps to the nearest boundary.
3224 Dragging edits around the timeline allows you to sort music playlists,
3225 sort movie scenes, and give better NAB demos but not much else.
3237 @node CUT AND PASTE EDITING
3238 @section CUT AND PASTE EDITING
3240 This is the traditional method of editing in audio editors.  In the
3241 case of Cinelerra, you either need to start a second copy of Cinelerra
3242 and copy from one copy to the other, copy from different tracks in the
3243 same copy, or load a media file into the Viewer and copy from there.
3245 Load some files onto the timeline.  To perform cut and paste editing
3246 select the @image{ibeam} i-beam toggle.  Select a region of the
3247 timeline and select the @image{cut} cut button to cut it.  Move the
3248 insertion point to another point in the timeline and select the
3249 @image{paste} paste button.  Assuming no in/out points are defined on
3250 the timeline this performs a cut and paste operation.
3252 If in/out points are defined, the insertion point and highlighted
3253 region are overridden by the in/out points for clipboard operations. 
3254 Thus, with in/out points you can perform cut and paste in drag and drop
3255 mode as well as cut and paste mode.
3257 When editing audio, it is customary to cut from one part of a waveform
3258 into the same part of another waveform.  The start and stop points of
3259 the cut are identical in each waveform and might be offset slightly,
3260 while the wave data is different.  It would be very hard to highlight
3261 one waveform to cut it and highlight the second waveform to paste it
3262 without changing the relative start and stop positions.
3264 One option for simplifying this is to open a second copy of Cinelerra,
3265 cutting and pasting to transport media between the two copies.  This
3266 way two highlighed regions can exist simultanously.
3268 Another option is to set in/out points for the source region of the
3269 source waveform and set labels for the destination region of the
3270 destination waveform.  Perform a cut, clear the in/out points, select
3271 the region between the labels, and perform a paste.
3275 A final operation in cut and paste editing is the @b{edit->clear}
3276 operation.  If a region is highlighted or in/out points exist, the
3277 affected region is cleared by @b{edit->clear}.  But if the insertion
3278 point is over an edit boundary and the edits on each side of the edit
3279 boundary are the same resource, the edits are combined into one edit
3280 comprised by the resource.  The start of this one edit is the start of
3281 the first edit and the end of this one edit is the end of the second
3282 edit.  This either results in the edit expanding or shrinking.
3288 @node TRIMMING
3289 @section TRIMMING
3291 With some edits on the timeline it's possible to do trimming.  By
3292 trimming you shrink or grow the edit boundaries by dragging them.  In
3293 either drag and drop mode or cut and paste mode, move the cursor over
3294 an edit boundary until it changes shape.  The cursor will either be an
3295 expand left or an expand right.  If the cursor is an expand left, the
3296 dragging operation affects the beginning of the edit.  If the cursor is
3297 an expand right, the dragging operation affects the end of the edit.
3299 When you click on an edit boundary to start dragging, the mouse button
3300 number determines which dragging behavior is going to be followed.  3
3301 possible behaviors are bound to mouse buttons in the interface
3302 preferences. @xref{INTERFACE}.
3304 The effect of each drag operation not only depends on the behavior
3305 button but whether the beginning or end of the edit is being dragged.
3306 When you release the mouse button, the trimming operation is performed.
3308 In a @b{Drag all following edits} operation, the beginning of the
3309 edit either cuts data from the edit if you move it forward or pastes
3310 new data from before the edit if you move it backward.  The end of the
3311 edit pastes data into the edit if you move it forward or cuts data from
3312 the end of the edit if you move it backward.  All the edits thereafter
3313 shift.  Finally, if you drag the end of the edit past the start of the
3314 edit, the edit is deleted.
3316 In a @b{Drag only one edit} operation, the behavior is the same when
3317 you drag the beginning or end of an edit.  The only difference is none
3318 of the other edits in the track shift.  Instead, anything adjacent to
3319 the current edit expands or shrinks to fill gaps left by the drag
3320 operation.
3322 In a @b{Drag source only} operation, nothing is cut or pasted.  If
3323 you move the beginning or end of the edit forward, the source reference
3324 in the edit shifts forward.  If you move the beginning or end of the
3325 edit backward, the source reference shifts backward.  Where the edit
3326 appears in the timeline remains the same but the source shifts.
3328 For all file formats besides still images, the extent of the trimming
3329 operation is clamped to the source file length.  Attempting to drag the
3330 start of the edit beyond the start of the source clamps it to the
3331 source start.
3333 In all trimming operations, all edits which start on the same position
3334 as the cursor when the drag operation begins are affected.  Unarm
3335 tracks to prevent edits from getting affected.
3344 @node USING EFFECTS
3345 @chapter USING EFFECTS
3347 It would be sufficient to perform all changes to the timeline using
3348 editing operations, but this isn't very extensible.  Certain timeline
3349 changes should produce a different effect in the output without
3350 involving a unique procedure to apply each change.  This is why we have
3351 effects.
3353 Effects fall into three categories, and each effect in a category is
3354 applied using the same procedure.
3357 @menu
3358 * REALTIME EFFECTS::
3359 * RENDERED EFFECTS::
3360 * TRANSITIONS::
3361 * LADSPA EFFECTS::
3362 @end menu
3366 @node REALTIME EFFECTS
3367 @section REALTIME EFFECTS
3369 These are layered under the track they apply to.  They process the
3370 track when the track is played back, with no permanent storage of the
3371 output except when the project is rendered.
3373 All the realtime effects are listed in the resource window, divided
3374 into two groups: audio effects and video effects.  Audio effects should
3375 be dragged from the resource window onto audio tracks.  Video effects
3376 should be dragged onto video tracks.
3378 If there is data on the destination track, the effect is applied to the
3379 entire track.  If there is no data on the track the effect is deleted. 
3380 Finally, if a region of the track is selected the effect is pasted into
3381 the region, regardless of whether there is data.
3383 Some of the effects don't process data but synthesize data.  In the
3384 case of a synthesis effect, you'll want to select a region of the
3385 track so the dragging operation pastes it without deleting it.
3387 When dragging more than one effect onto a track, you'll see the effects
3388 layering from top to bottom, on the bottom of the track.   When the
3389 track is played back, effects are processed from top to bottom.  The
3390 output of the top effect becomes the input of the bottom effect and so
3391 on and so forth.
3393 In addition to dragging from the resource window, effects may be
3394 applied to a track by a popup menu.  Right click on a track and select
3395 @b{Attach effect} from the popup.  The attach effect dialog gives
3396 you more control than pure dragging and dropping.  For one thing, the
3397 attach effect dialog lets you attach two more types of effects: shared
3398 effects and shared tracks.  Select a plugin from the @b{Plugins}
3399 column and hit @b{Attach} under the plugins column to attach it. 
3400 The effect is the same as if the effect was dragged from the resource
3401 window.
3403 When an effect exists under a track, it most often needs to be
3404 configured.  Go to the effect and right click on it to bring up the
3405 effect popup.  In the effect popup is a @b{show} option.  The show
3406 option causes the GUI for the effect to appear under the cursor.  Most
3407 effects have GUI's but some don't.  If the effect doesn't have a GUI,
3408 nothing pops up when the @b{show} option is selected.  When you
3409 tweek parameters in the effect GUI, the parameters normally effect the
3410 entire duration of the effect.
3413 @menu
3414 * REALTIME EFFECT TYPES::
3415 * EDITING REALTIME EFFECTS::
3416 @end menu
3420 @node REALTIME EFFECT TYPES
3421 @subsection REALTIME EFFECT TYPES
3423 The two other effect types supported by the Attach Effect dialog are
3424 recycled effects.  In order to use a recycled effect, three requiremenets
3425 must be met:
3427 @itemize
3429 @item
3430 There must be other effects in the timeline.
3432 @item
3434 The other effects must be of the same type as the track you're
3435 attaching an effect to.  If the track is an audio track, the effects
3436 must be audio effects.  If the track is a video track, the effects must
3437 be video effects.
3439 @item
3441 The insertion point or selected region must start inside the other effects.
3443 @end itemize
3445 In the case of a shared effect, these conditions must be true.  In the
3446 case of a shared track, there merely must be another track on the
3447 timeline of the same type as the track you're applying an effect to. 
3448 If you right clicked on a video track to attach an effect, there won't
3449 be anything in the @b{shared tracks} column if no other video track
3450 exists.  If you right clicked on an audio track there won't be anything
3451 in the shared track column if no other audio track exists.
3453 If shared effects or shared tracks are available, they appear in the
3454 @b{shared effects} and @b{shared tracks} columns.  The
3455 @b{attach} button under each column causes anything highlighted in
3456 the column to be attached under the current track.
3458 Shared effects and shared tracks allow very unique things to be done. 
3459 In the case of a shared effect, the shared effect is treated like a
3460 copy of the original effect except in the shared effect the GUI can't
3461 be brought up.  All configuration of the shared effect is determined by
3462 the GUI of the original effect and only the GUI of the original effect
3463 can be brought up.
3465 When a shared effect is played back, it's processed just like a normal
3466 effect except the configuration is copied from the original effect. 
3467 Some effects detect when they are being shared, like the reverb effects
3468 and the compressor.  These effects determine what tracks are sharing
3469 them and either mix the two tracks together or use one track to stage
3470 some value.  The reverb mixes tracks together to simulate ambience. 
3471 The compressor uses one of the sharing tracks as the trigger.
3473 When an original track has a @b{shared track} as one of its effects,
3474 the shared track itself is used as a realtime effect.  This is more
3475 commonly known as @b{bouncing tracks} but Cinelerra achieves the
3476 same operation by attaching shared tracks.  The fade and any effects in
3477 the shared track are applied to the original track.  Once the shared
3478 track has processed the data, the original track performs any effects
3479 which come below the shared track and then composites it on the output.
3481 In addition, once the shared track has processed the output of the
3482 original track like a realtime effect, the shared track mixes itself
3483 into the output with it's settings for pan, mode, and projector.  Thus,
3484 two tracks are mixing the same data on the output.  Most of the time
3485 you don't want the shared track to mix the same data as the original
3486 track on the output.  You want it to stop right before the mixing stage
3487 and give the data back to the original track.  Do this by enabling the
3488 @image{mutepatch_up} mute toggle next to each track for whom you don't
3489 want to mix on the output.
3491 Suppose you were making video and you did want the shared track to
3492 composite the original track's data on the output a second time.  In
3493 the case of video, the video from the shared track would always appear
3494 under the video from the original track, regardless of whether it was
3495 on top of the original track.  This is because shared tracks are
3496 composited in order of their attachment.  Since it's part of the original
3497 track it has to be composited before the original track is composited.
3505 @node EDITING REALTIME EFFECTS
3506 @subsection EDITING REALTIME EFFECTS
3508 Many operations exist for manipulating effects once they are in the
3509 timeline.  Because mixing effects and media is such complex business,
3510 the methods used in editing effects aren't as concise as cutting and
3511 pasting.  Some of the editing happens by dragging in/out points, some
3512 of the editing happens through popup menus, and some of it happens by
3513 dragging effects.
3515 Normally when you edit tracks, the effects follow the editing
3516 decisions.  If you cut from a track, the effect shrinks.  If you drag
3517 edit in/out points, the effect changes length.  This behavior can be
3518 disabled by selecting @b{Settings->edit effects} in the project
3519 window.  This decouples effects from editing operations, but what if
3520 you just want to edit the effects?
3522 Move the timeline cursor over the effect borders until it changes to a
3523 resize left or resize right icon.  In this state, if you drag the end
3524 of the effect, it performs an edit just like dragging the end of a
3525 track does.  
3527 The three editing behaviors of track trimming apply to effect trimming
3528 and they are bound to the mouse buttons that you set in @b{interface
3529 preferences}. @xref{INTERFACE}.  When you perform a trim edit on an
3530 effect, the effect boundary is moved by dragging on it.  Unlike track
3531 editing, the effect has no source length.  You can extend the end of an
3532 effect as much as desired without being limited.
3534 Also unlike track editing, the starting position of the drag operation
3535 doesn't bind the edit decision to media.  The media the effect is bound
3536 to doesn't follow effect edits.  Other effects; however, do follow
3537 editing decisions made on an effect.  If you drag the end of an effect
3538 which is lined up to effects on other tracks, the effects on the other
3539 tracks will be edited while the media stays the same.
3541 What happens if you trim the end of an effect in, leaving a lot of
3542 unaffected time near the end of the track?  When you drag an effect in
3543 from the Resource Window you can insert the effect in the portion of
3544 the row unoccupied by the trimming operation.  Realtime effects are
3545 organized into rows under the track.  Each row can have multiple
3546 effects.
3548 In some cases you'll want a trimming operation to change only one row
3549 of effects.  This can be achieved by first positioning the insertion
3550 point on the start or end of the effect.  Then press @b{shift} while
3551 beginning the trimming operation.  This causes the operation to change
3552 only one row of effects.
3554 In addition to trimming, you can move effects up or down.  Every track
3555 can have a stack of effects under it.  By moving an effect up or down
3556 you change the order in which effects are processed in the stack.  Go
3557 to an effect and right click to bring up the effect menu.  The
3558 @b{Move up} and @b{Move down} options move the effect up or down.
3560 When you're moving effects up or down, be aware that if they're shared
3561 as @b{shared effects}, any references will be pointing to a
3562 different effect after the move operation.
3564 Finally, there's dragging of effects.  Dragging effects works just like
3565 dragging edits.  You must select the @image{arrow} arrow to enter drag and
3566 drop mode before dragging effects.  The effects snap to media
3567 boundaries, effect boundaries, and tracks.  Be aware if you drag a
3568 reference to a shared effect, the reference will usually point to the
3569 wrong effect afterwards.
3571 Right click on an effect to bring up a menu for the effect.  Select
3572 @b{attach...} to change the effect or change the reference if it is
3573 a shared effect.
3582 @node RENDERED EFFECTS
3583 @section RENDERED EFFECTS
3586 Another type of effect is performed on a section of the track and the
3587 result stored somewhere before it is played back.  The result is
3588 usually pasted into the track to replace the original data.
3590 The rendered effects are not listed in the resource window but instead
3591 are accessed through the @b{Audio->Render effect} and
3592 @b{Video->Render effect} menu options.  Each of these menu options
3593 brings up a dialog for the rendered effect.  Rendered effects apply to
3594 only one type of track, either audio or video.  If no tracks of the
3595 type exist, an error pops up.
3597 A region of the timeline to apply the effect to must be defined before
3598 selecting @b{Render effect...}.  If no in/out points and no
3599 highlighted region exists, the entire region after the insertion point
3600 is treated as the affected region.  Otherwise, the region between the
3601 in/out points or the highlighted region is the affected region.
3603 Secondly, the tracks to apply the rendered affect to need to be
3604 @b{armed}.  All other tracks are ignored.
3606 Finally, the rendered affect processes certain track attributes when it
3607 reads its input data but not others.  Transitions in the affected track
3608 are applied.  Nudge is not and effects are not.  This allows the new
3609 data to be pasted into the existing position without changing the nudge
3610 value.
3612 In the render effect dialog is a list of all the realtime and all the
3613 rendered effects.  The difference here is that the realtime effects are
3614 rendered to disk and not applied under the track.  Highlight an effect
3615 in the list to designate it as the one being performed.
3617 Define a file to render the effect to in the @b{Select a file to
3618 render to} box.  The @image{magnify} magnifying glass allows file
3619 selection from a list.
3621 Select a file format which can handle the track type.  The
3622 @image{wrench} wrench allows configuration specific to the file format.
3624 There is also an option for creating a new file at each label.  If you
3625 have a CD rip on the timeline which you want to divide into different
3626 files, the labels would become dividing points between the files if
3627 this option were selected.  When the timeline is divided by labels, the
3628 effect is re-initialized at every label.  Normalize operations take the
3629 peak in the current file and not in the entire timeline.
3631 Finally there is an insertion strategy just like in the render dialog. 
3632 It should be noted that even though the effect applies only to audio or
3633 video, the insertion strategy applies to all tracks just like a
3634 clipboard operation.
3636 When you click @b{OK} in the effect dialog, it calls the GUI of the
3637 effect.  If the effect is also a realtime effect, a second GUI appears
3638 to prompt for acceptance or rejection of the current settings.  After
3639 accepting the settings, the effect is processed.
3654 @node TRANSITIONS
3655 @section TRANSITIONS
3657 When one edit ends and another edit begins, the default behaviour is to
3658 have the first edit's output immediately become the output of the
3659 second edit when played back.  Transitions are a way for the first
3660 edit's output to become the second edit's output with different
3661 variations.
3663 Cinelerra supports audio and video transitions, all of which are listed
3664 in the resource window.  Transitions may only apply to the matching
3665 track type.  Transitions under @b{audio transitions} can only apply
3666 to audio tracks.  Transitions under @b{video transitions} can only
3667 apply to video tracks.
3669 Load a video file and cut a section from the center so the edit point
3670 is visible on the timeline.  Go the resource window and click on the
3671 @b{Video transitions} folder.  Drag a transition from the transition
3672 list onto the second video edit on the timeline.  A box highlights over
3673 where the transition will appear.  Releasing it over the second edit
3674 applies the transition between the first and second edit.
3676 You can now scrub over the transition with the transport controls and
3677 watch the output in the @b{Compositor window}.  Scrubbing with the
3678 insertion point doesn't normally show transitions because the
3679 transition durations are usually too short.  The exact point in time
3680 when the transition takes effect isn't straightforward.  It starts when
3681 the second edit begins and lasts a certain amount of time into the
3682 second edit.  Therefore, the first asset needs to have enough data
3683 after the edit point to fill the transition into the second edit.
3685 Once the transition is in place, it can be edited similarly to an
3686 effect.  Move the pointer over the transition and right click to bring
3687 up the transition menu.  The @b{show} option brings up specific
3688 parameters for the transition in question if there are any.  The
3689 @b{length} option adjusts the length of the transition in seconds. 
3690 Once these two parameters are set, they are applied to future
3691 transitions until they are changed again.  Finally, the @b{detach}
3692 option removes the transition from the timeline.
3694 Dragging and dropping transitions from the Resource window to the
3695 Program window can be really slow and tiring.  Fortunately, once you
3696 drag a transition from the Resource window, the @b{U} and @b{u}
3697 keys will paste the same transition.  The @b{U} key pastes the last
3698 video transition and the @b{u} key pastes the last audio transition
3699 on all the recordable tracks.  If the insertion point or in point is
3700 over an edit, the beginning of the edit is covered by the transition.  
3702 It should be noted that when playing transitions from the timeline to a
3703 hardware accelerated video device, the hardware acceleration will
3704 usually be turned off momentarily during the transition and on after
3705 the transition in order to render the transition.  Using an
3706 unaccelerated video device for the entire timeline normally removes the
3707 disturbance.
3713 @node LADSPA EFFECTS
3714 @section LADSPA EFFECTS
3717 LADSPA effects are supported in realtime and rendered mode for audio. 
3718 The LADSPA plugins you get from the internet vary in quality.  Most
3719 can't be tweeked in realtime very easily and work better when
3720 rendered.  Some crash and some can only be applied to one track due to
3721 a lack of reentrancy.  Although Cinelerra implements the LADSPA
3722 interface as accurately as possible, multiple tracks of realtime,
3723 simultaneous processing go beyond the majority of LADSPA users.  LADSPA
3724 effects appear in the audio folder as the hammer and screwdriver, to
3725 signify that they are Plugins for Linux Audio Developers.
3727 LADSPA Effects are enabled merely by setting the @b{LADSPA_PATH}
3728 environment variable to the location of your LADSPA plugins or putting
3729 them in the @b{/usr/lib/cinelerra} directory.
3740 @node SETTING PROJECT ATTRIBUTES
3741 @chapter SETTING PROJECT ATTRIBUTES
3743 When you play media files in Cinelerra, the media files have a certain
3744 number of tracks, a certain frame size, a certain sample size, and so
3745 on and so forth.  No matter what the media file has; however, it is
3746 still played back according to the project attributes.  If an audio
3747 file's samplerate is different than the project attributes, it is
3748 resampled.  If a video file's frame size is different than the project
3749 attributes, it is composited on a black frame, either cropped or
3750 bordered with black.
3752 The project attributes are adjusted in @b{settings->format} and in
3753 to a more limited extent in @b{file->new}.  When you adjust project
3754 settings in @b{file->new} a new timeline is created with no data. 
3755 Every timeline created from this point uses the same settings.  When
3756 you adjust settings in @b{settings->format}, the timeline is not
3757 recreated with no data but every timeline created from this point uses
3758 the same settings.
3760 In addition to the traditional settings for sample rate, frame rate,
3761 frame size, Cinelerra uses some unusual settings like @b{channel
3762 positions, color model, and aspect ratio.}
3764 @itemize
3766 @item
3768 Channel positions is the only setting which doesn't affect the output
3769 necessarily.  Click on a speaker icon and drag to change the position
3770 of a channel.  It is merely a convenience so when more than 2 channels
3771 are used, the pan controls on the timeline are effective.  Channels 3,
3772 4, and 5 wouldn't be very adjustible if they occupied the same
3773 locations as channels 1 and 2 on a pan control.  Normally a 6 channel
3774 configuration would look like this:
3776 @sp 2
3777 @image{channelpositions}
3778 @sp 2
3780 But different channels can be positioned very close together to make
3781 them have the same output.
3786 @item
3788 Color model is very important for video playback.  The video is stored
3789 on disk in one colormodel, normally compressed using a YUV derivative. 
3790 When played back, Cinelerra decompresses it from the file format
3791 directly into the format of the output device.  If effects are
3792 processed, the decompression is into an internal colormodel first and
3793 the internal colormodel is then converted to the format of the output
3794 device.  The selection of internal colormodel determines how accurate
3795 and fast the effects are.
3797 Cinelerra colormodels are described using a certain packing order of
3798 components and a certain number of bits for each component.  The
3799 packing order is printed on the left and the bit allocation is printed
3800 on the right.
3802 @b{RGB888} uses red, green, blue with 8 bits per channel.
3804 @b{RGBA8888} uses red, green, blue, and alpha with 8 bits per
3805 channel.
3807 @b{YUV888} uses luminance and color with 8 bits per channel.
3809 @b{YUVA8888} uses luminance, color, and alpha with 8 bits per
3810 channel.
3812 @b{RGB Float} uses red, green, blue with 32 bit floats per channel.
3814 @b{RGBA Float} uses red, green, blue, and alpha with 32 bit floats per
3815 channel.
3818 In order to do effects which involve alpha channels, a colormodel with
3819 an alpha channel must be selected.  These are RGBA8888, YUVA8888, and
3820 RGBA Float.  The 4 channel colormodels are notoriously slower than 3
3821 channel colormodels, with the slowest being RGBA Float.  Some effects,
3822 like fade, work around the need for alpha channels while other effects,
3823 like chromakey, require an alpha channel to do anything, so it's a good
3824 idea to try the effect without alpha channels before settling on an
3825 alpha channel and slowing it down.
3827 The YUV colormodels are usually faster than RGB colormodels when using
3828 compressed footage.  They also destroy fewer colors than RGB
3829 colormodels.  If footage stored as JPEG or MPEG is processed many times
3830 in RGB, the colors will fade while they won't if processed in YUV.
3832 Years of working with high dynamic range footage have shown floating
3833 point RGB to be the best format for high dynamic range.  While 16 bit
3834 integers were used in the past, these were too lossy and slow for the
3835 amount of improvement.
3837 RGB float doesn't destroy information when used with YUV source
3838 footage.  It also supports brightness above 100%.  Be aware that some
3839 effects, like Histogram, clip above 100%.
3841 @item
3843 Aspect ratio determines the shape of the video output when using the
3844 X11 video output.  The numbers in each direction can be any floating
3845 point number.  When drawn on the screen, video pixels are stretched to
3846 match the aspect ratio.
3848 Some file formats, like MPEG video, write the project aspect ratio to
3849 the file.
3854 @end itemize
3861 @node COMPOSITING
3862 @chapter COMPOSITING
3865 A large amount of Cinelerra's binary size is directed towards
3866 compositing.  When you remove the letterboxing from a widescreen show,
3867 you're compositing.  Changing the resolution of a show, making a split
3868 screen, and fading in and out among other things are all compositing
3869 operations in Cinelerra.  Cinelerra detects when it's in a compositing
3870 operation and plays back through the compositing engine only then. 
3871 Otherwise, it uses the fastest decoder available in the hardware.
3873 Compositing operations are done on the timeline and in the Compositor
3874 window.  Shortcuts exist in the Resource window for changing some
3875 compositing attributes.  Once some video files are on the timeline, the
3876 compositor window is a good place to try compositing.
3880 @menu
3881 * THE CAMERA AND PROJECTOR::
3882 * MASKS::
3883 * CROPPING::
3884 * SAFE REGIONS::
3885 * OVERLAY MODES::
3886 * TRACK AND OUTPUT SIZES::
3887 @end menu
3891 @node THE CAMERA AND PROJECTOR
3892 @section THE CAMERA AND PROJECTOR
3894 In the compositor window, the most important functions are the
3895 @image{camera} camera button and the @image{projector} projector
3896 button.  These control operation of the camera and projector.  Inside
3897 Cinelerra's compositing pipeline, the camera determines where in the
3898 source video the temporary is copied from.  The projector determines
3899 where in the output the temporary is copied to.  The temporary is a
3900 frame of video in Cinelerra's memory where all graphics processing is
3901 done.  Each track has a different temporary which is defined by the
3902 track size.  By resizing the tracks you can create splitscreens, pans,
3903 and zooms.
3905 @sp 2
3906 @image{compositing_pipeline}
3907 @sp 2
3908 @b{Visual representation of the compositing pipeline}.
3910 When editing the camera and projector in the compositing window, the
3911 first track with @b{record} enabled is the track affected.  Even if
3912 the track is completely transparent, it's still the affected track.  If
3913 multiple video tracks exist, the easiest way to select one track for
3914 editing is to @b{shift-click} on the record icon of the track.  This
3915 solos the track.
3917 When the @b{projector} button is enabled in the compositor window,
3918 you're in projector editing mode.  A guide box appears in the video
3919 window.  Dragging anywhere in the video window causes the guide box to
3920 move, hopefully along with the video.  @b{shift-dragging} anywhere
3921 in the video window causes the guide box to shrink and grow along with
3922 the video.  Once you've positioned the video with the projector, you're
3923 ready to master the camera.
3925 Select the @image{camera} camera button to enable camera editing mode. 
3926 In this mode, the guide box shows where the camera position is in
3927 relation to past and future camera positions but not where it is in
3928 relation to the source video.  Dragging the camera box in the
3929 compositor window doesn't move the box but instead moves the location
3930 of the video inside the box.
3932 For example, when you drag the camera left, the video moves right. 
3933 When you drag the camera up, the video moves down.  When you shift-drag
3934 the camera, the effect is the same as if you zoomed in or out of the
3935 source.  The intention of the camera is to produce still photo panning,
3936 while the intention of the projector is to composite several sources in
3937 the same scene.
3939 In the compositing window, there is a popup menu of options for the
3940 camera and projector.  Right click over the video portion of the
3941 compositing window to bring up the menu.
3943 @itemize
3945 @item Reset Camera causes the camera to return to the center position.
3947 @item Reset Projector causes the projector to return to the center.
3949 @end itemize
3952 The camera and projector have shortcut operations neither in the popup
3953 menu or represented in video overlays.  These are accessed in the
3954 @b{Tool window}.  Most operations in the Compositor window have a
3955 tool window which is enabled by activating the @image{toolwindow}
3956 question mark.
3958 In the case of the camera and projector, the tool window shows x, y,
3959 and z coordinates.  By either tumbling or entering text directly, the
3960 camera and projector can be precisely positioned.  9 justification
3961 types are also defined for easy access.  A popular justification
3962 operation is upper left projection after image reduction.  This is used
3963 when reducing the size of video with aspect ratio adjustment.
3965 The translation effect allows simultaneous aspect ratio conversion and
3966 reduction but is easier to use if the reduced video is put in the upper
3967 left of the temporary instead of in the center.  The track size is set
3968 to the original size of the video and the camera is centered.  The
3969 output size is set to the reduced size of the video.  Without any
3970 effects, this produces just the cropped center portion of the video in
3971 the output.
3973 The translation effect is dropped onto the video track.  The input
3974 dimensions of the translation effect are set to the original size and
3975 the output dimensions are set to the reduced size.  To put the reduced
3976 video in the center section that the projector shows would require
3977 offsetting @b{out x and out y} by a complicated calculation. 
3978 Instead, we leave @b{out x and out y} at 0 and use the projector's
3979 tool window.
3981 Merely by selecting @image{left_justify} left justify and
3982 @image{top_justify} top justify, the projector displays the reduced
3983 image from the top left corner of the temporary in the center of the
3984 output.
3991 @node MASKS
3992 @section MASKS
3994 Masks select a region of the video for either displaying or hiding. 
3995 Masks are also used in conjunction with another effect to isolate the
3996 effect to a certain region of the frame.  A copy of one video track may
3997 be delayed slightly and unmasked in locations where the one copy has
3998 interference but the other copy doesn't.  Color correction may be
3999 needed in one section of a frame but not another.  A mask can be
4000 applied to just a section of the color corrected track while the
4001 vanilla track shows through.  Removal of boom microphones, airplanes,
4002 and housewives are other mask uses.
4004 The order of the compositing pipeline affects what can be done with
4005 masks.  Mainly, masks are performed on the temporary after effects and
4006 before the projector.  This means multiple tracks can be bounced to a
4007 masked track and projected with the same mask.
4009 Our compositing pipeline graph now has a masking stage.  There are 8
4010 possible masks per track.  Each mask is defined separately, although
4011 they each perform the same operation, whether it's addition or
4012 subtraction.
4014 @sp 2
4015 @image{compositing_pipeline2}
4016 @sp 2
4017 @b{Compositing pipeline with masks}
4019 To define a mask, go into the Compositor window and enable the
4020 @image{mask} @b{mask} toggle.  Now go over the video and
4021 click-drag.  Click-drag again in another part of the image to create
4022 each new point of the mask.  While it isn't the conventional bezier
4023 curve behavior, this masking interface performs in realtime what the
4024 effect of the mask is going to be.  Creating each point of the mask
4025 expands a rubber band curve.  
4027 Once points are defined, they can be moved by @b{ctrl-dragging} in
4028 the vicinity of the corner.  This; however, doesn't smooth out the
4029 curve.  The in-out points of the bezier curve are accessed by
4030 @b{shift-dragging} in the vicinity of the corner.  Then
4031 @b{shift-dragging} near the in or out point causes the point to
4032 move.
4034 Finally, once you have a mask, the mask can be translated in one piece
4035 by @b{alt-dragging} the mask.  Mask editing in Cinelerra is
4036 identical to how The Gimp edits masks except in this case the effect of
4037 the mask is always on.
4039 The masks have many more parameters which couldn't be represented with
4040 video overlays.  These are represented in the tool window for masks. 
4041 Selecting the @image{toolwindow} question mark when the @image{mask}
4042 mask toggle is highlighted brings up the mask options.
4044 The @b{mode} of the mask determines if the mask removes data or
4045 makes data visible.  If the mode is subtractive, the mask causes video
4046 to disappear.  If the mode is additive, the mask causes video to appear
4047 and everything outside the mask to disappear.
4049 The @b{value} of the mask determines how extreme the addition or
4050 subtraction is.  In the subtractive mode, higher values subtract more
4051 alpha.  In the additive mode, higher values make the region in the mask
4052 brighter while the region outside the mask is always hidden.
4054 The mask number determines which one of the 8 possible masks we're
4055 editing.  Each track has 8 possible masks.  When you click-drag in the
4056 compositor window, you're only editing one of the masks.  Change the
4057 value of @b{mask number} to cause another mask to be edited.  The
4058 previous mask is still active but only the curve overlay for the
4059 currently selected mask is visible.
4061 When multiple masks are used, their effects are ORed together.  Every
4062 mask in a single track uses the same value and mode.
4064 The edges of a mask are hard by default but this rarely is desired. 
4065 The @b{feather} parameter determines how many pixels to feather the
4066 mask.  This creates softer edges but takes longer to render.
4068 Finally, there are parameters which affect one point on the current
4069 mask instead of the whole mask.  These are @b{Delete, x, y}.  The
4070 active point is defined as the last point dragged in the compositor
4071 window.  Any point can be activated merely by @b{ctrl-clicking} near
4072 it without moving the pointer.  Once a point is activated,
4073 @b{Delete} deletes it and @b{x, y} allow repositioning by numeric
4074 entry.
4079 @node CROPPING
4080 @section CROPPING
4084 Cropping changes the value of the output dimensions and the projector
4085 to reduce the visible picture area.  Enable the @image{crop} crop
4086 toggle and the @image{toolwindow} tool window in the @b{compositing
4087 window} to perform cropping.
4089 This draws a rectangle over the video.  Click-drag anywhere in the
4090 video to start a new rectangle.  Click-drag over any corner of the
4091 rectangle to reposition the corner.
4093 Alt-click in the cropping rectangle to translate the rectangle to any
4094 position without resizing it.
4096 The tool window allows text entry of the coordinates and executes the
4097 cropping operation.  When the rectangle is positioned, hit the @b{do
4098 it} button in the tool window to execute the cropping operation.
4105 @node SAFE REGIONS
4106 @section SAFE REGIONS
4108 On consumer displays the borders of the image are cut off and within
4109 the cutoff point is a region which isn't always square like it is in
4110 the compositor window.  The borders are intended for scratch room and
4111 vertical blanking data.  You can show where these borders are by
4112 enabling the @image{titlesafe} safe regions toggle.  Keep titles inside
4113 the inner rectangle and keep action inside the outer rectangle.
4122 @node OVERLAY MODES
4123 @section OVERLAY MODES
4125 Every video track has an overlay mode, accessible by expanding the
4126 track.  The overlay mode is a pulldown menu on the left under the
4127 fader.  When collapsed, it displays an icon representing the current
4128 overlay mode.
4130 Select the @image{expandpatch_checked} expand track toggle to view all
4131 the options for a video track if you can't see the overlay mode.  The
4132 overlay mode of video tracks is @b{normal} by default.  Select other
4133 modes by clicking the overlay button and selecting an item from the
4134 popup menu.
4136 Overlay modes are processed inside the projector stage of compositing. 
4137 The different modes are summarized below.
4139 @itemize
4141 @item
4143 @b{Normal} uses a traditional Porter-Diff equation to blend tracks with
4144 alpha.  When no alpha exists in the project color model, the new track
4145 always replaces the output.
4147 @item
4149 @b{Addition}  In this mode, whatever is in the output is added to the
4150 current track.  The result is blended based on the current track's
4151 alpha onto the output.
4153 @item
4155 @b{Subtraction} In this mode, the current track is subtracted from the
4156 output and the result is alpha blended onto the output.
4158 @item 
4160 @b{Multiply} is the most useful operation.  The current track is multiplied
4161 by the output and the result blended onto the output.  Usually a black
4162 and white image with no alpha channel or a white title on a black image
4163 is used as the current track.  With the multiply operation, only the
4164 output portions under the white area show.
4166 @item
4168 @b{Divide} divides the current track by the output and the result is
4169 blended into the output.  It usually results in overloaded levels.
4171 @item
4173 @b{Replace} does no blending and overwrites the output with the current
4174 track.
4176 @end itemize
4182 @node TRACK AND OUTPUT SIZES
4183 @section TRACK AND OUTPUT SIZES
4185 The size of the temporary and the size of the output in our compositing
4186 pipeline are independant and variable.  This fits into everything
4187 covered so far.  The camera's viewport is the temporary size.  Effects
4188 are processed in the temporary and are affected by the temporary size. 
4189 Projectors are rendered to the output and are affected by the output
4190 size.  If the temporary is smaller than the output, the temporary is
4191 bordered by blank regions in the output.  If the temporary is bigger
4192 than the output, the temporary is cropped.
4194 The temporary size is defined as the track size.  Each track has a
4195 different size.  Right click on a track to bring up the track's menu. 
4196 Select @b{Resize Track} to resize the track to any arbitrary size. 
4197 Alternatively you can select @b{Match output size} to make the track
4198 the same size as the output.
4200 The output size is set in either @b{New} when creating a new project
4201 or @b{Settings->Format}.  In the Resource window there is another
4202 way to change the output size.  Right click on a video asset and select
4203 @b{Match project size} to conform the output to the asset.  When new
4204 tracks are created, the track size always conforms to the output size
4205 specified by these methods.
4212 @node KEYFRAMES
4213 @chapter KEYFRAMES
4216 When you change the fade, camera, projector, or other parameters for a
4217 track, they stay by default the same for the entire durection of the
4218 timeline.   Setting static parameters isn't very useful sometimes. 
4219 Normally you need to move the camera around over time or change mask
4220 positions.  Masks need to follow objects.  We create dymanic changes by
4221 defining keyframes.  A keyframe is a certain point in time when the
4222 settings for one operation change.  In Cinelerra, there are keyframes
4223 for almost every compositing parameter and effect parameter.
4225 Whenever you adjust any parameter, the value is stored in a keyframe. 
4226 If the value is stored in a keyframe, why doesn't it always change? 
4227 The keyframe it is stored in by default is known as the @b{default
4228 keyframe}.  The default keyframe applies to the entire duration if no
4229 other keyframes are present.  The default keyframe is not drawn
4230 anywhere because it always exists.  The only way change occurs over
4231 time is if non-default keyframes are created.
4233 Display keyframes for any parameter by using the @b{view} menu.  A
4234 faster way to toggle multiple keyframe types is to bring up
4235 @b{window->overlays}.  This window allows toggling of every parameter
4236 in the view menu.  When keyframes are selected, they are drawn on the
4237 timeline over the tracks they apply to.
4239 Keyframes come in many forms: curves, toggles, modes, and so on. 
4240 How to handle the different types of keyframes is described here.
4242 @menu
4243 * CURVE KEYFRAMES::
4244 * TOGGLE KEYFRAMES::
4245 * AUTOMATIC KEYFRAMES::
4246 * COMPOSITOR KEYFRAMES::
4247 * EDITING KEYFRAMES::
4248 @end menu
4252 @node CURVE KEYFRAMES
4253 @section CURVE KEYFRAMES
4255 Many parameters are stored in bezier curves.  Go to @b{view->fade} or
4256 @b{view->...zoom} to show curves on the timeline for those parameters. 
4257 In either arrow editing mode or i-beam editing mode, move the cursor
4258 over the curves in the timeline until it changes shape.  Then merely by
4259 clicking and dragging on the curve you can create a keyframe at the
4260 position.
4262 After the keyframe is created, click drag on it again to reposition
4263 it.  When you click-drag a second keyframe on the curve, it creates a
4264 smooth ramp.  @b{ctrl-dragging} on a keyframe changes the value of
4265 either the input control or the output control.  This affects the
4266 sharpness of the curve.  While the input control and the output control
4267 can be moved horizontally as well as vertically, the horizontal
4268 movement is purely for legibility and isn't used in the curve value.
4270 You may remember that The Gimp and the Compositing masks all use
4271 @b{shift} to select control points so why does the timeline use
4272 @b{ctrl}?  When you @b{shift-drag} on a timeline curve, the
4273 keyframe snaps to the value of either the next or previous keyframe,
4274 depending on which exists.  This lets you set a constant curve value
4275 without having to copy the next or previous keyframe.
4277 @menu
4278 * NAVIGATING CURVE KEYFRAMES::
4279 @end menu
4282 @node NAVIGATING CURVE KEYFRAMES
4283 @subsection NAVIGATING CURVE KEYFRAMES
4285 There isn't much room on the timeline for a wide range of curve
4286 values.  You need to zoom the curves in and out vertically to have any
4287 variability.  This is done by 2 tools: the automation fit button
4288 @image{fitautos} and automation zoom menu @image{autozoom}.
4290 The automation fit button scales and offsets the vertical range so the
4291 selected curve area appears in the timeline.  If a region of the
4292 timeline is highlighted by the cursor, only that region is scaled. 
4293 In/out points don't affect the zoomed region.  @b{Alt-f} also performs
4294 automation fitting.
4296 The automation zoom menu manually changes the vertical scaling of the
4297 curves in multiples of 2.  Click on its tumbler to change the zoom. 
4298 @b{Alt-Up and Alt-Dn} change the automation zoom from the keyboard.
4301 @node TOGGLE KEYFRAMES
4302 @section TOGGLE KEYFRAMES
4304 Mute is the only toggle keyframe.  Mute keyframes determine where the
4305 track is processed but not rendered to the output.  Click-drag on these
4306 curves to create a keyframe.  Unlike curves, the toggle keyframe has
4307 only two values: on or off.  Ctrl and shift do nothing on toggle
4308 keyframes.
4315 @node AUTOMATIC KEYFRAMES
4316 @section AUTOMATIC KEYFRAMES
4318 You may have noticed when a few fade curves are set up, moving the
4319 insertion point around the curves causes the faders to reflect the
4320 curve value under the insertion point.  This isn't just to look cool. 
4321 The faders themselves can set keyframes in automatic keyframe mode. 
4322 Automatic keyframe mode is usually more useful than dragging curves.
4324 Enable automatic keyframe mode by enabling the automatic keyframe
4325 toggle @image{autokeyframe}.  In automatic keyframe mode, every time
4326 you tweek a keyframeable parameter it creates a keyframe on the
4327 timeline.  Since automatic keyframes affect many parameters, it's best
4328 enabled just before you need a keyframe and disabled immediately
4329 thereafter.
4331 It's useful to go into the @b{View} menu and make the desired
4332 parameter visible before performing a change.  The location where the
4333 automatic keyframe is generated is under the insertion point.  If the
4334 timeline is playing back during a tweek, several automatic keyframes
4335 will be generated as you change the parameter.
4337 When automatic keyframe mode is disabled, a similarly strange thing
4338 happens.  Adjusting a parameter adjusts the keyframe immediately
4339 preceeding the insertion point.  If two fade keyframes exist and the
4340 insertion point is between them, changing the fader changes the first
4341 keyframe.
4343 There are many parameters which can only be keyframed in automatic
4344 keyframe mode.  These are parameters for which curves would take up too
4345 much space on the track or which can't be represented easily by a
4346 curve.
4348 Effects are only keyframable in automatic mode because of the number of
4349 parameters in each individual effect.  
4351 Camera and projector translation can only be keyframed in automatic
4352 keyframe mode while camera and projector zoom can be keyframed with
4353 curves.  It is here that we conclude the discussion of compositing,
4354 since compositing is highly dependant on the ability to change over
4355 time.
4359 @node COMPOSITOR KEYFRAMES
4360 @section COMPOSITOR KEYFRAMES
4362 Camera and projector translation is represented by two parameters: x
4363 and y.  Therefore it is cumbersome to adjust with curves.  Cinelerra
4364 solves this problem by relying on automatic keyframes.  With a video
4365 track loaded, move the insertion point to the beginning of the track
4366 and enable automatic keyframe mode.
4368 Move the projector slightly in the compositor window to create a
4369 keyframe.  Then go forward several seconds.  Move the projector a long
4370 distance to create another keyframe and emphasize motion.  This creates
4371 a second projector box in the compositor, with a line joining the two
4372 boxes.  The joining line is the motion path.  If you create more
4373 keyframes, more boxes are created.  Once all the desired keyframes are
4374 created, disable automatic keyframe mode.
4376 Now when scrubbing around with the compositor window's slider, the
4377 video projection moves over time.  At any point between two keyframes,
4378 the motion path is read for all time before the insertion point and
4379 green for all time after the insertion point.  It's debatable if this
4380 is a very useful feature but it makes you feel good to know what
4381 keyframe is going to be affected by the next projector tweek.
4383 Click-drag when automatic keyframes are off to adjust the preceeding
4384 keyframe.  If you're halfway between two keyframes, the first projector
4385 box is adjusted while the second one stays the same.  Furthermore, the
4386 video doesn't appear to move in step with the first keyframe.  This is
4387 because, halfway between two keyframes the projector translation is
4388 interpolated.  In order to set the second keyframe you'll need to scrub
4389 after the second keyframe.
4391 By default the motion path is a straight line, but it can be curved
4392 with control points.  @b{Ctrl-drag} to set either the in or out
4393 control point of the preceeding keyframe.  Once again, we depart from
4394 The Gimp because @b{shift} is already used for zoom.  After the in
4395 or out control points are extrapolated from the keyframe,
4396 @b{Ctrl-dragging} anywhere in the video adjusts the nearest control
4397 point.  A control point can be out of view entirely yet still
4398 controllable.
4400 When editing the camera translation, the behavior of the camera boxes
4401 is slightly different.  Camera automation is normally used for still
4402 photo panning.  The current camera box doesn't move during a drag, but
4403 if multiple keyframes are set, every camera box except the current
4404 keyframe appears to move.  This is because the camera display shows
4405 every other camera position relative to the current one.
4407 The situation becomes more intuitive if you bend the motion path
4408 between two keyframes and scrub between the two keyframes.  The
4409 division between red and green, the current position between the
4410 keyframes, is always centered while the camera boxes move.
4417 @node EDITING KEYFRAMES
4418 @section EDITING KEYFRAMES
4420 Keyframes can be shifted around and moved between tracks on the
4421 timeline using similar cut and paste operations to editing media.  Only
4422 the keyframes selected in the @b{view} menu are affected by keyframe
4423 editing operations, however.
4425 The most popular keyframe editing operation is replication of some
4426 curve from one track to the other, to make a stereo pair.  The first
4427 step is to solo the source track's record @image{recordpatch_up} patch
4428 by @b{shift-clicking} on it.  Then either set in/out points or
4429 highlight the desired region of keyframes.  Go to @b{keyframes->copy
4430 keyframes} to copy them to the clipboard.  Solo the destination track's
4431 record @image{recordpatch_up} patch by @b{shift-clicking} on it and
4432 go to @b{keyframes->paste keyframes} to paste the clipboard.
4434 The media editing commands are mapped to the keyframe editing commands
4435 by using the @b{shift} key instead of just the keyboard shortcut.  
4437 This leads to the most complicated part of keyframe editing, the
4438 default keyframe.  Remember that when no keyframes are set at all,
4439 there is still a default keyframe which stores a global parameter for
4440 the entire duration.  The default keyframe isn't drawn because it
4441 always exists.  What if the default keyframe is a good value which you
4442 want to transpose between other non-default keyframes?  The
4443 @b{keyframes->copy default keyframe} and @b{keyframes->paste
4444 default keyframe} allow conversion of the default keyframe to a
4445 non-default keyframe.
4447 @b{Keyframes->copy default keyframe} copies the default keyframe to
4448 the clipboard, no matter what region of the timeline is selected.  The
4449 @b{keyframes->paste keyframes} function may then be used to paste
4450 the clipboard as a non-default keyframe.
4452 If you've copied a non-default keyframe, it can be stored as the
4453 default keyframe by calling @b{keyframes->paste default keyframe}. 
4454 After using paste default keyframe to convert a non-default keyframe
4455 into a default keyframe, you won't see the value of the default
4456 keyframe reflected until all the non-default keyframes are removed.
4458 Finally, there is a convenient way to delete keyframes besides
4459 selecting a region and calling @b{keyframes->clear keyframes}. 
4460 Merely click-drag a keyframe before its preceeding keyframe or after
4461 its following keyframe on the track.
4469 @node CAPTURING MEDIA
4470 @chapter CAPTURING MEDIA
4472 Ideally, all media would be stored on hard drives, CD-ROM, flash, or
4473 DVD and loading it into Cinelerra would be a matter of loading a file. 
4474 In reality, very few sources of media can be accessed like a filesystem
4475 but instead rely on tape transport mechanisms and dumb I/O mechanisms
4476 to transfer the data to computers.  These media types are imported into
4477 Cinelerra through the Record dialog.
4479 The first step in recording is to configure the input device.  In
4480 @b{Settings->preferences} are a number of recording parameters
4481 described in configuration @xref{RECORDING}.  These parameters apply to
4482 recording no matter what the project settings are, because the
4483 recording parameters are usually the maximum capability of the
4484 recording hardware while project settings come and go.
4486 Go to @b{File->record} to record a dumb I/O source.  This prompts
4487 for an output format much like rendering does.  Once that's done, the
4488 record window and the record monitor pop up.
4490 The record window has discrete sections.  While many parameters change
4491 depending on if the file has audio or video, the discrete sections are
4492 always the same.
4494 @itemize
4496 @item
4498 The output format area describes the format of the output file and the
4499 current position within it.
4502 @item
4504 The edit batch area lets you change parameters in the current batch.
4506 @item
4508 The transport controls start and stop recording different ways.
4510 @item
4512 The batch list displays all the defined batches.
4514 @item
4516 The confirmation area lets you determine how the output files are
4517 imported into the timeline and quit.
4519 @end itemize
4521 @image{recording}
4522 @sp 2
4523 @b{Recording window areas}
4526 Recording in Cinelerra is organized around batches.  A batch
4527 essentially defines a distinct output file for the recording.  For now
4528 you can ignore the batch concept entirely and record merely by hitting
4529 the record button @image{record}.
4531 The record button opens the current output file if it isn't opened and
4532 writes captured data to it.  Use the stop button to stop the
4533 recording.  Recording can be resumed with the record button without
4534 erasing the file at this point.  In the case of a video file, there is
4535 a single frame record button @image{singleframe} which records a single
4536 frame.
4538 When enough media is recorded, choose an insertion method from the
4539 @b{Insertion Strategy} menu and hit @b{close}.
4544 @menu
4545 * BATCHES::
4546 * EDITING TUNER INFORMATION::
4547 @end menu
4552 @node BATCHES
4553 @section BATCHES
4555 Now we come to the concept of batches.  Batches try to make the dumb
4556 I/O look more like a filesystem.  Batches are traditionally used to
4557 divide tape into different programs and save the different programs as
4558 different files instead of recording straight through an entire tape. 
4559 Because of the high cost of developing frame-accurate deck control
4560 mechanisms, the only use of batches now is recording different programs
4561 during different times of day.  This is still useful for recording TV
4562 shows or time lapse movies as anyone who can't afford proper appliances
4563 knows.
4565 The record window supports a list of batches and two recording modes:
4566 interactive and batch recording.  Interactive recording happens when
4567 the record button is pressed.  Interactive recording starts immediately
4568 and uses the current batch to determine everything except start time. 
4569 By default, the current batch is configured to behave like tape.
4571 Batch recording happens when the @b{start} button is pressed.  In
4572 batch recording, the @b{start time} is the time the batch starts
4573 recording.
4575 First, you'll want to create some batches.  Each batch has certain
4576 parameters and methods of adjustment.  
4581 @itemize
4583 @item 
4585 @b{On} determines whether the batch is included in batch recording
4586 operations.  Click the list row under @b{On} to enable or disable
4587 batches.
4590 @item 
4592 @b{Path} is the file the batch is going to be recorded to.  The
4593 filename specified in the record dialog is the name of the first batch,
4594 to simplify interactive recording, but the filename may be changed in
4595 the record window for any batch in the @b{edit batch} area.
4598 @item
4600 @b{News} shows whether the file exists or not.  This is a very
4601 important attribute since there is no confirmation dialog if the file
4602 exists.  The first time you hit record, the file is opened.  If the
4603 file exists at this point it's erased.  News says @b{File exists} if
4604 it exists and @b{OK} if it doesn't.  Every time you resume recording
4605 in the same batch, the news should say @b{Open}, indicating the file
4606 is already opened and won't be erased in the next record button press.
4608 If you change out of the current batch after recording, the file is
4609 closed.  Next time you change into the batch, the file will be erased.
4611 @item
4613 @b{Start time} is the 24 hour time of day the batch will start
4614 recording if in batch mode.  The start time may become a time of tape
4615 and reel number if deck control is implemented but for now it's a time
4616 of day.
4618 @item
4620 @b{Duration} is the length of the batch.  It only has meaning if the
4621 @b{Mode} of the batch is @b{Timed}.  Once the recording length
4622 reaches @b{duration} the recording stops, whether in interactive or
4623 batch mode.
4625 @item
4627 @b{Source} has meaning only when the capturing hardware has multiple
4628 sources.  Usually the source is a tuner channel or input.  When the
4629 current batch finishes and the next batch begins recording, the source
4630 is changed to what the next batch is set to.  This way multiple TV
4631 stations can be recorded at different times.
4634 @end itemize
4636 The record window has a notion of the @b{current batch}.  The
4637 current batch is not the same as the batch which is highlighted in the
4638 batch list.  The current batch text is colored red in the batch list. 
4639 The highlighted batch is merely displayed in the edit batch section for
4640 editing.
4642 By coloring the current batch red, any batch can be edited by
4643 highlighting it, without changing the batch to be recorded.
4645 All recording operations take place in the current batch.   If there
4646 are multiple batches, highlight the desired batch and hit
4647 @b{activate} to make it the current batch.  If the @b{start}
4648 button is pressed, the current batch flashes to indicate it's waiting
4649 for the start time in batch mode.  If the @b{record} button is
4650 pressed, the current batch is recorded immediately in interactive mode.
4652 In batch and interactive recording modes, when the current batch
4653 finishes recording the next batch is activated and performed.  All
4654 future recording is done in batch mode.  When the first batch finishes,
4655 the next batch flashes until its start time is reached.
4657 Interrupt either the batch or the interactive operation by hitting the
4658 stop button.
4660 Finally there is the @image{rewind} rewind button.  In either
4661 interactive or batch recording, the rewind button causes the current
4662 batch to close its file.  The next recording operation in the current
4663 batch deletes the file.
4670 @node EDITING TUNER INFORMATION
4671 @section EDITING TUNER INFORMATION
4674 Sometimes in the recording process and the configuration process,
4675 you'll need to define and select tuner channels to either record or
4676 play back to.  In the case of the Video4Linux and Buz recording
4677 drivers, tuner channels define the source.  When the Buz driver is also
4678 used for playback, tuner channels define the destination.  
4680 Defining tuner channels is accomplished by pushing the @image{channel}
4681 channel button.  This brings up the channel editing window.  In this
4682 window you add, edit, and sort channels.  Also, for certain video
4683 drivers, you can adjust the picture quality.
4685 The @b{add} operation brings up a channel editing box.  The title of
4686 the channel appears in the channel list.  The source of the channel is
4687 the entry in the physical tuner's frequency table corresponding to the
4688 title.  
4690 Fine tuning in the channel edit dialog adjusts the physical frequency
4691 slightly if the driver supports it.  The norm and frequency table
4692 together define which frequency table is selected for defining
4693 sources.  If the device supports multiple inputs, the input menu
4694 selects these.
4696 To sort channels, highlight the channel in the list and push @b{move
4697 up} or @b{move down} to move it.
4699 Once channels are defined, the @b{source} item in the record window
4700 can be used to select channels for recording.  The same channel
4701 selecting ability also exists in the record monitor window.  Be aware
4702 channel selections in the record monitor window and the record window
4703 are stored in the current batch.
4705 For some drivers an option to @b{swap fields} may be visible.  These
4706 drivers don't get the field order right every time without human
4707 intervention.  Toggle this to get the odd and even lines to record in
4708 the right order.
4713 @node IMPROVING PERFORMANCE
4714 @chapter IMPROVING PERFORMANCE
4717 Let's get one thing perfectly clear.  Linux is not a very good
4718 desktop.  It's a server.  Most of what you'll find on modern Linux
4719 distributions are faceless, network-only programs strategicly designed
4720 to counteract one Microsoft server feature or another and not to
4721 perform very well at user interaction.  There are a number of
4722 parameters on Linux, which ordinary people can adjust to make it behave
4723 more like a thoroughbred in desktop usage.
4726 @menu
4727 * DISABLING SWAP SPACE::
4728 * ENLARGING SOUND BUFFERS::
4729 * FREEING MORE SHARED MEMORY::
4730 * SPEEDING UP THE HARD DRIVE::
4731 * DISABLING CRON::
4732 * REDUCING USB MOUSE SENSITIVITY::
4733 * ASSORTED X TWEEKS::
4734 * SPEEDING UP THE FILE SYSTEM::
4735 * IMPROVING ZORAN VIDEO::
4736 @end menu
4738 @node DISABLING SWAP SPACE
4739 @section DISABLING SWAP SPACE
4741 On systems with lots of memory, Cinelerra sometimes runs better without
4742 a swap space.  If you have 4 GB of RAM, you're probably better off
4743 without a swap space.  If you have 512MB of RAM, you should keep the
4744 swap.  If you want to do recording, you should probably disable swap
4745 space in any case.  There's a reason for this.  Linux only allows half
4746 the available memory to be used.  Beyond that, it starts searching for
4747 free pages to swap, in order to cache more disk access.  In a 4 GB
4748 system, you start waiting for page swaps after using only 2 GB.  
4750 The question then is how to make Linux run without a swap space. 
4751 Theoretically it should be a matter of running
4753 @example
4754 swapoff -a
4755 @end example
4757 Unfortunately, without a swap space the @b{kswapd} tasklet normally
4758 spins at 100%.  To eliminate this problem, edit @b{linux/mm/vmscan.c}.
4759 In this file, put a line saying @b{return 0;} before it says 
4761 @example
4762         /*
4763          * Kswapd main loop.
4764          */
4765 @end example
4767 Then recompile the kernel.
4772 @node ENLARGING SOUND BUFFERS
4773 @section ENLARGING SOUND BUFFERS
4775 In order to improve realtime performance, the audio buffers for all the
4776 Linux sound drivers were limited from 128k to 64k.  For recording audio
4777 and video simultaneously and for most audio recording this causes
4778 dropouts.  Application of low latency and preemtible kernel patches
4779 make it possible to record more audio recordings but it doesn't improve
4780 recording video with audio.  This is where you need to hack the kernel.
4782 To see if your sound buffers are suitable, run the included
4783 @b{soundtest} program with nothing playing or recording.  This
4784 allocates the largest possible buffers and displays them.  If the
4785 @b{TOTAL BYTES AVAILABLE} is under 131072, you need to see about
4786 getting the buffers enlarged in the driver.  While many drivers differ,
4787 we have a hack for at least one driver.
4789 This only applies to the OSS version of the Soundblaster Live driver. 
4790 Since every sound card and every sound driver derivative has a
4791 different implementation you'll need to do some searching for other
4792 sound cards.  Edit @b{linux/drivers/sound/emu10k1/audio.c}
4794 Where is says
4796 @example
4797 if (bufsize >= 0x10000)
4798 @end example
4800 change it to say
4802 @example
4803 if (bufsize > 0x40000)
4804 @end example
4808 Where is says
4810 @example
4811                 for (i = 0; i < 8; i++)
4812                         for (j = 0; j < 4; j++)
4813 @end example
4815 change it to say
4817 @example
4818                 for (i = 0; i < 16; i++)
4819                         for (j = 0; j < 4; j++)
4820 @end example
4824 In @b{linux/drivers/sound/emu10k1/hwaccess.h}
4826 Change
4828 @b{#define MAXBUFSIZE   65536} 
4830 to 
4832 @b{#define MAXBUFSIZE   262144} 
4834 Finally, in @b{linux/drivers/sound/emu10k1/cardwi.h}
4836 @b{#define WAVEIN_MAXBUFSIZE         65536}
4840 @b{#define WAVEIN_MAXBUFSIZE         262144}
4842 Then recompile the kernel modules.
4849 @node FREEING MORE SHARED MEMORY
4850 @section FREEING MORE SHARED MEMORY
4852 The Linux kernel only allows 32MB of shared memory to be allocated by
4853 default.  This needs to be increased to do anything useful.  Run the
4854 following command:
4856 @b{echo "0x7fffffff" > /proc/sys/kernel/shmmax}
4862 @node SPEEDING UP THE HARD DRIVE
4863 @section SPEEDING UP THE HARD DRIVE
4865 This is a very popular command sequence among Linux gurus, which is not
4866 done by default on Linux distributions.
4868 @b{hdparm -c3 -d1 -u1 -k1 /dev/hda}
4870 @b{-c3} puts the hard drive into 32 bit I/O with sync.  This normally
4871 doesn't work due to inept kernel support for most IDE controllers.  If
4872 you get lost interrupt or SeekComplete errors, quickly use @b{-c0}
4873 instead of @b{-c3} in your command.
4875 @b{-d1} enables DMA of course.  This frees up the CPU partially during
4876 data transfers.
4878 @b{-u1} allows multiple interrupts to be handled during hard drive
4879 transactions.  This frees up even more CPU time.
4881 @b{-k1} prevents Linux from resetting your settings in case of a
4882 glitch.
4888 @node DISABLING CRON
4889 @section DISABLING CRON
4891 Linux runs some daily operations like compressing man pages.  These may
4892 be acceptable background tasks while compiling or word processing but
4893 not while playing video.  Disable these operations by editing
4894 @b{/etc/rc.d/init.d/anacron}.
4896 Put @b{exit} before the first line not beginning in @b{#}.
4898 In @b{/etc/rc.d/init.d/crond} put @b{exit} before the first line not
4899 beginning in @b{#}.  Then make like Win 2000 and reboot.
4901 You can't use the @b{at} command anymore, but who uses that command
4902 anyways?
4912 @node REDUCING USB MOUSE SENSITIVITY
4913 @section REDUCING USB MOUSE SENSITIVITY
4915 Gamers like high resolution mice, but this can be painful for precisely
4916 positioning the mouse on a timeline or video screen.  XFree86 once
4917 allowed you to reduce PS/2 mouse sensitivity using commands like
4918 @b{xset m 1 1} but you're out of luck with USB mice or KVM's.
4920 We have a way to reduce USB mouse sensitivity but it requires editing
4921 the kernel source code.  Even though USB mice have been supported for
4922 years, the kernel source code for USB mice is constantly being
4923 rewritten.  These instructions were relevant for 2.6.12.3.  Edit
4924 @b{/usr/src/linux/drivers/input/mousedev.c}.  
4926 After the line saying 
4928 @example
4929 struct mousedev_hw_data @{
4930 @end example
4935 @example
4936 #define DOWNSAMPLE_N 100
4937 #define DOWNSAMPLE_D 350
4938 int x_accum, y_accum;
4939 @end example
4941 Next, the section which says something like:
4943 @example
4944 case EV_REL:
4945         switch (code) @{
4946                 case REL_X:     mousedev->packet.dx += value; break;
4947                 case REL_Y:     mousedev->packet.dy -= value; break;
4948                 case REL_WHEEL: mousedev->packet.dz -= value; break;
4949         @}
4950         break;
4951 @end example
4953 must be replaced by
4955 @example
4957 case EV_REL:
4958         switch (code) @{
4959                 case REL_X:
4960                         mousedev->packet.x_accum += value * DOWNSAMPLE_N;
4961                         mousedev->packet.dx += (int)mousedev->packet.x_accum / (int)DOWNSAMPLE_D;
4962                         mousedev->packet.x_accum -= ((int)mousedev->packet.x_accum / (int)DOWNSAMPLE_D) * (int)DOWNSAMPLE_D;
4963                         break;
4964                 case REL_Y:
4965                         mousedev->packet.y_accum += value * DOWNSAMPLE_N;
4966                         mousedev->packet.dy -= (int)mousedev->packet.y_accum / (int)DOWNSAMPLE_D;
4967                         mousedev->packet.y_accum -= ((int)mousedev->packet.y_accum / (int)DOWNSAMPLE_D) * (int)DOWNSAMPLE_D;
4968                         break;
4969                 case REL_WHEEL: mousedev->packet.dz -= value; break;
4970         @}
4971         break;
4975 @end example
4977 Change the value of @b{DOWNSAMPLE_N} to change the mouse sensitivity.
4986 @node ASSORTED X TWEEKS
4987 @section ASSORTED X TWEEKS
4990 XFree86 by default can't display Cinelerra's advanced pixmap rendering
4991 very fast.  The X server stalls during list box drawing.  Fix this by
4992 adding a line to your XF86Config* files.
4994 In the @b{Section "Device"} area, add a line saying:
4996 @b{Option "XaaNoOffscreenPixmaps"}
4998 and restart the X server.
5002 Screen blanking is really annoying, unless you're fabulously rich and
5003 can afford to leave your monitor on 24 hours a day without power saving
5004 mode.  In @b{/etc/X11/xinit/xinitrc} put 
5006 @example
5007 xset s off
5008 xset s noblank
5009 @end example
5011 before the first @b{if} statement.
5013 How about those windows keys which no Linux distribution even thinks to
5014 use.  You can make the window keys provide ALT functionality by editing
5015 @b{/etc/X11/Xmodmap}.  Append the following to it.
5017 @example
5018 keycode 115 = Hyper_L
5019 keycode 116 = Hyper_R
5020 add mod4 = Hyper_L
5021 add mod5 = Hyper_R
5022 @end example
5024 The actual changes to a window manager to make it recognize window keys
5025 for ALT are complex.  In @b{FVWM} at least, you can edit
5026 @b{/etc/X11/fvwm/system.fvwm2rc} and put
5028 @example
5029 Mouse 0 T A move-and-raise-or-raiselower
5030 #Mouse 0 W M move
5031 Mouse 0 W 4 move
5032 Mouse 0 W 5 move
5033 Mouse 0 F A resize-or-raiselower
5034 Mouse 0 S A resize-or-raiselower
5035 @end example
5037 in place of the default section for moving and resizing.  Your best
5038 performance is going to be on FVWM.  Other window managers seem to slow
5039 down video with extra event trapping and aren't as efficient in layout.
5051 @node SPEEDING UP THE FILE SYSTEM
5052 @section SPEEDING UP THE FILE SYSTEM
5054 You'll often store video on an expensive, gigantic disk array separate
5055 from your boot disk.  You'll thus have to manually install an EXT
5056 filesystem on this disk array, using the @b{mke2fs} command.  By far
5057 the fastest file system is 
5059 @example
5061 mke2fs -i 65536 -b 4096 my_device
5062 tune2fs -r0 -c10000 my_device
5064 @end example
5066 This has no journaling, reserves as few blocks as possible for
5067 filenames, and accesses the largest amount of data per block possible.
5068 A slightly slower file system, which is easier to recover after power
5069 failures is
5071 @example
5073 mke2fs -j -i 65536 -b 4096 my_device
5074 tune2fs -r0 -c10000 my_device
5076 @end example
5078 This adds a journal which slows down the writes but makes us immune to
5079 power failures.
5087 @node IMPROVING ZORAN VIDEO
5088 @section IMPROVING ZORAN VIDEO
5090 Video recorded from the ZORAN inputs is normally unaligned or not
5091 completely encoded on the right.  This can be slightly compensated by
5092 adjusting parameters in the driver sourcecode.
5094 In @b{/usr/src/linux/drivers/media/video/zr36067.c} the structures
5095 defined near line 623 affect alignment.  At least for NTSC, the 2.4.20
5096 version of the driver could be improved by changing 
5098 @example
5099 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 16 @};
5100 @end example
5104 @example
5105 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 17 @};
5106 @end example
5109 In @b{/usr/src/linux/drivers/media/video/bt819.c} more structures near
5110 line 76 affect alignment and encoding.
5112 For NTSC 
5114 @example
5115 @{858 - 24, 2, 523, 1, 0x00f8, 0x0000@},
5116 @end example
5118 could be changed to 
5119 @example
5120 @{868 - 24, 2, 523, 1, 0x00f8, 0x0000@},
5121 @end example
5123 Adjusting these parameters may or may not move your picture closer to
5124 the center.  More of the time, they'll cause the driver to lock up
5125 before capturing the first frame.
5128 @subsection NEW IN 2.6.5
5130 In the 2.6 kernels, the video subsystem was rewritten again from
5131 scratch.  To adjust the Zoran parameters go to
5132 @b{drivers/media/video/zoran_card.c} and look for a group of lines like
5134 @example
5135 static struct tvnorm f50sqpixel = @{ 944, 768, 83, 880, 625, 576, 16 @};
5136 static struct tvnorm f60sqpixel = @{ 780, 640, 51, 716, 525, 480, 12 @};
5137 static struct tvnorm f50ccir601 = @{ 864, 720, 75, 804, 625, 576, 18 @};
5138 static struct tvnorm f60ccir601 = @{ 858, 720, 57, 788, 525, 480, 16 @};
5140 static struct tvnorm f50ccir601_lml33 = @{ 864, 720, 75+34, 804, 625, 576, 18 @};
5141 static struct tvnorm f60ccir601_lml33 = @{ 858, 720, 57+34, 788, 525, 480, 16 @};
5143 /* The DC10 (57/16/50) uses VActive as HSync, so HStart must be 0 */
5144 static struct tvnorm f50sqpixel_dc10 = @{ 944, 768, 0, 880, 625, 576, 0 @};
5145 static struct tvnorm f60sqpixel_dc10 = @{ 780, 640, 0, 716, 525, 480, 12 @};
5147 /* FIXME: I cannot swap U and V in saa7114, so i do one
5148  * pixel left shift in zoran (75 -> 74)
5149  * (Maxim Yevtyushkin <max@@linuxmedialabs.com>) */
5150 static struct tvnorm f50ccir601_lm33r10 = @{ 864, 720, 74+54, 804, 625, 576, 18 @};
5151 static struct tvnorm f60ccir601_lm33r10 = @{ 858, 720, 56+54, 788, 525, 480, 16 @};
5152 @end example
5154 These seem to control the image position.  At least for the LML33 the
5155 following definition for @b{f60ccir601_lml33} does the trick.
5157 @example
5158 static struct tvnorm f60ccir601_lml33 = @{ 858, 720, 67+34, 788, 525, 480, 13 @};
5159 @end example
5166 @node TROUBLESHOOTING
5167 @chapter TROUBLESHOOTING
5170 @menu
5171 * BUZ DRIVER CRASHES::
5172 * DRAGGING IN AND OUT POINTS DOESN'T WORK::
5173 * LOCKING UP WHEN LOADING FILES::
5174 * SYNCHRONIZATION LOST WHILE RECORDING::
5175 * APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK::
5176 @end menu
5178 @node BUZ DRIVER CRASHES
5179 @section BUZ DRIVER CRASHES
5181 First, Zoran capture boards must be accessed using the @b{Buz} video
5182 driver in @b{Preferences->Recording} and @b{Preferences->Playback}. 
5183 Some performance tweeks are available in another section. 
5184 @xref{IMPROVING PERFORMANCE}.
5186 Once tweeked, the Buz driver seems to crash if the number of recording
5187 buffers is too high.  Make sure @b{Preferences->Recording->Frames to
5188 buffer in device} is below 10.
5191 @node DRAGGING IN AND OUT POINTS DOESN'T WORK
5192 @section DRAGGING IN AND OUT POINTS DOESN'T WORK
5195 Sometimes there will be two edits really close together.  The point
5196 selected for dragging may be next to the indended edit on an edit too
5197 small to see at the current zoom level.  Zoom in horizontally.
5201 @node LOCKING UP WHEN LOADING FILES
5202 @section LOCKING UP WHEN LOADING FILES
5205 The most common reason loading files locks up is because the codec
5206 isn't supported.  Another reason is because Cinelerra is building
5207 picons for the Resources window.  If you load a large number of images,
5208 it needs to decompress every single image to build a picon.  Go into
5209 settings->preferences->interface and disable @b{Use thumbnails in
5210 resource window} to skip this process.
5216 @node SYNCHRONIZATION LOST WHILE RECORDING
5217 @section SYNCHRONIZATION LOST WHILE RECORDING
5219 If the framerate of the recording is much lower than the framerate of
5220 the source, the video will accumulate in the recording buffers over
5221 time while the audio and video are well out of sync.  Decrease the
5222 @b{number of frames to buffer in the device} in
5223 @b{preferences->recording} so the excess frames are dropped instead of
5224 buffered.
5226 @node APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK
5227 @section APPLYING LINEARIZE FOLLOWED BY BLUR DOESN'T WORK
5229 The linearize effect uses the pow function while the blur effect uses a
5230 number of exp functions in the math library.  For some reason, using
5231 the pow function breaks later calls to the exp functions in the math
5232 library.  You need to apply linearize after blur to get it to work.
5243 @node SECRETS OF CINELERRA
5244 @chapter SECRETS OF CINELERRA
5247 @menu
5248 * DOLBY PRO LOGIC ENCODING::
5249 * ANALOG TV CLEANING::
5250 * DEFEATING INTERLACING::
5251 * MAKING VIDEO LOOK LIKE FILM::
5252 * CLEARING OUT HAZE::
5253 @end menu
5256 @node DOLBY PRO LOGIC ENCODING
5257 @section DOLBY PRO LOGIC ENCODING
5259 Dolby pro logic is an easy way to output 6 channel audio from a 2
5260 channel soundcard with degraded but useful results.  Rudimentary Dolby
5261 pro logic encoding can be achieved with clever usage of the effects.
5263 Create 2 audio tracks with the same audio.  Apply @b{invert audio} to
5264 one track.  The signal comes out of the back speakers.
5266 Create a single audio track with monaural audio of a different source. 
5267 Center it in the @b{pan} control.  The signal comes out of the center
5268 speaker.
5270 Create other tracks with different signals and pan them left or right
5271 to put signals in the front left or right speaker.
5273 Finally, if a copy of the signal in the back speakers is desired in any
5274 single front speaker, the signal in the back speakers must be delayed
5275 by at least 0.05 seconds and a single new track should be created.  Pan
5276 the new track to orient the signal in the front speakers.
5278 If the same signal is desired in all the speakers except the center
5279 speaker, delay the back speakers by 0.5 seconds and delay either the
5280 front left or front right by 0.2 seconds.
5282 If you want to hear something from the subwoofer, create a new track,
5283 select a range, drop a synthesizer effect, and set the frequency below
5284 60 Hz.  The subwoofer merely plays anything below around 60Hz.
5286 Other tricks you can perform to separate the speakers are parametric
5287 equalization to play only selected ranges of frequencies through
5288 different speakers and lowpass filtering to play signals through the
5289 subwoofer.
5294 @node ANALOG TV CLEANING
5295 @section ANALOG TV CLEANING
5298 Unless you live in a rich nation like China or are a terrorist, you
5299 probably record analog TV more than you record digital TV.  The picture
5300 quality on analog TV is horrible but you can do things in Cinelerra to
5301 make it look more like it did in the studio.
5303 First, when capturing the video, capture it in the highest resolution
5304 possible.  For Europeans it's 720x576 and for Americans it's 720x480. 
5305 Don't bother adjusting the brightness or contrast in the recording
5306 monitor, although maxing out the color is useful.  Capture it using
5307 MJPEG or uncompressed Component Video if possible.  If those are too
5308 demanding, then capture it using JPEG.  RGB should be a last resort.
5310 Now on the timeline use @b{Settings->Format} to set a YUV colorspace. 
5311 Drop a @b{Downsample} effect on the footage.  Set it for 
5313 @example
5314 Horizontal:        2
5315 Horizontal offset: 0
5316 Vertical:          2
5317 Vertical offset:   0
5319       red
5320   x   green
5321   x   blue
5322       alpha
5323 @end example
5325 Use the camera tool to shift the picture up or down a line to remove
5326 the most color interference from the image.  This is the difference
5327 we're looking for:
5329 @sp 1
5331 @image{cleaning1}
5333 If you have vertical blanking information or crawls which constantly
5334 change in each frame, block them out with the @b{Mask} tool.  This
5335 improves compression ratios.
5337 This is about all you can do without destroying more data than you
5338 would naturally lose in compression.  The more invasive cleaning
5339 techniques involve deinterlacing.
5345 @node DEFEATING INTERLACING
5346 @section DEFEATING INTERLACING
5349 Interlacing is done on most video sources because it costs too much to
5350 build progressive scanning cameras and progressive scanning CRT's. 
5351 Many a consumer has been dissapointed to spend 5 paychecks on a
5352 camcorder and discover what horrible jagged images it produces on a
5353 computer monitor.
5355 As for progressive scanning camcorders, forget it.  Cost factors are
5356 probably going to keep progressive scanning cameras from ever equalling
5357 the spatial resolution of interlaced cameras.  Interlacing is here to
5358 stay.  That's why they made deinterlacing effects in Cinelerra.
5360 We don't believe there has ever been a perfect deinterlacing effect. 
5361 They're either irreversible or don't work.  Cinelerra cuts down the
5362 middle by providing deinterlacing tools that are irreversible sometimes
5363 and don't work sometimes but are neither one or the other.
5365 @b{Line Doubling}
5367 This one is done by the @b{Deinterlace} effect when set to @b{Odd
5368 lines} or @b{Even lines}.  When applied to a track it reduces the
5369 vertical resolution by 1/2 and gives you progressive frames with
5370 stairstepping.  This is only useful when followed by a scale effect
5371 which reduces the image to half its size.
5373 @b{Line averaging}
5375 The @b{Deinterlace} effect when set to @b{Average even lines} or
5376 @b{Average odd lines} does exactly what line doubling does except
5377 instead of making straight copies of the lines it makes averages of the
5378 lines.  This is actually useful for all scaling.
5380 There's an option for adaptive line averaging which selects which lines
5381 to line average and which lines to leave interlaced based on the
5382 difference between the lines.  It doesn't work.
5384 @b{Inverse Telecine}
5386 This is the most effective deinterlacing tool when the footage is an
5387 NTSC TV broadcast of a film.  @xref{INVERSE TELECINE}.
5390 @b{Time base correction}
5392 The first three tools either destroy footage irreversibly or don't work
5393 sometimes.  @b{Time base correction} is last because it's the perfect
5394 deinterlacing tool.  It leaves the footage intact.  It doesn't reduce
5395 resolution, perceptually at least.  It doesn't cause jittery timing.
5397 The @b{Frames to Fields} effect converts each frame to two frames, so
5398 it must be used on a timeline whose project frame rate is twice the
5399 footage's frame rate.  In the first frame it puts a line averaged copy
5400 of the even lines.  In the second frame it puts a line averaged copy of
5401 the odd lines.  When played back at full framerates it gives the
5402 illusion of progressive video with no loss of detail.
5404 Best of all, this effect can be reversed with the @b{Fields to frames}
5405 nonrealtime effect.  That one combines two frames of footage back into
5406 the one original interlaced frame of half the framerate.
5408 Unfortunately, the output of @b{Frames to Fields} can't be compressed
5409 as efficiently as the original because it introduces vertical twitter
5410 and a super high framerate.
5412 Interlaced 29.97fps footage can be made to look like film by applying
5413 @b{Frames to Fields} and then reducing the project frame rate of the
5414 resulting 59.94fps footage to 23.97fps.  This produces no timing jitter
5415 and the occasional odd field gives the illusion of more detail than
5416 there would be if you just line averaged the original.
5419 @b{HDTV exceptions}
5421 1920x1080 HDTV is encoded a special way.  If it's a broadcast of
5422 original HDTV film, an inverse telecine works fine.  If it's a
5423 rebroadcast of a 720x480 source, you need to use a time base and line
5424 doubling algorithm to deinterlace it, @xref{1080 TO 480}.
5429 @node MAKING VIDEO LOOK LIKE FILM
5430 @section MAKING VIDEO LOOK LIKE FILM
5435 Video sweetening is constantly getting better.  Lately the best thing
5436 you can do for dirt cheap consumer camcorder video is to turn it into
5437 progressive 24fps output.  While you can't really do that, you can get
5438 pretty close for the money.  Mind you, this procedure can degrade high
5439 quality video just as easily as it improves low quality video.  It
5440 should only be used for low quality video.
5442 @itemize
5444 @item
5446 Step 1 - Set project framerate to twice the video framerate.
5448 @item
5450 Step 2 - Apply a @b{Sharpen} effect.  Set it to sharpness: 25, no
5451 interlacing, and horizontal only.
5453 @item
5455 Step 3 - Drop a @b{Frame to Fields} effect on the same track.  Set
5456 Average Empty Rows on and play through the video a few times to figure
5457 out which field is first.  If the wrong field is first, the motion is
5458 shaky.  Secondly, any editing in the doubled frame rate may now screw
5459 up the field order.  We're still figuring out the easiest way to
5460 support warnings for field glitches but for now you need to go back to
5461 the normal framerate to do editing or play test to make sure the fields
5462 are right.
5465 @item
5467 Step 4 - Render just the video to the highest quality file possible.
5469 @item
5471 Step 5 - Import the video back to a new track.  Set the project
5472 framerate to 24.  The new track should now display more filmish and
5473 sharper images than the original footage.
5475 @end itemize
5477 This entire procedure could be implemented in one nonrealtime effect,
5478 but the biggest problem with that is you'll most often want to keep the
5479 field based output and the 24fps output for posterity.  A nonrealtime
5480 effect would require all that processing just for the 24fps copy. 
5481 Still debating that one.
5491 @node CLEARING OUT HAZE
5492 @section CLEARING OUT HAZE
5494 Let's face it, if you're employed you live in Silicon Valley.  As such
5495 you probably photograph a lot of haze and never see blue sky ever. 
5496 Even if you can afford to briefly go somewhere where there is blue sky,
5497 horizon shots usually can stand for more depth.  This is what the
5498 @b{gradient effect} is for.
5500 Drop the gradient effect on hazy tracks.  Set the following parameters:
5502 @example
5503 Angle: 0
5504 Inner radius: 0
5505 Outer radius: 40
5506 Inner color: blue 100% alpha
5507 Outer color: blue 0% alpha
5508 @end example
5510 It's important to set the 0% alpha color to blue even though it's 0%
5511 alpha.  The color of the outer alpha is still interpolated with the
5512 inner color.  This is a generally applicable setting for the gradient. 
5513 Some scenes may work better with orange or brown for an evening feel.
5523 @node SECRETS OF CINELERRA EFFECTS
5524 @chapter SECRETS OF CINELERRA EFFECTS
5526 Most effects in Cinelerra can be figured out just by using them and
5527 tweeking.  Here are brief descriptions of effects which you might not
5528 utilize fully by mere experimentation.
5531 @menu
5532 * 1080 TO 480::       How to convert HDTV into SD
5533 * CHROMA KEY::        Create transparency based on color similarities.
5534 * COMPRESSOR::        How to reduce the dynamic range of audio.
5535 * DECIMATE::          How to reduce frame rates by eliminating similar frames.
5536 * DEINTERLACE::       How to convert interlaced video to progressive video.
5537 * DIFFERENCE KEY::    Create transparency based on color differences.
5538 * FREEZE FRAME::      How to stop action in the timeline.
5539 * HISTOGRAM::         How to change the mapping of different brightness values.
5540 * INVERSE TELECINE::  How to convert pulled down frames to progressive frames.
5541 * INTERPOLATE VIDEO:: How to create the illusion of higher framerates.
5542 * LINEARIZE::         Fix gamma in raw camera images
5543 * LOOP::              How to loop regions of the timeline.
5544 * MOTION::            The art of motion tracking.
5545 * REFRAMERT::         Changing the number of frames in a sequence.
5546 * REFRAME::           Changing the number of frames in a sequence with rendering.
5547 * RESAMPLE::          Change the number of samples in a sequence with rendering.
5548 * REVERSE VIDEO/AUDIO:: How to play regions in reverse.
5549 * THRESHOLD::         How to get monochrome out of a region of the image.
5550 * TIME AVERAGE::      How to add trail patterns or increase still image quality.
5551 * TITLER::            How to add text to a track from inside Cinelerra.
5552 * VIDEO SCOPE::       How to view the dynamic range of intensity and hue.
5553 @end menu
5558 @node 1080 TO 480
5559 @section 1080 TO 480
5562 Most TV broadcasts are recieved with a 1920x1080 resolution but
5563 originate from a 720x480 source at the studio.  It's a waste of space
5564 to compress the entire 1920x1080 if the only resolvable details are
5565 720x480.  Unfortunately resizing 1920x1080 video to 720x480 isn't as
5566 simple as shrinking it.
5568 At the TV station the original 720x480 footage was first converted to
5569 fields of 720x240.  Each field was then scaled up to 1920x540.  The two
5570 1920x540 fields were finally combined with interlacing to form the
5571 1920x1080 image.  This technique allows a consumer TV to display the
5572 resampled image without extra circuitry to handle 720x480 interlacing
5573 in a 1920x1080 image.
5575 If you merely deinterlaced the 1920x1080 images, you would end up with
5576 details of 720x240.  The 1080 to 480 effect properly extracts two
5577 1920x540 size fields from the image, resizes them separately, and
5578 combines them again to restore the original 720x480.  Tracks to which
5579 it is applied need to be at 1920x1080 resolution.  The project settings
5580 in @b{settings->format} should be at 720x480 resolution.
5582 The effect doesn't know if the first row in the 1920x1080 image belongs
5583 to the first row of the 720x480 original.  You have to specify what the
5584 first row is in the effect configuration.
5586 The output of this effect is a small image in the middle of the
5587 original 1920x1080 frame.  Use the projector to center the output image
5588 in the playback.
5590 Finally, once you have 720x480 interlaced video you can either apply
5591 @b{frames to fields} of @b{inverse telecine} to further recover original
5592 progressive frames.
5600 @node CHROMA KEY
5601 @section CHROMA KEY
5604 This effect erases pixels which match the selected color.  They are
5605 replaced with black if there is no alpha channel and transparency if
5606 there is an alpha channel.  The selection of color model is important
5607 to determine the behavior.
5609 Chroma key uses either the lightness or the hue to determine what is
5610 erased.  @b{Use value} singles out only the lightness to determine
5611 transparency.  Select a center color to erase using the @b{Color}
5612 button.  Alternatively a color can be picked directly from the output
5613 frame by first using the @b{color picker} in the compositor window and
5614 then selecting the @b{Use color picker} button.  This sets the chroma
5615 key color to the current color picker color.
5617 Be aware that the output of the chroma key is fed back to the
5618 compositor, so selecting a color again from the compositor will use the
5619 output of the chroma key effect.  The chroma key should be disabled
5620 when selecting colors with the color picker.
5623 If the lightness or hue is within a certain threshold it's erased. 
5624 Increasing the threshold determines the range of colors to be erased. 
5625 It's not a simple on/off switch, however.  As the color approaches the
5626 edge of the threshold, it gradually gets erased if the slope is high or
5627 is rapidly erased if the slope is low.  The slope as defined here is
5628 the number of extra values flanking the threshold required to go from
5629 opaque to transparent.
5631 Normally threshold is very low when using a high slope.  The two
5632 parameters tend to be exclusive because slope fills in extra threshold.
5634 The slope tries to soften the edges of the chroma key but it doesn't
5635 work well for compressed sources.  A popular softening technique is to
5636 use a maximum slope and chain a blur effect below the chroma key effect
5637 to blur just the alpha.
5647 @node COMPRESSOR
5648 @section COMPRESSOR
5650 Contrary to computer science experience, the audio compressor does not
5651 reduce the amount of data required to store the audio.  The audio
5652 compressor reduces the dynamic range of the audio.  In Cinelerra the
5653 compressor actually performs the function of an expander and
5654 compressor.
5656 The compressor works by calculating the maximum sound level within a
5657 certain time period of the current position.  The maximum sound level
5658 is taken as the input sound level.  For every input sound level there
5659 is an output sound level specified by the user.  The gain at the
5660 current position is adjusted so the maximum sound level in the time
5661 range is the user specified value.
5663 The compressor has a graph which correlates every input sound level to
5664 an output level.  The horizontal direction is the input sound level in
5665 dB.  The vertical direction is the ouptut sound level in dB.  The user
5666 specifies output sound levels by creating points on the graph.  Click
5667 in the graph to create a point.  If 2 points exist, drag one point
5668 across another point to delete it.  The most recent point selected has
5669 its vales displayed in textboxes for more precise adjustment.
5671 To make the compressor reduce the dynamic range of the audio, make all
5672 the output values greater than the input values except 0 db.  To make
5673 the compressor expand the dynamic range of the audio, make all the
5674 output values except 0 db less than the input values.  The algorithm
5675 currently limits all sound levels above 0 db to 0 db so to get an
5676 overloaded effect put a gain effect before the compressor to reduce all
5677 the levels and follow it with another gain effect to amplify all the
5678 levels back over 0 db.
5680 @b{Reaction secs:} This determines where in relation to the current
5681 position the maximum sound level is taken and how fast the gain is
5682 adjusted to reach that peak.  It's notated in seconds.  If it's
5683 negative the compressor reads ahead of the current position to get the
5684 future peak.  The gain is ramped to that peak over one reaction time. 
5685 This allows it to hit the desired output level exactly when the input
5686 peak occurs at the current position.
5688 If the reaction time is positive the compressor scans only the current
5689 position for the gain and ramps gain over one reaction time to hit the
5690 desired output level.  It hits the output level exactly one reaction
5691 time after detecting the input peak.
5693 @b{Decay secs:} If the peak is higher than the current level, the
5694 compressor ramps the gain up to the peak value.  Then if a future peak
5695 is less than the current peak it ramps the gain down.  The time taken
5696 to ramp the gain down can be greater than the time taken to ramp the
5697 gain up.  This ramping down time is the decay seconds.
5699 @b{Trigger:} The compressor is a multichannel effect.  Several tracks
5700 can share one compressor.  Normally only one track is scanned for the
5701 input peak.  This track is specified by the @b{Trigger}.  By sharing
5702 several tracks and playing with the trigger value, you can make a sine
5703 wave on one track follow the amplitude of a drum on another track for
5704 example.
5706 @b{No trigger:} The compressor can use one track as the trigger or it
5707 can take the highest value in any track as the peak to assign to all
5708 the tracks.  Enabling @b{No trigger} causes it to assign the highest
5709 value in any track as the peak for all tracks.
5711 @b{Smooth only:} For visualizing what the compressor is doing to the
5712 soundlevel, this option causes it to replace the soundwave with just
5713 the current peak value.  It makes it very easy to see how @b{reaction
5714 secs} affects the detected peak values.
5722 @node DECIMATE
5723 @section DECIMATE
5725 This effect drops frames from a track which are most similar in order
5726 to reduce the frame rate.  This is usually applied to a DVD to convert
5727 the 29.97 fps video to the 23.97 fps film rate but this decimate effect
5728 can take any input rate and convert it to any lower output rate.
5730 The output rate of @b{decimate} is the project frame rate.  The input
5731 rate is set in the @b{decimate} user interface.  To convert 29.97fps
5732 progressive video to 23.97fps film, apply a decimate effect to the
5733 track.  Set the decimate input rate to 29.97 and the project rate to
5734 23.97.
5736 Be aware every effect layered before decimate processes video at the
5737 decimate input rate and every effect layered after decimate processes
5738 video at the project frame rate.  Computationally intensive effects
5739 should come below decimate.
5741 Decimate is not to be confused with @b{frames to fields}.  Frames to
5742 fields does not have a different input rate than output rate.  It
5743 merely replicates each frame.
5751 @node DEINTERLACE
5752 @section DEINTERLACE
5754 The deinterlace effect has evolved over the years to deinterlacing and
5755 a whole lot more.  In fact two of the deinterlacing methods, @b{Inverse
5756 Telecine} and @b{Frames to Fields}, are separate effects.  The
5757 deinterlace effect offers several variations of line replication to
5758 eliminate comb artifacts in interlaced video.  It also has some line
5759 swapping tools to fix improperly captured video or make the result of a
5760 reverse effect display fields in the right order.
5769 @node DIFFERENCE KEY
5770 @section DIFFERENCE KEY
5772 The differency key creates transparency in areas which are similar
5773 between 2 frames.  The Difference key effect must be applied to 2
5774 tracks.  One track contains the action in front of a constant
5775 background and another track contains the background with nothing in
5776 front of it.  Apply the difference key to the track with the action and
5777 apply a shared copy of it to the track with the background.  The track
5778 with the background should be muted and underneath the track with the
5779 action and the colormodel should have an alpha channel.
5781 Pixels which are different between the background and action track are
5782 treated as opaque.  Pixels which are similar are treated as
5783 transparent.  Change @b{threshold} in the differency key window to make
5784 more pixels which aren't the same color transparent. Change @b{slope}
5785 to change the rate at which the transparency tapers off as pixels get
5786 more different.
5788 The slope as defined here is the number of extra values flanking the
5789 threshold required to go from opaque to transparent.  A high slope is
5790 more useful with a low threshold because slope fills in extra
5791 threshold.
5793 @b{Use value} causes the intensity of pixels to be compared instead of
5794 the color.
5796 Applying a blur to the top track with just the alpha channel blurred
5797 can soften the transparency border.
5809 @node FREEZE FRAME
5810 @section FREEZE FRAME
5812 In its simplest form, highlight a region of the track to freeze, drop
5813 the freeze frame effect on the highlighted region, and the lowest
5814 numbered frame in the affected area will play throughout the entire
5815 region.  
5817 Freezeframe has an @b{enabled} option which can be keyframed.  Regions
5818 of a freeze frame effect which are enabled repeat the lowest numbered
5819 frame since the last keyframe.  This has unique possibilities.
5821 If a freeze frame effect has a keyframe in the middle of it set to
5822 @b{enabled}, the frame in the middle is repeated in the entire effect.
5824 If a freeze frame effect has several keyframes, each set to
5825 @b{enabled}, every time a keyframe is encountered the frame under it
5826 becomes the frozen one.
5828 If a freeze frame effect alternates between @b{enabled} and
5829 @b{disabled}, each time an @b{enabled} keyframe is encountered the
5830 frame under it is replicated until the next @b{disabled} keyframe.  The
5831 disabled regions play through.
5838 @node HISTOGRAM
5839 @section HISTOGRAM
5842 This shows the number of occurances of each value of a certain color
5843 channel on a histogram plot.
5845 It is always performed in floating point RGB regardless of
5846 the project colorspace.  The histogram has two sets of transfer
5847 parameters: the input transfer and the output transfer.
5849 The input transfer is defined by a graph on top of the histogram.  The
5850 horizontal direction corresponds to every possible input color.  The
5851 vertical direction corresponds to the output color for every input
5852 color.  Video entering the histogram is first plotted on the histogram
5853 plot, then it is translated so output values now equal the output
5854 values for each input value on the input graph.
5856 The input graph is edited by adding and removing any number of points. 
5857 Click and drag anywhere in the input graph to create a point and move
5858 it.  Click on an existing point to make it active and move it.  The
5859 active point is always indicated by being filled in.  The active
5860 point's input and output color are given in text boxes on top of the
5861 window.  The input and output color of the point can be changed through
5862 these text boxes.
5864 Points can be deleted by first selecting a point and then dragging it
5865 to the other side of an adjacent point.  They can also be deleted by
5866 selecting them and hitting @b{delete}.
5869 After the input transfer, the image is processed by the output
5870 transfer.  The output transfer is simply a minimum and maximum to scale
5871 the input colors to.  Input values of 100% are scaled down to the
5872 output's maximum.  Input values of 0% are scaled up to the output
5873 minimum.
5876 Input values below 0 are always clamped to 0 and input values above
5877 100% are always clamped to 100%.  Click and drag on the output
5878 gradient's triangles to change it.  It also has textboxes to enter
5879 values into.
5881 Enable the @b{automatic} toggle to have the histogram calculate an
5882 automatic input transfer for every frame.  It does this by setting
5883 minimum and maximum input points to permit only the middle 99% of the
5884 pixels to pass through.  The number of pixels permitted to pass through
5885 is set by the @b{Threshold} textbox.  A threshold of 0.99 scales the
5886 input so 99% of the pixels pass through.  Smaller thresholds permit
5887 fewer pixels to pass through and make the output look more contrasty.
5889 A different automatic input transfer is applied to the R, G, and B
5890 channels but not to the value.
5892 The histogram applies a different set of transfers to R, G, B, and
5893 value.  The value transfers are applied uniformly to R, G, B after
5894 their discrete transfers are applied.  The histogram displayed for the
5895 value transfer is the maximum R, G, or B for every pixel.
5897 Select which transfer to view by selecting one of the channels on the
5898 top of the histogram.
5912 @node INVERSE TELECINE
5913 @section INVERSE TELECINE
5915 This is the most effective deinterlacing tool when the footage is a
5916 video transfer of a film.  Here the film was converted from 24fps to
5917 60fps.  Then the 60fps was downsampled to 30fps by extracting odd and
5918 even lines and interlacing the lines.  The IVTC effect is primarily a
5919 way to convert interlaced video to progressive video.  It undoes three
5920 patterns of interlacing.
5922 @example
5923   A AB BC CD D
5924   AB CD CD DE EF
5925   Automatic
5926 @end example
5928 The first two options are fixed patterns and affected by the @b{pattern
5929 offset} and @b{odd field first} parameters.  The last option creates
5930 several combinations of lines for each frame and picks the most
5931 progressive combination.  It's a brute force algorithm.
5933 This technique doesn't rely on a pattern like other techniques and is
5934 less destructive but the timing is going to be jittery because of the
5935 lack of a frame rate reduction.  In order to smooth out the timing, you
5936 need to follow inverse telecine with a decimate effect.
5942 @node INTERPOLATE VIDEO
5943 @section INTERPOLATE VIDEO
5946 The interpolate video effect tries to create the illusion of a higher
5947 frame rate from source footage of very low framerates by averaging
5948 frames over time.  It averages two input frames for each output frame. 
5949 The input frames are at different times, resulting in a dissolve for
5950 all output frames between the input frames.  There are two ways of
5951 specifying the input frames.  You can specify an input frame rate which
5952 is lower than the project frame rate.  This causes input frames to be
5953 taken at even intervals,
5955 You can also specify keyframe locations as the positions of the input
5956 frames.  In this mode the output frame rate is used as the input frame
5957 rate and you just create keyframes wherever you want to specify an
5958 input frame.
5963 @node LINEARIZE
5964 @section LINEARIZE
5967 Raw camera images store colors in a logarithmic scale.  The blacks in
5968 these images are nearly 0 and the whites are supposed to be infinity. 
5969 The graphics card and most video codecs store colors in a linear scale
5970 but Cinelerra keeps raw camera images in their original logarithmic
5971 scale when it renders them.  This is necessary because the raw image
5972 parser can't always decode the proper gamma values for the images.  It
5973 also does its processing in 16 bit integers, which takes away a lot of
5974 information.
5976 The linearize effect converts the logarithmic colors to linear colors
5977 through a gamma value and a maximum value.  The gamma value determines
5978 how steep the output curve is and the maximum value is where 1.0 in the
5979 output corresponds to maximum brightness in the input.
5981 The linearize effect has 2 more parameters to simplify gamma
5982 correction.  The @b{automatic} option causes it to calculate @b{max}
5983 from the histogram of the image.  Use this when making a preview of a
5984 long list of images since it changes for every image.
5986 The @b{use color picker} option uses the value currently in the color
5987 picker to set the @b{max} value.  Note that every time you pick a color
5988 from the compositor window, you need to hit @b{use color picker} to
5989 apply the new value.
5998 @node LOOP
5999 @section LOOP
6001 Sections of audio or video can be looped by dropping a @b{loop} effect
6002 on them.  Contrary to the the @b{settings->loop playback} option, the
6003 loop effects can be rendered where the @b{settings->loop playback}
6004 option can not be.  The loop effects are also convenient for short
6005 regions.
6007 The loop effects have one option: the number of @b{frames} or
6008 @b{samples} to loop.  This specifies the length of the region to loop
6009 starting from either the beginning of the effect or the latest
6010 keyframe.  The region is replicated for the entire effect.
6012 Every time a keyframe is set in a loop effect, the keyframe becomes the
6013 beginning of the region to loop.  Setting several keyframes in
6014 succession causes several regions to loop.  Setting a single keyframe
6015 causes the region after the keyframe to be looped throughout the
6016 effect, no matter where the keyframe is.  The end of an effect can be
6017 looped from the beginning by setting the keyframe near the end.
6028 @node MOTION
6029 @section MOTION
6031 The motion tracker is almost a complete application in itself.  The
6032 motion tracker tracks two types of motion: translation and rotation. 
6033 It can track both simultaneously or one only.  It can do 1/4 pixel
6034 tracking or single pixel tracking.  It can stabilize motion or cause
6035 one track to follow the motion of another track.
6037 Although the motion tracker is applied as a realtime effect, it usually
6038 must be rendered to see useful results.  The effect takes a long time
6039 to precisely detect motion.
6041 The motion tracker works by using one region of the frame as the region
6042 to track.  It compares this region between 2 frames to calculate the
6043 motion.  This region can be defined anywhere on the screen.  Once the
6044 motion between 2 frames has been calculated, a number of things can be
6045 done with that motion vector.  It can be scaled by a user value and
6046 clamped to a maximum range.  It can be thrown away or accumulated with
6047 all the motion vectors leading up to the current position.
6049 To save time the motion result can be saved for later reuse, recalled
6050 from a previous calculation, or discarded.
6052 The motion tracker has a notion of 2 tracks, the master layer and the
6053 target layer.  The master layer is where the comparison between 2
6054 frames takes place.  The target layer is where motion is applied either
6055 to track or compensate for the motion in the master layer.
6057 The intricacies of motion tracking are enough to sustain entire
6058 companies and build careers around.  The motion tracker in Cinelerra
6059 isn't as sophisticated as some world class motion trackers but it's
6060 enough to sweeten some camcorder footage.
6062 Here is a brief description of the motion tracking parameters:
6064 @itemize
6065 @item
6066 @b{Track translation:} Enables translation operations.  
6067 The motion tracker tracks X and Y motion in the master layer and 
6068 adjusts X and Y motion in the target layer.
6070 @item
6072 @b{Translation block size:} For the translation operations, a block is
6073 compared to a number of neighboring blocks to find the one with the
6074 least difference.  The size of the block to search for is given by this
6075 parameter.
6077 @item
6079 @b{Translation search radius:} The size of the area to scan for the
6080 translation block.
6082 @item
6084 @b{Translation search steps:} Ideally the search operation would
6085 compare the  translation block with every other pixel in the
6086 translation search radius.  To  speed this operation up, a subset of
6087 the total positions is searched.   Then the search area is narrowed and
6088 rescanned by the same number of search steps until the motion is known
6089 to 1/4 pixel accuracy.
6091 @item
6093 @b{Block X, Y:} These coordinates determine the center of the
6094 translation  block based on percentages of the width and height of the
6095 image.  The center of the block should be part of the image which is
6096 visible at all times.
6098 @item 
6100 @b{Maximum absolute offset:} The amount of motion detected by the
6101 motion  tracker is unlimited if this is 100.  If it's under 100 the
6102 amount of motion is limited by that percentage of the image size.
6104 @item
6106 @b{Settling speed:} The motion detected between every frame can be
6107 accumulated to form an absolute motion vector.  If the settling speed
6108 is 100 the absolute vector is added to the next frame.  If the settling
6109 speed is less than 100 the absolute vector is downscaled by the
6110 settling amount before being added to the next frame.
6112 @item
6114 @b{Track rotation:} Enables rotation operations.  The motion tracker
6115 tracks rotation in the master layer and adjusts rotation in the target
6116 layer.
6118 @item
6120 @b{Rotation block size:} For rotation operations a single block is
6121 compared to equally sized blocks, each rotated by a different amount. 
6122 This is the size of the rotation block.
6124 @item
6126 @b{Rotation search radius:} This is the maximum angle of rotation from
6127 the starting frame the rotation scanner can detect.  The rotation scan
6128 is from this angle counterclockwise to this angle clockwise.  Thus the
6129 rotation search radius is half the total range scanned.
6131 @item
6133 @b{Rotation search steps:} Ideally every possible angle would be tested
6134 to get the rotation.  To speed up the rotation search, the rotation
6135 search radius is divided into a finite number of angles and only those
6136 angles compared to the starting frame.  Then the search radius is
6137 narrowed and an equal number of angles is compared in the smaller
6138 radius until the highest possible accuracy is achieved.
6140 Normally you need one search step for every degree scanned.  Since the
6141 rotation scanner scans the rotation search radius in two directions,
6142 you need two steps for every degree in the search radius to search the
6143 complete range.
6145 @item
6147 @b{Draw vectors:} When translation is enabled, 2 boxes are drawn on the
6148 frame.  One box represents the translation block.  Another box outside
6149 the translation block represents the extent of the translation search
6150 radius.  In the center of these boxes is an arrow showing the
6151 translation between the 2 master frames.
6153 When rotation is enabled a single box the size of the rotation block is
6154 drawn rotated by the amount of rotation detected.
6156 @item
6158 @b{Track single frame:} When this option is used the motion between a
6159 single starting frame and the frame currently under the insertion point
6160 is calculated.  The starting frame is specified in the @b{Frame number}
6161 blank.  The motion calculated this way is taken as the absolute motion
6162 vector.  The absolute motion vector for each frame replaces the
6163 absolute motion vector for the previous frame.  Settling speed has no
6164 effect on it since it doesn't contain any previous motion vectors. 
6165 Playback can start anywhere on the timeline since there is no
6166 dependance on previous results.
6168 @item
6170 @b{Track previous frame:} Causes only the motion between the previous
6171 frame and the current frame to be calculated.  This is added to an
6172 absolute motion vector to get the new motion from the start of the
6173 sequence to the current position.  After every frame processed this
6174 way, the block position is shifted to always cover the same region of
6175 the image.  Playback must be started from the start of the motion
6176 effect in order to accumulate all the necessary motion vectors.
6178 @item
6180 @b{Previous frame same block:} This is useful for stabilizing jerky
6181 camcorder footage.  In this mode the motion between the previous frame
6182 and the current frame is calculated.  Instead of adjusting the block
6183 position to reflect the new location of the image, like Track Previous
6184 Frame does, the block position is unchanged between each frame.  Thus a
6185 new region is compared for each frame.
6187 @item
6189 @b{Master layer:} This determines the track which supplies the starting
6190 frame and ending frame for the motion calculation.  If it's @b{Bottom}
6191 the bottom track of all the tracks sharing this effect is the master
6192 layer.  The top track of all the tracks is the target layer.
6194 @item
6196 @b{Calculation:} This determines whether to calculate the motion at all
6197 and whether to save it to disk.  If it's @b{Don't Calculate} the motion
6198 calculation is skipped.  If it's @b{Recalculate} the motion calculation
6199 is performed every time each frame is rendered.  If it's @b{Save} the
6200 motion calculation is always performed but a copy is also saved.  If
6201 it's @b{Load}, the motion calculation is loaded from a previous save
6202 calculation.  If there is no previous save calculation on disk, a new
6203 motion calculation is performed.
6205 @item
6207 @b{Action:} Once the motion vector is known this determines whether to
6208 move the target layer opposing the motion vector or following the
6209 motion vector.  If it's @b{Do Nothing} the target layer is untouched. 
6210 If it's @b{Track...} the target layer is moved by the same amount as
6211 the master layer.  This is useful for matching titles to objects in the
6212 frame.  If it's @b{Stabilize...} the target layer is moved opposite to
6213 the motion vector.  This is useful for stabilizing an object in the
6214 frame.  The motion operations can be accurate to single pixels or
6215 subpixels by changing the action setting.
6221 @end itemize
6225 @menu
6226 * SECRETS OF MOTION TRACKING::
6227 * 2 PASS MOTION TRACKING::
6228 * USING BLUR TO IMPROVE MOTION TRACKING::
6229 * USING HISTOGRAM TO IMPROVE MOTION TRACKING::
6230 @end menu
6233 @node SECRETS OF MOTION TRACKING
6234 @subsection SECRETS OF MOTION TRACKING
6236 Since it is a very slow effect, there is a method to applying the
6237 motion tracker to get the most out of it.  First disable playback for
6238 the track to do motion tracking on.  Then drop the effect on a region
6239 of video with some motion to track.  Then rewind the insertion point to
6240 the start of the region.  Set @b{Action} -> @b{Do Nothing}.  Set
6241 @b{Calculation} -> @b{Don't calculate}.  Enable @b{Draw vectors}. Then
6242 enable playback of the track to see the motion tracking areas.
6244 Enable which of @b{translation motion} or @b{rotation motion} vectors
6245 you want to track.  By watching the compositor window and adjusting the
6246 @b{Block x,y} settings, center the block on the part of the image you
6247 want to track.  Then set search radius, block size, and block
6248 coordinates for translation and rotation.
6250 Once this is configured, set the calculation to @b{Save coords} and do
6251 test runs through the sequence to see if the motion tracker works and
6252 to save the motion vectors.  Once this is done, disable playback for
6253 the track, disable @b{Draw vectors}, set the motion action to perform
6254 on the target layer and change the calculation to @b{Load coords}. 
6255 Finally enable playback for the track.
6257 When using a single starting frame to calculate the motion of a
6258 sequence, the starting frame should be a single frame with the least
6259 motion to any of the other frames.  This is rarely frame 0.  Usually
6260 it's a frame near the middle of the sequence.  This way the search
6261 radius need only reach halfway to the full extent of the motion in the
6262 sequence.
6264 If the motion tracker is used on a render farm, @b{Save coords} and
6265 @b{previous frame} mode won't work.  The results of the save coords
6266 operation are saved to the hard drives on the render nodes, not the
6267 master node.  Future rendering operations on these nodes will process
6268 different frames and read the wrong coordinates from the node
6269 filesystems.  The fact that render nodes only visualize a portion of
6270 the timeline also prevents @b{previous frame} from working since it
6271 depends on calculating an absolute motion vector starting on frame 0.
6273 @node 2 PASS MOTION TRACKING
6274 @subsection 2 PASS MOTION TRACKING
6276 The method described above is 2 pass motion tracking.  One pass is used
6277 just to calculate the motion vectors.  A second pass is used to apply
6278 the motion vectors to the footage.  This is faster than a single pass
6279 because errors in the motion vector calculation can be discovered
6280 quickly.
6282 This also allows the motion tracking to use a less demanding colormodel
6283 like RGB888 in the scanning step and a more demanding colormodel like
6284 RGB Float in the action step.  The scanning step takes much longer than
6285 action.
6287 This suffers the disadvantage of not being practical for extremely long
6288 sequences where some error is acceptable and the picture quality is
6289 lousy to begin with, like stabilizing camcorder footage.
6291 The slower method is to calculate the motion vectors and apply them
6292 simultaneously.  This method can use one track as the motion vector
6293 calculation track and another track as the target track for motion
6294 vector actions.  This is useful for long sequences where some error is
6295 acceptable.
6298 @node USING BLUR TO IMPROVE MOTION TRACKING
6299 @subsection USING BLUR TO IMPROVE MOTION TRACKING
6301 With extremely noisy or interlaced footage, applying a blur effect
6302 before the motion tracking can improve accuracy.  Either save the
6303 motion vectors in a @b{tracking pass} and disable the blur for the
6304 @b{action pass} or apply the blur just to the @b{master layer}.
6307 @node USING HISTOGRAM TO IMPROVE MOTION TRACKING
6308 @subsection USING HISTOGRAM TO IMPROVE MOTION TRACKING
6310 A histogram is almost always applied before motion tracking to clamp
6311 out noise in the darker pixels.  Either save the motion vectors in a
6312 @b{tracking pass} and disable the histogram for the @b{action pass} or
6313 apply the histogram just to the @b{master layer}.
6323 @node REFRAMERT
6324 @section REFRAMERT
6327 ReframeRT changes number of frames in a sequence of video directly from
6328 the timeline.  It has 2 modes, selected by the 2 toggles in the GUI.
6330 @b{Stretch} mode multiplies the current frame number of its output by
6331 the scale factor to arrive at the frame to read from its input.  If its
6332 current output frame is #55 and the scale factor is 2, frame #110 is
6333 read from its input.  The stretch mode has the effect of changing the
6334 length of output video by the inverse of the scale factor.  If the
6335 scale factor is greater than 1, the output will end before the end of
6336 the sequence on the timeline.  If it's less than 1, the output will end
6337 after the end of the sequence on the timeline.  The ReframeRT effect
6338 must be lengthened to the necessary length to accomodate the scale
6339 factor.  Change the length of the effect by clicking on the endpoint of
6340 the effect and dragging.
6342 Although stretch mode changes the number of the frame read from its
6343 input, it doesn't change the frame rate of the input.  Effects before
6344 ReframeRT assume the same frame rate as ReframeRT.
6346 @b{Downsample} mode doesn't change the length of the output sequence. 
6347 It multiplies the frame rate of the output by the scale factor to
6348 arrive at a frame rate rate to read the input.  This has the effect of
6349 replicating the input frames so that they only change at the scaled
6350 frame rate when sent to the output.  It doesn't change the length of
6351 the sequence.  If the scale factor is 0.5 and the output frame rate is
6352 30 fps, only 15 frames will be shown per second and the input will be
6353 read at 15 fps.  Downsample is only useful for scalefactors below 1,
6354 hence the name downsample.
6356 Downsample mode changes the frame rate of the input as well as the
6357 number of the frame to read, so effects before ReframeRT see the frame
6358 rate * the scale factor as their frame rate.  If the scale factor is 2
6359 and the output frame rate is 30, the input frame rate will be 60 and
6360 the input frame number will by doubled.  This won't normally do
6361 anything but some input effects may behave differently at the higher
6362 frame rate.
6367 @node REFRAME
6368 @section REFRAME
6370 This does exactly the same thing as @b{ReframeRT} in @b{Stretch} mode. 
6371 It multiplies the output frame number by the scale factor to arrive at
6372 the input frame number and changes the length of the sequence.  Unlike
6373 ReframeRT, this must run from the @b{Video} menu and render its output.
6375 Be aware @b{Reframe} doesn't write the scaled frame rate as the frame
6376 rate of the rendered file.  It produces a file of scaled length and
6377 equal frame rate as the project.  The new length is 1/scale factor as
6378 big as the original sequence.
6387 @node RESAMPLE
6388 @section RESAMPLE
6390 This multiplies the number of each output sample by a scale factor to
6391 arrive at the number of the input sample.  The output file's sample
6392 rate is set to the project sample rate but its length is changed to
6393 reflect the scaled number of samples.  It also filters the resampled
6394 audio to remove aliasing.
6396 If the scale factor is 2, every 2 input samples will be reduced to 1
6397 output sample and the output file will have half as many samples as the
6398 input sequence.  If it's 0.5, every 0.5 input samples will be stretched
6399 to 1 output sample and the output file will have twice as many samples
6400 as the input sequence.
6411 @node REVERSE VIDEO/AUDIO
6412 @section REVERSE VIDEO/AUDIO
6414 Media can be reversed on the timeline in realtime.  This isn't to be
6415 confused with using the reverse playback on the transport.  The reverse
6416 effects reverse the region covered by the effect regardless of the
6417 transport direction.  Apply @b{reverse audio} to an audio track and
6418 play it backwards.  The sound plays forward.
6420 The region to be reversed is first determined by what part of the track
6421 the effect is under and second by the locations of keyframes in the
6422 effect.  The reverse effects have an @b{enabled} option which allows
6423 you to set keyframes.  This allows may possibilities.
6425 Every @b{enabled} keyframe is treated as the start of a new reversed
6426 region and the end of a previous reversed region.  Several @b{enabled}
6427 keyframes in succession yield several regions reversed independant of
6428 each other.  An @b{enabled} keyframe followed by a @b{disabled}
6429 keyframe yields one reversed region followed by a forward region.
6431 Finally, be aware when reversing audio that the waveform on the
6432 timeline doesn't reflect the actual reversed output.
6440 @node THRESHOLD
6441 @section THRESHOLD
6443 Threshold converts the image to pure luminance.  Then luminance values
6444 below and above the threshold range are converted to black and
6445 luminance values inside the threshold range are converted to white. 
6446 The threshold window shows a histogram of luminance values for the
6447 current frame.  Click dragging inside the histogram creates a range to
6448 convert to white.  Shift-clicking extends one border of this range. 
6449 Values for the threshold range can also be specified in the text boxes.
6451 This effect is basically a primitive luminance key.  A second track
6452 above the track with the threshold effect can be multiplied, resulting
6453 in only the parts of the second track within the threshold being
6454 displayed.
6462 @node TIME AVERAGE
6463 @section TIME AVERAGE
6465 Time average is one effect which has many uses besides creating nifty
6466 trail patterns of moving objects.  It's main use is reducing noise in
6467 still images.  Merely point a video camera at a stationary subject for
6468 30 frames, capture the frames, and average them using TIME AVERAGE and
6469 you'll have a super high quality print.  In floating point colormodels, time
6470 average can increase the dynamic range of lousy cameras.
6472 Inside the time average effect is an accumulation buffer and a
6473 divisor.  A number of frames are accumulated in the accumulation buffer
6474 and divided by the divisor to get the average.
6476 Because the time average can consume enourmous amounts of memory, it is
6477 best applied by first disabling playback for the track, dropping the
6478 time average in it, configuring time average for the desired number of
6479 frames, and re-enabling playback for the track.
6481 @b{Frames to average:} This determines the number of frames to be
6482 accumulated in the accumulation buffer.  For extremely large
6483 integrations it's easier to edit the EDL in a text editor and put in
6484 the number of frames.
6486 @b{Accumulate:} This outputs the accumulation buffer without dividing it.
6488 @b{Average:} This causes the accumulation buffer to be divided before
6489 being output.  This results in the average of all the frames.
6491 @b{Inclusive Or:} This causes the accumulation buffer to be replaced by
6492 any pixels which aren't transparent.  In combination with motion
6493 tracking it allows entire sequences to be combined to form panoramas.
6495 @b{Reprocess frame again:} If an effect before the time average is
6496 adjusted the time average normally doesn't reread the accumulation
6497 buffer to get the change.  This forces it to reread the accumulation
6498 buffer when other effects change.
6500 @b{Disable subtraction:} In order to represent the accumulation of only
6501 the specified number of frames, the time average retains all the
6502 previous frames in memory and subtracts them out as it plays forward. 
6503 It would run out of memory if it had to accumulate thousands of
6504 frames.  By disabling subtraction the previous frames are not stored in
6505 memory and only the average function is affected by the frame count.
6514 @node TITLER
6515 @section TITLER
6517 While it is possible to add text to movies by importing still images
6518 from The Gimp and compositing them, the Titler allows you to add text
6519 from within Cinelerra.  
6521 The titler has standard options for @b{font, size, and style}.  The
6522 best font is a generic, normal font like Arial in a large size.
6524 The titler also has options you'll only find in moving pictures.  The
6525 @b{Justify} operation justifies the text relative to the entire frame. 
6526 Once justified, the @b{X and Y} offset is applied.  This allows text to
6527 be justified while at the same time letting you push it within the
6528 title safe region.
6530 The @b{motion type} scrolls the text in any of the four directions. 
6531 When using this, the text may dissappear.  Move the insertion point
6532 along the timeline until the text is far enough along the animation to
6533 reappear.  The text scrolls on and scrolls off.
6535 Setting @b{loop} causes the text to scroll completely off and repeat. 
6536 Without @b{loop} the text scrolls off and never reappears.
6538 The speed of the animation is determined by @b{speed}  Set it higher to
6539 speed up the animation.
6541 @b{Drop shadow} draws a black copy of the text to the bottom right of
6542 the original text.  Useful when drawing text over changing video to
6543 keep the border always visible.
6545 In addition to the scrolling, @b{Fade in/Fade out} are a second type of
6546 animation.  If the fade seconds are 0, no fading is done.
6548 @b{Color} picks the color to draw the text in.  Usually white is the
6549 only practical color.
6551 @b{Stamp timecode} replaces the text with the current position on the
6552 timeline in seconds and frames.
6554 @menu
6555 * ADDING FONTS TO THE TITLER:: How to add fonts to the titler
6556 * THE TITLE-SAFE REGION::      How to keep text visible on output
6557 @end menu
6559 @node ADDING FONTS TO THE TITLER
6560 @subsection ADDING FONTS TO THE TITLER
6562 The X Window system originally didn't have a suitable font renderer for
6563 video.  It also is restricted to the current bit depth.  It doesn't
6564 have a convenient way to know which fonts work with the suitable font
6565 renderer in the desired bit depth.  The easiest way we've found to
6566 support fonts in the titler is to have a directory for them at
6567 @b{/usr/lib/cinelerra/fonts}.
6569 The titler supports mainly @b{TTF}, true type fonts.  It supports
6570 others but TTF are the most reliable.  To add true type fonts, copy the
6571 @b{.TTF} files to the @b{/usr/lib/cinelerra/fonts} directory.  In that
6572 directory run @b{ttmkfdir > fonts.dir} and restart Cinelerra.  The new
6573 fonts should appear.
6576 @node THE TITLE-SAFE REGION
6577 @subsection THE TITLE-SAFE REGION
6579 If the video is displayed on a consumer TV, the outer border is going
6580 to be cropped by 5% on each side.  Moreover, text which is too close to
6581 the edge looks sloppy.  Make sure when adding titles to have the
6582 @b{title-safe} @image{titlesafe} tool active in the @b{compositor} window.
6583 The text shouldn't cross the inner rectangle.
6593 @node VIDEO SCOPE
6594 @section VIDEO SCOPE
6596 The video scope plots two views of the image.  One view plots the
6597 intensity of each pixel against horizontal position.  They call this
6598 the WAVEFORM.  Another view translates hue to angle and saturation to
6599 radius for each pixel.  They call this the VECTORSCOPE.
6601 The vectorscope is actually very useful for determining if an image is
6602 saturated.  When adjusting saturation, it's important to watch the
6603 vectorscope to make sure pixels don't extend past the 100 radius.
6605 The waveform allows you to make sure image data extends from complete
6606 black to complete white while adjusting the brightness/contrast.
6608 Some thought is being given to having a video scope for recording. 
6609 Unfortunately, this would require a lot of variations of the video
6610 scope for all the different video drivers.
6616 @node PLUGIN AUTHORING
6617 @chapter PLUGIN AUTHORING
6619 The plugin API in Cinelerra dates back to 1997, before the LADSPA and
6620 before VST became popular.  It's fundamentally the same as it was in
6621 1997, with minor modifications to handle keyframes and GUI feedback. 
6622 Unfortunately, the GUI is not abstracted from the programmer.  This
6623 allows the programmer to use whatever toolkit they want and allows more
6624 flexibility in appearance but it costs more.
6626 There are several types of plugins, each with a common procedure of
6627 implementation and specific changes for that particular type.  The
6628 easiest way to implement a plugin is to take the simplest existing one
6629 out of the group and rename the symbols.  
6633 @menu
6634 * INTRODUCING THE PULL METHOD:: The current paradigm for plugin writing
6635 * COMMON PLUGIN FUNCTIONS:: What all effects have to do.
6636 * REALTIME PLUGINS:: What realtime effects have to do.
6637 * NONREALTIME PLUGINS:: What rendered effects have to do.
6638 * AUDIO PLUGINS:: What audio effects have to do.
6639 * VIDEO PLUGINS:: What video effects have to do.
6640 * TRANSITION PLUGINS:: What transitions have to do.
6641 * PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK:: How to use currently playing data to draw the GUI.
6642 * PLUGIN QUERIES:: How plugins get information about the data to be processed.
6643 @end menu
6648 @node INTRODUCING THE PULL METHOD
6649 @section INTRODUCING THE PULL METHOD
6651 The simplest way to design plugins is with the push method.  The push
6652 method is intuitive.  A source pushes data to a plugin, the plugin does
6653 math operations on it, and the plugin pushes it to a destination.  For
6654 6 years this was the way all realtime plugins were driven internally
6655 but it didn't allow you to reduce the rate of data in realtime.  While
6656 plugins can still be written as if they're being pushed data, this is
6657 not the way they're processed internally anymore.
6659 The latest evolution in Cinelerra's plugin design is the pull method. 
6660 The rendering pipeline starts at the end and the final steps in the
6661 rendering pipeline request data from the steps before them.  When the
6662 rendering pipleline eventually requests data from a plugin chain, each
6663 plugin requests data from the plugin before it.
6665 This is less intuitive than the push method but is much more powerful. 
6666 Realtime plugins written using the pull method can change the rate data
6667 is presented to the viewer and the direction of playback.  The pull
6668 method allows plugins to take in data at a higher rate than they send
6669 it out.
6671 To get the power of rate independance, the pull method requires plugins
6672 to know more about the data than they needed to under the push method. 
6673 Plugins need to know what rate the project is at and what rate their
6674 individual requested output is at.  These two data rates have to be
6675 interchanged for a plugin to configure itself properly.
6677 Keyframes for a plugin are stored relative to the project frame rate. 
6678 Queries for the current playback position are given relative to the
6679 project frame rate.  This is useless if the plugin was requested data
6680 at twice the project frame rate since the keyframes wouldn't match up
6681 to the right data positions.  Two classes of data rates were created to
6682 handle this problem.
6684 Rate conversions are done in terms of the @b{project rate} and the
6685 @b{requested rate}.  The project rate is identical for all plugins.  It
6686 is determined by the @b{settings->format} window.  The requested rate
6687 is determined by the downstream plugin requesting data from the current
6688 plugin.  It is arbitrary.  Exactly how to use these rates is described
6689 below.
6693 @node COMMON PLUGIN FUNCTIONS
6694 @section COMMON PLUGIN FUNCTIONS
6696 All plugins inherit from a derivative of PluginClient.  This
6697 PluginClient derivative implements most of the required methods in
6698 PluginClient, but users must still define methods for PluginClient. 
6699 The most commonly used methods are predefined in macros to reduce the
6700 typing yet still allow flexibility.
6702 The files they include depend on the plugin type.  Audio plugins
6703 include @b{pluginaclient.h} and video plugins include
6704 @b{pluginvclient.h}.  They inherit @b{PluginAClient} and
6705 @b{PluginVClient} respectively.
6707 Cinelerra instantiates all plugins at least twice when they are used in
6708 a movie.  Once instance is the GUI.  The other instance is the signal
6709 processor.  User input, through a complicated sequence, is propogated
6710 from the GUI instance to the signal processor instance.  If the signal
6711 processor wants to alter the GUI, it propogates data back to the GUI
6712 instance.  There are utility functions for doing all this.
6714 All plugins define at least three objects:
6716 @itemize
6718 @item
6720 @b{Processing object} - Contains pointers to all the other objects and
6721 performs the signal processing.  This object contains a number of
6722 queries to identify itself and is the object you register to register
6723 the plugin.
6726 @item
6728 @b{User interface object} - This is defined according to the programmer's
6729 discretion.  It can either use Cinelerra's toolkit or another toolkit. 
6730 It shows data on the screen and collects parameters from the user.
6732 Using Cinelerra's toolkit, the only user interface object a developer
6733 needs to worry about is the Window.  The window has pointers to a
6734 number of widgets, a few initialization methods, and a back pointer to
6735 the plugin's processing object.  The documentation refers to the usage
6736 of Cinelerra's toolkit.
6738 Depending on the user interface toolkit, a user interface thread may be
6739 created to run the user interface asynchronous of everything else. 
6740 Synchronizing the user interface to changes in the plugin's
6741 configuration is the most complicated aspect of the plugin, so the user
6742 interface thread and object are heavily supported by macros if you use
6743 Cinelerra's toolkit.
6746 @item
6748 @b{Configuration object} - This stores the user parameters and always
6749 needs interpolation, copying, and comparison functions.  Macros for the
6750 plugin client automatically call configuration methods to interpolate
6751 keyframes.
6753 @end itemize
6755 @menu
6756 * THE PROCESSING OBJECT::
6757 * THE CONFIGURATION OBJECT::
6758 * THE USER INTERFACE OBJECT::
6759 @end menu
6763 @node THE PROCESSING OBJECT
6764 @subsection THE PROCESSING OBJECT
6766 Load up a simple plugin like gain to see what this object looks like.
6767 The processing object should inherit from the intended PluginClient
6768 derivative.  Its constructor should take a PluginServer argument.
6770 @example
6771 MyPlugin(PluginServer *server);
6772 @end example
6774 In the implementation, the plugin must contain a registration line with
6775 the name of the processing object like
6777 @example
6778 REGISTER_PLUGIN(MyPlugin)
6779 @end example
6782 The constructor should contain 
6784 @example
6785 PLUGIN_CONSTRUCTOR_MACRO
6786 @end example
6788 to initialize the most common variables.
6791 The processing object should have a destructor containing
6793 @example
6794 PLUGIN_DESTRUCTOR_MACRO
6795 @end example
6797 to delete the most common variables.
6799 Another function which is useful but not mandatory is
6801 @example
6802 int is_multichannel();
6803 @end example
6805 It should return 1 if one instance of the plugin handles multiple
6806 tracks simultaneously or 0 if one instance of the plugin only handles
6807 one track.  The default is 0 if it is omitted.
6809 Multichannel plugins in their processing function should refer to a
6810 function called @b{PluginClient::get_total_buffers()} to determine the
6811 number of channels.
6816 To simplify the implementation of realtime plugins, a macro for
6817 commonly used members has been created for the class header, taking the
6818 configuration object and user interface thread object as arguments. 
6819 The macro definitions apply mainly to realtime plugins and are not
6820 useful in nonrealtime plugins.  Fortunately, nonrealtime plugins are
6821 simpler.
6823 @example
6824 PLUGIN_CLASS_MEMBERS(config_name, thread_name)
6825 @end example
6827 The commonly used members in PLUGIN_CLASS_MEMBERS are described below.
6829 @itemize
6831 @item
6832 int load_configuration();
6834 Loads the configuration based on surrounding keyframes and current
6835 position.  The class definition for load_configuration should contain 
6837 @example
6838 LOAD_CONFIGURATION_MACRO(plugin_class, config_class)
6839 @end example
6841 to implement the default behavior for load_configuration.  This stores
6842 whatever the current configuration is inside the plugin's configuration
6843 object and returns 1 if the new configuration differs from the previous
6844 configuration.  The return value of load_configuration is used by
6845 another commonly used function, update_gui to determine if the GUI really needs to be updated.
6847 The plugin's configuration object is always called @b{config} inside
6848 PLUGIN_CLASS_MEMBERS.
6850 @item
6851 VFrame* new_picon();
6853 Creates a picon for display in the resource window.  Use
6855 @example
6856 #include "picon_png.h"
6857 NEW_PICON_MACRO(plugin_class)
6858 @end example
6860 to implement new_picon.  In addition, the user should create a
6861 @b{picon_png.h} header file from a PNG image using @b{pngtoh}. 
6862 @b{pngtoh} is compiled in the @b{guicast/ARCH} directory.
6864 The source PNG image should be called picon.png and can be any format
6865 supported by PNG.
6867 @item
6868 char* plugin_title();
6870 Returns a text string identifying the plugin in the resource window. 
6871 The string has to be unique.
6874 @item
6875 void update_gui(); 
6877 Should first load the configuration, test for a return of 1, and then
6878 redraw the GUI with the new parameters.  All the plugins using GuiCast
6879 have a format like
6881 @example
6882 void MyPlugin::update_gui()
6884         if(thread)
6885         @{
6886                 if(load_configuration())
6887                 @{
6888                         thread->window->lock_window();
6889 // update widgets here
6890                         thread->window->unlock_window();
6891                 @}
6892         @}
6894 @end example
6896 to handle concurrency and conditions of no GUI.
6898 @item
6899 int show_gui();
6901 Instantiate the GUI and switch the plugin to GUI mode.  This is implemented with
6903 @example
6904 SHOW_GUI_MACRO(plugin_class, thread_class)
6905 @end example
6907 @item
6908 int set_string();
6910 Changes the title of the GUI window to a certain string.  This is implemented with
6912 @example
6913 SET_STRING_MACRO(plugin_class)
6914 @end example
6917 @item
6918 void raise_window();
6920 Raises the GUI window to the top of the stack.  This is implemented with
6922 @example
6923 RAISE_WINDOW_MACRO(plugin_class)
6924 @end example
6928 @end itemize
6931 Iimportant functions the processing object must define are the
6932 functions which load and save configuration data from keyframes.  These
6933 functions are called by the macros so all you need to worry about is
6934 accessing the keyframe data.
6936 @example
6937 void save_data(KeyFrame *keyframe);
6938 void read_data(KeyFrame *keyframe);
6939 @end example
6941 The read data functions are only used in realtime plugins.  The read
6942 data functions translate the plugin configuration between the KeyFrame
6943 argument and the configuration object for the plugin.  The keyframes
6944 are stored on the timeline and can change for every project.
6946 Use an object called @b{FileXML} to do the translation and some
6947 specific commands to get the data out of the KeyFrame argument.  See
6948 any existing plugin to see the usage of KeyFrame and FileXML.
6951 @example
6952 int load_defaults();
6953 int save_defaults();
6954 @end example
6956 The load defaults functions are used in realtime and non-realtime
6957 plugins.  The load defaults functions translate the plugin
6958 configuration between a Defaults object and the plugin's
6959 configuration.  The Defaults object stores configurations in a discrete
6960 file on disk for each plugin but doesn't isolate different
6961 configurations for different projects.
6963 The function overriding @b{load_defaults} also needs to create the
6964 Defaults object.  See any existing plugin to see the usage of
6965 Defaults.
6967 Other standard members may be defined in the processing object,
6968 depending on the plugin type.
6973 @node THE CONFIGURATION OBJECT
6974 @subsection THE CONFIGURATION OBJECT
6976 The configuration object is critical for GUI updates, signal
6977 processing, and default settings in realtime plugins.  Be aware it is
6978 not used in nonrealtime plugins.  The configuration object inherits
6979 from nothing and has no dependancies.  It's merely a class containing
6980 three functions and variables specific to the plugin's parameters.
6982 Usually the configuration object starts with the name of the plugin
6983 followed by Config.
6985 @example
6986 class MyPluginConfig
6988 public:
6989         MyPluginConfig();
6990 @end example
6993 Following the name of the configuration class, we put in three
6994 required functions and the configuration variables.
6996 @example
6997         int equivalent(MyPluginConfig &that);
6998         void copy_from(MyPluginConfig &that);
6999         void interpolate(MyPluginConfig &prev, 
7000                 MyPluginConfig &next, 
7001                 int64_t prev_position, 
7002                 int64_t next_position, 
7003                 int64_t current_position);
7007         float parameter1;
7008         float parameter2;
7009         int parameter3;
7012 @end example
7015 Now you must define the three functions.  @b{Equivalent} is called by
7016 LOAD_CONFIGURATION_MACRO to get the return value.  If equivalent
7017 returns 0, the load configuration function causes the GUI to redraw. 
7018 If equivalent returns 1, the GUI doesn't redraw.
7020 Then there's @b{copy_from} which transfers the configuration values
7021 from the argument to the local variables.  This is once again used in
7022 LOAD_CONFIGURATION_MACRO to store configurations in temporaries.  Once 
7023 LOAD_CONFIGURATION_MACRO has replicated the configuration, it loads a
7024 second configuration.  Then it interpolates the two configurations to
7025 get the current configuration.  The interpolation function performs the
7026 interpolation and stores the result in the local variables.
7028 Normally the interpolate function calculates a previous and next
7029 fraction, using the arguments.
7031 @example
7032 void MyPluginConfig::interpolate(MyPluginConfig &prev, 
7033                 MyPluginConfig &next, 
7034                 int64_t prev_position, 
7035                 int64_t next_position, 
7036                 int64_t current_position)
7038         double next_scale = (double)(current_position - prev_position) / (next_position - prev_position);
7039         double prev_scale = (double)(next_position - current_position) / (next_position - prev_position);
7040 @end example
7042 Then the scales are applied to the previous and next configuration
7043 object to yield the current values.
7045 @example
7047         this->parameter1 = (float)(prev.parameter1 * prev_scale + next.parameter1 * next_scale);
7048         this->parameter2 = (float)(prev.parameter2 * prev_scale + next.parameter2 * next_scale);
7049         this->parameter3 = (int)(prev.parameter3 * prev_scale + next.parameter3 * next_scale);
7052 @end example
7054 Alternatively you can copy the values from the previous configuration
7055 argument for no interpolation.
7057 This usage is the same in audio and video plugins.  In video playback,
7058 the interpolation function is called for every frame, yielding smooth
7059 interpolation.  In audio playback, the interpolation function is called
7060 only once for every console fragment and once every time the insertion
7061 point moves.  This is good enough for updating the GUI while selecting
7062 regions on the timeline but it may not be accurate enough for really
7063 smooth rendering of the effect.
7065 For really smooth rendering of audio, you can still use
7066 load_configuration when updating the GUI.  For process_realtime;
7067 however, ignore load_configuration and write your own interpolation
7068 routine which loads all the keyframes in a console fragment and
7069 interpolates every sample.  This would be really slow and hard to
7070 debug, yielding improvement which may not be audible.  Then of course,
7071 every century has its set of wierdos.
7073 An easier way to get smoother interpolation is to reduce the console
7074 fragment to 1 sample.  This would have to be rendered and played back
7075 in a separate program of course.  The Linux sound driver can't play
7076 fragments of 1 sample.
7085 @node THE USER INTERFACE OBJECT
7086 @subsection THE USER INTERFACE OBJECT
7089 The user interface object at the very least consists of a pointer to a
7090 window and pointers to all the widgets in the window.  Using
7091 Cinelerra's toolkit, it consists of a @b{BCWindow} derivative and a
7092 @b{Thread} derivative.  The Thread derivative is declared in the plugin
7093 header using
7095 @example
7096 PLUGIN_THREAD_HEADER(plugin_class, thread_class, window_class)
7097 @end example
7099 Then it is defined using
7101 @example
7102 PLUGIN_THREAD_OBJECT(plugin_class, thread_class, window_class)
7103 @end example
7105 This, in combination with the SHOW_GUI macro does all the work in
7106 instantiating the Window.  This two class system is used in realtime
7107 plugins but not in nonrealtime plugins.  Nonrealtime plugins create and
7108 destroy their GUI in their @b{get_parameters} function and there's no
7109 need for a Thread.
7111 Now the window class must be declared in the plugin header.  It's
7112 easiest to implement the window by copying an existing plugin and
7113 renaming the symbols.  The following is an outline of what happens. 
7114 The plugin header must declare the window's constructor using the
7115 appropriate arguments.
7117 @example
7119 #include "guicast.h"
7121 class MyPluginWindow : public BC_Window
7123 public:
7124         MyPluginWindow(MyPluginMain *plugin, int x, int y);
7126 @end example
7128 This becomes a window on the screen, positioned at x and y.
7130 It needs two methods
7132 @example
7133         int create_objects();
7134         int close_event();
7135 @end example
7137 and a back pointer to the plugin
7139 @example
7140         MyPlugin *plugin;
7141 @end example
7144 The constructor's definition should contain extents and flags causing
7145 the window to be hidden when first created.  The create_objects member
7146 puts widgets in the window according to GuiCast's syntax.  A pointer to
7147 each widget which you want to synchronize to a configuration parameter
7148 is stored in the window class.  These are updated in the @b{update_gui}
7149 function you earlier defined for the plugin.  The widgets are usually
7150 derivatives of a GuiCast widget and they override functions in GuiCast
7151 to handle events.  Finally create_objects calls 
7153 @example
7154         show_window();
7155         flush();
7156 @end example
7158 to make the window appear all at once.
7160 The close_event member should be implemented using
7162 @example
7163 WINDOW_CLOSE_EVENT(window_class)
7164 @end example
7166 Every widget in the GUI needs to detect when its value changes.  In
7167 GuiCast the @b{handle_event} method is called whenever the value
7168 changes.  In @b{handle_event}, the widget then needs to call
7169 @b{plugin->send_configure_change()} to propogate the change to any
7170 copies of the plugin which are processing data.
7180 @node REALTIME PLUGINS
7181 @section REALTIME PLUGINS
7183 Realtime plugins should use PLUGIN_CLASS_MEMBERS to define the basic
7184 set of members in their headers.  All realtime plugins must define an
7186 @example
7187 int is_realtime()
7188 @end example
7190 member returning 1.  This causes a number of methods to be called
7191 during live playback and the plugin to be usable on the timeline.
7193 Realtime plugins must override a member called
7195 @example
7196 process_buffer 
7197 @end example
7199 This function takes different arguments depending on if the plugin
7200 handles video or audio.  See an existing plugin to find out which usage
7201 applies.
7203 The main features of the process_buffer function are a buffer to store
7204 the output, the starting position of the output, and the requested
7205 output rate.  For audio, there's also a size argument for the number of
7206 samples.
7208 The starting position of the output buffer is the lowest numbered
7209 sample on the timeline if playback is forward and the highest numbered
7210 sample on the timeline if playback is reverse.  The direction of
7211 playback is determined by one of the plugin queries described below.
7213 The position and size arguments are all relative to the frame rate and
7214 sample rate passed to process_buffer.  This is the requested data rate
7215 and may not be the same as the project data rate.
7217 The process_realtime function should start by calling
7218 @b{load_configuration}.  The LOAD_CONFIGURATION_MACRO returns 1 if the
7219 configuration changed.
7221 After determining the plugin's configuration, input media has to be
7222 loaded for processing.  Call
7224 @example
7225 read_frame(VFrame *buffer, 
7226                 int channel, 
7227                 int64_t start_position,
7228                 double frame_rate)
7229 @end example
7233 @example
7234 read_samples(double *buffer,
7235                 int channel,
7236                 int sample_rate,
7237                 int64_t start_position,
7238                 int64_t len)
7239 @end example
7241 to request input data from the object which comes before this plugin. 
7242 The read function needs a buffer to store the input data in.  This can
7243 either be a temporary you create in the plugin or the output buffer
7244 supplied to process_buffer if you don't need a temporary.
7246 It also needs a set of position arguments to determine when you want to
7247 read the data from.  The start position, rate, and len passed to a read
7248 function need not be the same as the values recieved by the
7249 process_buffer function.  This way plugins can read data at a different
7250 rate than they output data.
7252 The channel argument is only meaningful if this is a multichannel
7253 plugin.  They need to read data for each track in the
7254 get_total_buffers() value and process all the tracks.  Single channel
7255 plugins should pass 0 for channel.
7258 Additional members are implemented to maintain configuration in
7259 realtime plugins.  Some of these are also needed in nonrealtime
7260 plugins.
7262 @itemize
7263 @item
7264 void read_data(KeyFrame *keyframe);
7266 Loads data from a keyframe into the plugin's configuration.  Inside the
7267 keyframe is an XML string.  It's most easily parsed by creating a
7268 @b{FileXML} object.  See an existing plugin to see how the read_data
7269 function is implemented.
7271 Read data loads data out of the XML object and stores values in the
7272 plugin's configuration object.  Since configuration objects vary from
7273 plugin to plugin, these functions can't be automated.
7275 @item
7276 void save_data(KeyFrame *keyframe);
7278 Saves data from the plugin's configuration to a keyframe.  Inside the
7279 keyframe you'll put an XML string which is normally created by a
7280 FileXML object.  See an existing plugin to see how the save_data
7281 function is implemented.
7283 Save data saves data from the plugin's configuration object into the
7284 XML object.
7286 @item
7287 int load_defaults();
7289 Another way the plugin gets parameters is from a defaults file.  The
7290 load and save defaults routines use a Defaults object to parse the
7291 defaults file.  The defaults object is created in @b{load_defaults} and
7292 destroyed in the plugin's destructor.  See an existing plugin to see
7293 how the Defaults object is used.
7295 @item
7296 int save_defaults();
7298 Saves the configuration in the defaults object.
7300 @end itemize
7307 @node NONREALTIME PLUGINS
7308 @section NONREALTIME PLUGINS
7310 Some references for non-realtime plugins are @b{Normalize} for audio
7311 and @b{Reframe} for video.
7313 Like realtime plugins, @b{load_defaults} and @b{save_defaults} must be
7314 implemented.  In nonrealtime plugins, these are not just used for
7315 default parameters but to transfer values from the user interface to
7316 the signal processor.  There doesn't need to be a configuration class
7317 in nonrealtime plugins.
7319 Unlike realtime plugins, the LOAD_CONFIGURATION_MACRO can't be used in
7320 the plugin header.  Instead, the following methods must be defined.
7322 The nonrealtime plugin should contain a pointer to a defaults object.
7324 @example
7326 Defaults *defaults;
7328 @end example
7330 It should also have a pointer to a MainProgressBar.
7332 @example
7334 MainProgressBar *progress;
7335 @end example
7337 The progress pointer allows nonrealtime plugins to display their
7338 progress in Cinelerra's main window.
7340 The constructor for a nonrealtime plugin can't use
7341 PLUGIN_CONSTRUCTOR_MACRO but must call @b{load_defaults} directly.
7343 The destructor, likewise, must call @b{save_defaults} and @b{delete
7344 defaults} directly instead of PLUGIN_DESTRUCTOR_MACRO.
7346 @itemize
7348 @item
7349 VFrame* new_picon();
7351 char* plugin_title();
7353 The usage of these is the same as realtime plugins.
7355 @item
7356 int is_realtime();
7358 This function must return 0 to indicate a nonrealtime plugin.
7360 @item
7362 int get_parameters();
7364 Here, the user should create a GUI, wait for the user to hit an OK
7365 button or a cancel button, and store the parameters in plugin
7366 variables.  This routine must return 0 for success and 1 for failure. 
7367 This way the user can cancel the effect from the GUI.
7369 Unlike the realtime plugin, this GUI need not run asynchronously of the
7370 plugin.  It should block the get_parameters function until the user
7371 selects OK or Cancel.
7373 @item
7374 int load_defaults();
7376 This should create a defaults object and load parameters from the
7377 defaults object into plugin variables.
7379 @item
7380 int save_defaults();
7382 This should save plugin variables to the defaults object.
7385 @item
7386 int start_loop();
7388 If @b{get_parameters} returned 0 for success, this is called once to
7389 give the plugin a chance to initialize processing.  The plugin should
7390 instantiate the progress object with a line like
7392 @example
7394 progress = start_progress("MyPlugin progress...", 
7395         PluginClient::get_total_len());
7397 @end example
7399 The usage of @b{start_progress} depends on whether the plugin is
7400 multichannel or single channel.  If it's multichannel you always call
7401 start_progress.  If it's single channel, you first need to know whether
7402 the progress bar has already started in another instance of the plugin.
7404 If @b{PluginClient::interactive} is 1, you need to start the progress
7405 bar.  If it's 0, the progress bar has already been started.
7407 The PluginClient defines @b{get_total_len()} and @b{get_source_start()}
7408 to describe the timeline range to be processed.  The units are either
7409 samples or frames and in the project rate.
7411 @item
7412 int process_loop
7414 This is called repeatedly until the timeline range is processed.  It
7415 has either a samples or frames buffer for output and a reference to
7416 write_length to store the number of samples processed.  If this is an
7417 audio plugin, the user needs to call @b{get_buffer_size()} to know how
7418 many samples the output buffer can hold.
7420 The plugin must use @b{read_samples} or @b{read_frame} to read the
7421 input.  These functions are a bit different for a non realtime plugin
7422 than they are for a realtime plugin.
7424 They take a buffer and a position relative to the start of the
7425 timeline, in the timeline's rate.  Then you must process it and put the
7426 output in the buffer argument to process_loop.  write_length should
7427 contain the number of samples generated if it's audio.
7429 Finally, process_loop must test @b{PluginClient::interactive} and
7430 update the progress bar if it's 1.
7432 @example
7433 progress->update(total_written);
7434 @end example
7436 returns 1 or 0 if the progress bar was cancelled.  If it's 1,
7437 process_loop should return 1 to indicate a cancellation.  In addition
7438 to progress bar cancellation, @b{process_loop} should return 1 when the
7439 entire timeline range is processed.
7441 @item
7442 int stop_loop();
7444 This is called after process_loop processes its last buffer.  
7446 If PluginClient::is_interactive is 1, this should call
7447 @b{stop_progress} in the progress bar pointer and delete the pointer. 
7448 Then it should delete any objects it created for processing in
7449 @b{start_loop}.
7452 @end itemize
7456 @node AUDIO PLUGINS
7457 @section AUDIO PLUGINS
7459 The simplest audio plugin is Gain.  The processing object should
7460 include @b{pluginaclient.h} and inherit from @b{PluginAClient}.  Realtime audio plugins need to
7461 define 
7463 @example
7464 int process_buffer(int64_t size, 
7465                 double **buffer,
7466                 int64_t start_position,
7467                 int sample_rate);
7468 @end example
7470 if it's multichannel or 
7472 @example
7473 int process_buffer(int64_t size, 
7474                 double *buffer,
7475                 int64_t start_position,
7476                 int sample_rate);
7477 @end example
7479 if it's single channel.  These should return 0 on success and 1 on
7480 failure.  In the future, the return value may abort failed rendering.
7482 The processing function needs to request input samples with 
7484 @example
7485 int read_samples(double *buffer,
7486                 int channel,
7487                 int sample_rate,
7488                 int64_t start_position,
7489                 int64_t len);
7490 @end example
7492 It always returns 0.  The user may specify any desired sample rate and
7493 start position.
7495 Nonrealtime audio plugins need to define
7497 @example
7498 int process_loop(double *buffer, int64_t &write_length);
7499 @end example
7501 for single channel or
7503 @example
7504 int process_loop(double **buffers, int64_t &write_length);
7505 @end example
7507 for multi channel.  Non realtime plugins use a different set of
7508 read_samples functions to request input data.  These are fixed to the
7509 project sample rate.
7513 @node VIDEO PLUGINS
7514 @section VIDEO PLUGINS
7519 The simplest video plugin is Flip.  The processing object should
7520 include @b{pluginvclient.h} and inherit from @b{PluginVClient}. 
7521 Realtime video plugins need to define 
7523 @example
7524 int process_buffer(VFrame **frame,
7525         int64_t start_position,
7526         double frame_rate);
7527 @end example
7529 if it's multichannel or 
7531 @example
7532 int process_buffer(VFrame *frame,
7533         int64_t start_position,
7534         double frame_rate);
7535 @end example
7537 if it's single channel.  
7539 The nonrealtime video plugins need to define
7541 @example
7542 int process_loop(VFrame *buffer);
7543 @end example
7545 for single channel or
7547 @example
7548 int process_loop(VFrame **buffers);
7549 @end example
7551 for multi channel.  The amount of frames generated in a single
7552 process_loop is always assumed to be 1, hence the lack of a
7553 write_length argument.  Returning 0 causes the rendering to continue. 
7554 Returning 1 causes the rendering to abort.
7556 A set of read_frame functions exist for requesting input frames in
7557 non-realtime video plugins.  These are fixed to the project frame rate.
7560 @node TRANSITION PLUGINS
7561 @section TRANSITION PLUGINS
7566 The simplest video transition is @b{wipe} and the simplest audio
7567 transition is @b{crossfade}.  These use a subset of the default class
7568 members of realtime plugins, but so far no analogue to
7569 PLUGIN_CLASS_MEMBERS has been done for transitions.
7571 The processing object for audio transitions still inherits from
7572 PluginAClient and for video transitions it still inherits from
7573 PluginVClient.
7575 Transitions may or may not have a GUI.  If they have a GUI, they must
7576 also manage a thread like realtime plugins.  Do this with the same
7577 PLUGIN_THREAD_OBJECT and PLUGIN_THREAD_HEADER macros as realtime
7578 plugins.  Since there is only one keyframe in a transition, you don't
7579 need to worry about updating the GUI from the processing object like
7580 you do in a realtime plugin.
7582 If the transition has a GUI, you can use PLUGIN_CONSTRUCTOR_MACRO and 
7583 PLUGIN_DESTRUCTOR_MACRO to initialize the processing object.  You'll
7584 also need a Defaults object and a Thread object for these macros.
7586 Since the GUI is optional, overwrite a function called @b{uses_gui()}
7587 to signifiy whether or not the transition has a GUI.  Return 1 if it
7588 does and 0 if it doesn't.
7590 Transitions need a @b{load_defaults} and @b{save_defaults} function so
7591 the first time they're dropped on the timeline they'll have useful
7592 settings.
7594 A @b{read_data} and @b{save_data} function takes over after insertion
7595 to access data specific to each instance of the transition.
7597 The most important difference between transitions and realtime plugins
7598 is the addition of an @b{is_transition} method to the processing
7599 object.  @b{is_transition} should return 1 to signify the plugin is a
7600 transition.
7602 Transitions process data in a @b{process_realtime} function.
7604 @example
7605 int process_realtime(VFrame *input, 
7606                 VFrame *output);
7607 @end example
7609 @example
7610 int process_realtime(int64_t size, 
7611                 double *input_ptr, 
7612                 double *output_ptr);
7613 @end example
7615 The input argument to process_realtime is the data for the next edit. 
7616 The output argument to process_realtime is the data for the previous
7617 edit.
7619 Routines exist for determining where you are relative to the
7620 transition's start and end.
7622 @itemize
7624 @item @b{PluginClient::get_source_position()} - returns the current
7625 position since the start of the transition of the lowest sample in the
7626 buffers.
7628 @item @b{PluginClient::get_total_len()} - returns the integer length of
7629 the transition.  The units are either samples or frames, in the data
7630 rate requested by the first plugin.
7632 @end itemize
7634 Users should divide the source position by total length to get the
7635 fraction of the transition the current @b{process_realtime} function is
7638 Transitions run in the data rate requested by the first plugin in the
7639 track.  This may be different than the project data rate.  Since
7640 process_realtime lacks a rate argument, use @b{get_framerate()} or
7641 @b{get_samplerate} to get the requested rate.
7647 @node PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK
7648 @section PLUGIN GUI'S WHICH UPDATE DURING PLAYBACK
7650 Effects like @b{Histogram} and @b{VideoScope} need to update the GUI
7651 during playback to display information about the signal.  This is
7652 achieved with the @b{send_render_gui} and @b{render_gui} methods. 
7653 Normally in process_buffer, when the processing object wants to update
7654 the GUI it should call @b{send_render_gui}.  This should only be called
7655 in process_buffer.  Send_render_gui goes through a search and
7656 eventually calls @b{render_gui} in the GUI instance of the plugin.
7658 Render_gui should have a sequence like
7660 @example
7661 void MyPlugin::render_gui(void *data)
7663         if(thread)
7664         @{
7665                 thread->window->lock_window();
7667 // update GUI here
7669                 thread->window->unlock_window();
7670         @}
7673 @end example
7676 Send_render_gui and render_gui use one argument, a void pointer to
7677 transfer information from the processing object to the GUI.  The user
7678 should typecast this pointer into something useful.
7682 @node PLUGIN QUERIES
7683 @section PLUGIN QUERIES
7686 There are several useful queries in PluginClient which can be accessed
7687 from the processing object.  Some of them have different meaning in
7688 realtime and non-realtime mode.  They all give information about the
7689 operating system or the project which can be used to improve the
7690 quality of the processing.
7692 @menu
7693 * SYSTEM QUERIES:: Utilities for determining the system resources.
7694 * TIMING QUERIES:: Utilities for performing time-dependant processing.
7695 @end menu
7701 @node SYSTEM QUERIES
7702 @subsection SYSTEM QUERIES
7705 @itemize
7707 @item 
7709 @b{get_interpolation_type()} returns the type of interpolation the user
7710 wants for all scaling operations.  This is a macro from
7711 overlayframe.inc.  It can be applied to any call to the
7712 @b{OverlayFrame} object.
7714 @item
7716 @b{get_project_smp()} Gives the number of CPU's on the system minus 1. 
7717 If it's a uniprocessor it's 0.  If it's a dual processor, it's 1.  This
7718 number should be used to gain parallelism.
7720 @item
7722 @b{get_total_buffers()} Gives the number of tracks a multichannel
7723 plugin needs to process.
7726 @end itemize
7733 @node TIMING QUERIES
7734 @subsection TIMING QUERIES
7737 There are two rates for media a realtime plugin has to be aware of: the
7738 project rate and the requested rate.  Functions are provided for
7739 getting the project and requested rate.  In addition, doing time
7740 dependant effects requires using several functions which tell where you
7741 are in the effect.
7743 @itemize
7744 @item
7746 @b{get_project_framerate()} Gives the frames per second of the video as
7747 defined by the project settings.
7750 @item
7752 @b{get_project_samplerate()} Gives the samples per second of the audio as
7753 defined by the project settings.
7755 @item
7757 @b{get_framerate()} Gives the frames per second requested by the plugin
7758 after this one.  This is the requested frame rate and is the same as
7759 the frame_rate argument to process_buffer.
7761 @item
7763 @b{get_samplerate()} Gives the samples per second requested by the plugin
7764 after this one.  This is the requested sample rate and is the same as
7765 the sample_rate argument to process_buffer.
7767 @item
7769 @b{get_total_len()} Gives the number of samples or frames in the
7770 range covered by the effect, relative to the requested data rate.
7772 @item
7774 @b{get_source_start()} For realtime plugins it gives the lowest sample
7775 or frame in the effect range in the requested data rate.  For
7776 nonrealtime plugins it's the start of the range of the timeline to
7777 process.
7779 @item
7781 @b{get_source_position()} For realtime plugins it's the lowest numbered
7782 sample in the requested region to process if playing forward and the
7783 highest numbered sample in the region if playing backward.  For video
7784 it's the start of the frame if playing forward and the end of the frame
7785 if playing in reverse.  The position is relative to the start of the
7786 EDL and in the requested data rate.
7788 For transitions this is always the lowest numbered sample of the region
7789 to process relative to the start of the transition.
7791 @item
7793 @b{get_direction()} Gives the direction of the current playback
7794 operation.  This is a macro defined in transportque.inc.  This is
7795 useful for calling read functions since the read functions position
7796 themselves at the start or end of the region to read, depending on the
7797 playback operation.
7799 @item
7801 @b{local_to_edl()}
7803 @item
7805 @b{edl_to_local()}
7807 These convert between the requested data rate and the project data
7808 rate.  They are used to convert keyframe positions into numbers which
7809 can be interpolated at the requested data rate.  The conversion is
7810 automatically based on frame rate or sample rate depending on the type
7811 of plugin.
7813 @item
7814 @b{get_prev_keyframe(int64_t position, int is_local)}
7816 @item
7817 @b{get_next_keyframe(int64_t position, int is_local)}  
7819 These give the nearest keyframe before or after the position given. 
7820 The macro defined version of load_configuration automatically retrieves
7821 the right keyframes but you may want to do this on your own.
7823 The position argument can be either in the project rate or the
7824 requested rate.  Set is_local to 1 if it's in the requested rate and 0
7825 if it's in the project rate.
7827 In each keyframe, another position value tells the keyframe's position
7828 relative to the start of the timeline and in the project rate.
7830 The only way to get smooth interpolation between keyframes is to
7831 convert the positions in the keyframe objects to the requested rate. 
7832 Do this by using edl_to_local on the keyframe positions.
7834 @end itemize
7839 @node KEYBOARD SHORTCUTS
7840 @chapter KEYBOARD SHORTCUTS
7842 Alex Ferrer started summarizing most of the keyboard shortcuts.  Most
7843 of the keys work without any modifier like shift or ctrl.  Most windows
7844 can be closed with a @b{Ctrl-w}.  Most operations can be cancelled with
7845 @b{ESC} and accepted with @b{Enter}.
7847 @section PROGRAM WINDOW
7850 @subsection Editing Media
7852 @example
7853 z         Undo
7854 Shift Z   Re-Do
7855 x         Cut
7856 c         Copy
7857 v         Paste
7858 Del       Clear
7859 Shift Spc Paste Silence
7860 m         Mute region
7861 a         Select all
7862 shift + click   When done over an edit causes the highlighted selection to extend to the cursor position.
7863                 When done over the boundary of an effect causes the trim operation to apply to one effect.
7864 @end example
7866 @subsection Editing Labels & In/Out Points
7868 @example
7869 [             Toggle In point 
7870 ]             Toggle Out point 
7871 l             Toggle label at current position
7872 Ctrl <-       Go to Previous Label
7873 Ctrl ->       Go to Next Label
7874 f             Fit time displayed to selection
7875 Alt f         Fit curve amplitude to highlighted section of curves
7876 @end example
7879 @subsection Navigation
7881 @example
7882 Right arrow      Move right*
7883 Left arrow       Move left*
7884 Up arrow         Zoom out*
7885 Down arrow       Zoom in*
7886 Ctrl Up          Expand waveform amplitude
7887 Ctrl Dn          Shrink waveform amplitude
7888 Alt Up           Expand curve amplitude
7889 Alt Dn           Shrink curve amplitude
7890 Page Up          Move up*
7891 Page Dn          Move down*
7892 Ctrl Page Up     Expand track height
7893 Ctrl Page Dn     Shrink track height
7894 Home             Go to beginning of timeline*
7895 End              Go to end of timeline*
7897 @end example
7899 * You may have to click on the timeline to deactivate any text boxes or
7900 tumblers before these work.
7905 @subsection File operations
7907 @example
7908 n         New project
7909 o         Load Files
7910 s         Save Project
7911 r         Record
7912 Shift R   Render
7913 q         Quit
7914 Shift P   Preferences
7915 Shift B   Batch Render
7916 Shift F   Set Format
7917 @end example
7919 @subsection Key Frame Editing
7921 @example
7923 Shift X    Cut keyframes
7924 Shift C    Copy keyframes
7925 Shift V    Paste keyframes
7926 Shift Del  Clear keyframes
7927 Alt c      Copy default keyframe
7928 Alt v      Paste default keyframe
7930 @end example
7933 @subsection Track Manipulation
7935 @example
7937 t          Add Audio Track
7938 u          Insert default Audio Transition
7939 Shift T    Add Video Track
7940 Shift U    Insert Default Video Transition
7941 d          Delete last Track
7942 Shift L    Loop playback
7943 Tab        Toggle single track arming status
7944 Shift-Tab  Toggle every other track's arming status
7946 @end example
7948 @subsection What's drawn on the timeline
7950 @example
7952 1         Show titles
7953 2         Show transitions
7954 3         Fade keyframes
7955 4         Mute keyframes
7956 5         Mode keyframes
7957 6         Pan keyframes
7958 7         Camera keyframes
7959 8         Projector keyframes
7960 9         Plugin keyframes
7961 0         Mask keyframes
7962 -         Camera Zoom
7963 =         Projector Zoom
7965 @end example
7968 @section VIEWER & COMPOSITOR WINDOWS
7970 @example
7972 x         Cut
7973 c         Copy
7974 v         Paste
7975 v         Splice
7976 b         Overwrite
7977 [         Toggle In point 
7978 ]         Toggle Out point 
7979 l         Toggle label at current position
7980 Ctrl <-   Go to Previous Label
7981 Ctrl ->   Go to Next Label
7982 Home      Go to beginning
7983 End       Go to end
7984 z         Undo
7985 Shift Z   Re-Do
7986 +         Zoom in
7987 -         Zoom out
7989 @end example
7993 @section PLAYBACK TRANSPORT
7995 Transport controls work in any window which has a playback transport.  They are
7996 accessed through the number pad with num lock disabled.
7998 @example
7999 4 Frame back         5 Reverse Slow     6 Reverse      + Reverse Fast
8000 1 Frame Forward      2 Forward Slow     3 Play     Enter Fast Forward
8001 0 Stop
8003 @end example
8005 [ Space bar ] is normal Play, Hitting any key twice is Pause.
8008 Hitting any transport control with CTRL down causes only the region
8009 between the in/out points to be played, if in/out points are defined.
8011 @section RECORD WINDOW
8013 @example
8015 Space              Start and pause recording of the current batch
8016 l                  Toggle label at current position.
8018 @end example
8020 @bye