
--------------------------------------------------------------------
Video Configuration (gimprc)
--------------------------------------------------------------------

There are optional configuration values for the GIMP-GAP video plug-ins.
Those values are stored in your personal gimprc file (located in $HOME/.gimp-2.6/gimprc)
or in the system-wide gimprc file (usually located at /usr/local/etc/gimp/2.6/gimprc)

If you edit gimprc files by hand, you must do this before you startup GIMP.


# configure where to find the executable mplayer program.
# use the full name including the absolute path. 
# This is required if mplayer is NOT found in one of the directories
# specified in PATH but is installed somewhere else.
# (relevant only on UNIX systems)
(mplayer_prog "/usr/local/bin/mplayer")

# configure where to find the executable wavplay program.
# use the full name including the absolute path. 
# This is required if wavplay is NOT found in one of the directories
# specified in PATH but is installed somewhere else.
# (relevant only on UNIX systems)
(wavplay_prog "/usr/X11R6/bin/wavplay")


# there are 2 Values to define directory and basename
# for Video Copy/Cut/Paste operations      
(video-paste-dir "/home/hof/gap_video_paste_dir")
(video-paste-basename "gap_video_paste_")

# the video-confirm-frame-delete can have values "yes" or "no"
# where "no" does not show the confirm dialog windows when the user
# tries to delete video frames of the video.
# (default is "yes")
(video-confirm-frame-delete "yes")


# the gap video API keeps an internal cache for
# the specified number of frames at read access from
# videofiles.
(video-max-frames-keep-cached 50)


# the gap player supports caching of frames
# (both image sequences or frames fetched from videofiles)
# to achieve fast playback speed when playback
# is repeated in loops or pingpong mode.
# a cache size of 0 turns caching OFF.
# the cache size can be set in kilobytes (K) or megaytes (M)
(video_playback_cache "100M")

# the gap player supports caching of gimp tiles
# note that frame playback does NOT use gimp_tiles (see video_playback_cache)
# but caching of gimp tiles is relevant for other tile based processing features
# (especially detail tracking that accesses the same region of gimp tiles in many loop iterations)
# the cache size is specified in number of tiles.
(video_player_cache_ntiles 200)


# the gap player has several widgets to set the
# position (e.g. the currently displayed framenumber)
#
# - the "Go Buttons" are an array of buttons that allow
#   positioning by simply moving the mouse over the buttons.
#   in some situations this may be annoying to some users
#   therefore this optional way of positioning can be turned
#   on/off
#   via the gimprc option video_player_show_go_buttons  "yes" or "no"
#   (default is "yes")
# - the position scale widget can be turned on/off  
#   via the gimprc option video_player_show_position_scale  "yes" or "no"
#   (default is "yes")
(video_player_show_go_buttons "yes")
(video_player_show_position_scale "yes")


# videoindexes are files that store seekoffsets for keyframes
# and enable fast and frame exact random access to frames in a videofile.
# if gimp-gap should create such files automatically when needed
# you should configure the value "yes".
# 
# if you want gimp-gap to ask each time before creating videoindex file
# then configure value "ask".
# if you want GIMP_GAP to ask even in case where creating a videoindex is not required
# because native timecodebased seek works, then configure "ask-always".
# Note: the "ask-always" setting is rather annoying for productive usage, but
# useful for testing and development purpose.
# (ask is the default when nothing is configured)
# if gimp-gap should not create such videoindex files at all
# configure value "no"
(video-index-creation "ask")

# configure where to store and check for video index files
# if video-index-dir is not configured
# the GAP video API uses a directory named gvaindexes
# in your gimpdirectory by default
(video-index-dir "/path/to/writeable/directory")

# If the gimp-gap videoapi uses libmpeg3 there is a built-in
# workaround for a libmpeg decoder specific bug that sometimes 
# causes crashes when MPEG1 videos are closed.
# The workaround is implemented for UNIX OS only and 
# forks a child process with its own signal handler.
# the child process tries open/close. Crashes are then caught
# in the signal handler of the child process to tell the parent
# process (via retcode) that this videofile cant be handled safe by libmpeg3.
#
# This workaround makes open videofiles safer but slow.
# (mainly caused by additional open/close rather than by forking).
# setting the gimprc parameter 
#   (video-workaround-for-libmpeg3-close-bug "no")
# can skip the workaround, and makes opening of viedofiles faster 
# with some risk of crashing  when libmpeg3 is used.
#
# per default (without this gimprc parameter) the workaround is enabled.
#
(video-workaround-for-libmpeg3-close-bug "no")


# optional external audioconverter program
# must be able to handle the same parameters as the
# standard converter script audioconvert_to_wav.sh
# There is NO need for the audioconvert_program gimprc configuration
# if you use the standard converter script.
(audioconvert_program "/usr/local/bin/my_private_audioconverter")


# Configure GIMP-GAP for explicit use of the UFRaw 3rd party plug-in
# for non-interactive loading of frame files from raw filetypes.
#  configuration (gap-load-ufraw-%s "yes")
# Use this when the generical gimp-file-load fails to load Canon .cr2
# or other raw files
# (because it picks the file-tiff-load plug that is not capable to load those filetypes)
(gap-load-ufraw-dng "yes")
(gap-load-ufraw-nef "yes")
(gap-load-ufraw-cr2 "yes")
(gap-load-ufraw-cr "yes")




# NON-XCF frame processing/export overwrite behaviour:
# -----------------------------
# if you want to use GIMP-GAP with other fileformats than XCF
# for your frames, you will get a warning dialog at the first
# attempt (per GIMP-session) to save one of the frames with GIMP-GAP plug-ins.
# If you dont want this warning dialog, you can use the gimprc
# file to configure how GIMP-GAP should save frames depending on the
# extension. 
# for all configured fileformat extensions GIMP-GAP uses the configuration from the
# gimprc file and does not show the warning dialog.
# configuration key is video-save-mode-for-%s where %s stands for an extension
# such as jpg, tif, cr2,....
# possible configuration values are:
#  "overwrite"
#    automatically overwrite the discfile image that corresponds 
#    to the current frame (which is opened in the gimp session)
#    on frame exchange operations (such as go to next/previous frame)
#    where the file save plug-in is called with the backround layer as active layer.
#    
#  "overwrite_flattened"
#    automatically overwrite the discfile image that corresponds 
#    to the current frame (which is opened in the gimp session)
#    on frame exchange operations (such as go to next/previous frame)
#    where the current frame is flattened before calling the file save plug-in.
#
#  "readonly"
#    frame exchange will fail in case the current frame image has
#    unsaved changes (e.g. the dirty flag is set).
#    GIMP-GAP does not overwrite frame files on disc in this mode.
#    It is intended for fileformats where export/overwrite
#    is not available or not wanted.
#
#  "readonly_discard"
#    GIMP-GAP does not overwrite frame files on disc in this mode,
#    but discards unsaved changes without any notice on frame exchange.
#    USE THIS ONLY WHEN YOU KONW WHAT YOUR DIONG ON YOUR OWN RISK !
#
# Here are recommended gimprc configuration settings
# for some common used fileformats:
(video-save-mode-for-jpg "overwrite_flattened")
(video-save-mode-for-jpeg "overwrite_flattened")
(video-save-mode-for-bmp "overwrite_flattened")
(video-save-mode-for-ppg "overwrite_flattened")
(video-save-mode-for-gif "overwrite")
(video-save-mode-for-dng "readonly")
(video-save-mode-for-cr2 "readonly")
(video-save-mode-for-nef "readonly")


# old way (supported for backwards compatibility) 
#   where "yes" is the same as video-save-mode-for-%s "overwrite_flattened"
#   and   "no"  is the same as video-save-mode-for-%s "overwrite"
(video-save-flattened-jpg    "yes")
(video-save-flattened-jpeg   "yes")
(video-save-flattened-bmp    "yes")
(video-save-flattened-png    "yes")
(video-save-flattened-ppm    "yes")
(video-save-flattened-gif    "no")



# video storyboard layout options
# --------------------------------
# layout options for the storyboard dialog including
# number of rows/column and thumbnail sizes for both
# cliplist (upper) and storyboard (lower) thumbnail area.
#
# thumbnail_size supported values are:
#  "large"
#  "medium"  (default)
#  "small"
#
# row and column settings:
(video-storyboard-thumbnail_size    "medium")
(video-storyboard-columns           "5")
(video-storyboard-rows              "6")
(video-cliplist-thumbnail_size      "medium")
(video-cliplist-columns             "12")
(video-cliplist-rows                "2")

# force storyboard clip playbacks to the aspect defined
# in the storyboard file properties.
# if turned off playback clips according to their original pixelsize.
(video-storyboard-force-aspect-playback "yes")

# maximal number of open videofiles for storyboard render
# processor. The storyboard processor typically keeps more than
# one videofile open when processing multiple input video clip
# references within a storyboard. This is done for performance reasons.
# But if there are too many open videofiles this may lead to
# run out of memory and other resources. Therefore the number
# of simultaneous open videofiles is limited to a default
# of 12.
# The integer parameter video-storyboard-fcache-size-per-videofile
# sets the number of frames to be cached per open video handle
# for backwards playing video clips. (it is not relevant for
# the standard case where video clips are read in ascending frame sequence)
#
# If you have less than 1GB of memory, you may use a smaller
# value (minimum is 2) when you are running out of memory
# while storyboard processing.
# You still are able to process storyboards with many different
# videoclips but this will be slower because there will be more
# open, seek and close operations required with a smaller limit.
(video-storyboard-max-open-videofiles 12)
(video-storyboard-fcache-size-per-videofile 36)

# The boolean parameter video-storyboard-preview-render-full-size
# sets the size for storyboard rendering for preview purpose 
# (in the player widget that is embedded in the storyboard dialog)
# the value "no" picks the minimum of current preview size and storyboard size
# for rendering.
# Note that preview rendering is forced to full size (regardless
# to the setting of this parameter) in case the storyboard
# includes at least one clip with fixed width or height.
# (e.g. the storyboard records of the following types:
#  VID_FIT_SIZE mode=none
#  VID_FIT_SIZE mode=width proportions=change_proportions
#  VID_FIT_SIZE mode=height proportions=change_proportions
# )  
# The value "yes" uses full original storyboard size for rendering of the preview.
# This may be desired in case the user wants to extract a composite frame
# from the playback widget in the storyboard dialog at full size.
(video-storyboard-preview-render-full-size "no")

# the integer parameter video-storyboard-resource-log-interval
# enables logging of cached resources during storyboard processing.
# value n (positive integer) triggers resource logging every n-th frame.
#         where logging includes information about cached images 
#         and currently open video handles.
#         This is intended for debug purpose.
# value 0 (is the default) turns off this type of logging.
(video-storyboard-resource-log-interval 0)


# the boolean parameter video-storyboard-multiprocessor-enable
# enables multiprocessor support for the storyboard processor
# The current implementation uses a parallel running prefetch thread
# that reads frames from referenced videofiles into a frame cache
# in advance.
# in case num-processors is configured with value 1 the default is "no" (otherwise "yes")
(video-storyboard-multiprocessor-enable "no")
  
# the boolean parameter video-enoder-ffmpeg-multiprocessor-enable
# enables multiprocessor support for the ffmpeg based video encoder
# The current implementation uses a parallel running encoder thread
# that uses a ringbuffer queue that is feed by the storyboard processor.
# in case num-processors is configured with value 1 the default is "no" (otherwise "yes")
(video-enoder-ffmpeg-multiprocessor-enable "no")

  
# the boolean parameter video-enoder-ffmpeg-show-expert-settings
# defines the initial mode of the FFMPEG based videoencoder Parameter dialog window.
# where value "no" hides all notebook tabs with details video encoder
# parameters. In this mode the user can set the parameters
# by selecting one of the preset names via a combo box.
(video-enoder-ffmpeg-show-expert-settings "no")




# the video-libavformat-seek-gopsize parameter
# enables native (fast) seek operations in the ffmpeg (libavformat) 
# video read access api.
# values <= 0 disables native seek operations.
# values > 4 define how many frames shall be sequentially read
# after seek operation. 
# For some videofiles libavformat positioning
# to keyframe seems not to work properly. This will result
# in some trash frames when positioning to B or P frame, because
# the related keyframe required for proper decoding may be skiped
# by the seek operation.
# If you get trashed frames after seek operations you may
# increase the video-libavformat-seek-gopsize parameter
# (values up to 128 can make sense). Note that a high value
# increases the chance to pre-read the related keyframe and fixes
# the problem with trashed frames, but makes seek significantly slower.
#
# libavformat native seek operates timecode based while gimp-gap
# operates frame number based. therefore positioning via native seek
# may deliver wrong frame positions for videos with individual timing
# per frame. For frame exact operation on such (rare) videofiles
# you should disable native seek by setting the video-libavformat-seek-gopsize
# parameter to 0 and let gimp-gap create a videoindex.
# (videoindex creation requires an initial full scan of the video,
# but offers exact positioning.
# positioning via videoindex is slower than native seek)
# 
# an internal default value of 8 is used if no other value is configured.
# (this should be OK for most videofiles, if you work with mpeg2 dvd stuff
# .vob files, a value of 4 shall be enough and give optimal positioning performance)
#
(video-libavformat-seek-gopsize "8")


# The gimprc parameter video-libavformat-timecodelog
# triggers additional timecode logging at video index creation
# it creates a logfile with same name as the videoindex + ".timelog"
#
# The gimprc parameter video-libavformat-timecodelog
# defaults to "0" where no .timelog file is written.
# *.timelog files are useful for developers 
# to analyze and verify native timcode based
# seek operations. *.timelog files contain timecodes and stepsize differences
# for each frame of the analyzed video and CRITICAL warnings where
# variable or non-plausible timecodes were detected.
#
(video-libavformat-timecodelog "1")

# (video-gva-libavformat-video-analyse-persistent "yes")
# the ffmpeg video access api performs
# analyses on videofiles to detect parameters that
# are required for fast native timecodebased seek
# access and to detect if seek support generally works for a videofile.
# This analyse is normally triggered at the 1st seek attempt
# and takes some time (usually less than 10 secs) because probereads
# and seek tests are performed.
# If the parameter 
# video-gva-libavformat-video-analyse-persistent
# is set to value "yes" the results of the analyse is saved to
# a file (located in gimprc subdirectory gvaindexes)
# If the same video is opened another time, the analyse can be skipped
# if the required parameters can be successfully fetched from the file.
# (if the video file was modified since creation of the analyse result
# file the fetched parameters are not used and analyse is NOT skipped)
# 
#
# Setting this parameter to value "no" ignores
# analyse results files (even if they are still valid)
# 
(video-gva-libavformat-video-analyse-persistent "yes")

# the api for ffmpeg video access can be configured how to handle
# read errors when decoding video files with the gimprc parameter video-gva-libavformat-continue-after-read_errors
# the default option ("yes") is to skip the current package (e.g. the frame that cant be read/decoded)
# and try to continue reading the next frame.
# the other option ("no") is to stop when the first read error occurs
# (available since 2010.10.02)
(video-gva-libavformat-continue-after-read_errors "yes")

# gimp_gap frame fetcher configuration
# ------------------------------------
#
# the gap frame fetcher cache is currently relevant for storyboard processing
# and filtermacro processing. it is used to keep the configured
# number of images, videohandles and videoframes in cache for potential
# reuse in further processing steps to avoid multiple load or open/close
# operations.
#
# images are cached as gimp images that are marked with a temporary image parasite
# "GAP-IMAGE-CACHE-PARASITE"
# those parasite identifies an image as member of the gimp_gap frame fetcher cache. 
# (gap does not open a display on such images)
# setting the gap_ffetch_max_img_cache_elements too high can result in
# slow processing because the gimp core starts to swap when too much
# or too large images are loaded.
#
# using values up to 100 or more may speed up storyboard processing
# on machines with large memory (4G or more).
# (note: expect speed up only in case the storyboard has multiple references
# to images, such as applying the same mask image to more frames
# or using the same image to render multiple frames)
#
# default value is 18.
#
(gap_ffetch_max_img_cache_elements "18")

# number of video handles to keep cached.
# default value is 6
(gap_ffetch_max_gvc_cache_elements "6")

# number of video frames per video handle to keep cached.
# note that video frames are not cached as gimp image.
# video frames are cached by the gimp gap video api that allocates
# the memory (and will fail in case not enough memory is available to hold the configured
# number of video frames)
# default value is 36
(gap_ffetch_gva_frames_to_keep_cached "36")

# gimp-gap has implemented 2 algorithms to locate small detail
# of a layer in a corresponding layer.
# the older implementation is slower but may may be activated
# with this parameter for test purpose
# default is no
(gap-locate-details-use-old-algorithm "no")


# Move Path debug feature to trigger logging current parameters
# while rendering a frame to stdout.
# default is no
(video-move-path-log-render-params "no")

# Move Path rotation threshold is a float number between 0.0 and 1.0
# This threshold value allows Move path render engine to skip the time consuming
# rotate transformations on very small angles.
# default is 0.0125 degree
(video-move-path-rotate-threshold "0.0125")


# enables the debug menu in the storyboard dialog
# and preview image extraction by click on the preview image 
# in the storyboard attributes dialog window.
# default is no
(video-enable-storyboard-debug-features "no")
