#!/usr/local/bin/bash # dvd-slideshow # Copyright 2003 Scott Dylewski # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # name='dvd-slideshow' version='0.7.5' echo "[dvd-slideshow] dvd-slideshow $version" echo "[dvd-slideshow] Licensed under the GNU GPL" echo "[dvd-slideshow] Copyright 2003-2006 by Scott Dylewski" echo "[dvd-slideshow] " ## todo: (sorted by priority?) # vcd and svcd support # smoother kenburns effect for slow pans # kenburns with rotation # explain how to view subtitles after runnning dvd-slideshow # explain difference between Low/Medium/High quality modes ## known bugs: # dvd-slideshow < 0.7.4 does not work with bash >= 3.1 # continuous subtitles don't work across non-image/transition lines # bug when first line/slide has a subtitle but no others do? # # convert image.jpg -bordercolor black -border 0 "$tmpdir/fade_$dj.ppm" works for transparent .png images # in ImageMagick > 6.0.6, but not in 6.0.6 for some reason. (black output). changes () { echo 'Changes: 0.7.5 New features & Changes: Use "\n" to force line breaks up to two lines in title text (not titlebar yet). Fixed code to rotate images. (not public yet) Use image.jpg:duration:subtitle:[effect1:effect1_params:]rotate:angle Configuration variables will be read in sequence now. So you can configure font colors and sizes throughout the input file. Allow comments in all lines. Everything after # will be ignored. Scroll effect is MUCH smoother for slow scrolls in high-quality mode! (takes 3x longer) Slideshow name -n is optional now. Defaults to the base name of the input file. * Changed old "title" keyword to "titlebar:duration:toptitle:bottomtitle" * Added "title:duration:title_text" function where a single title is rendered in the middle of the screen. Add check for missing subtitle syntax in crop/scroll/kenburns. Longer progress bar. Reads ~/.dvd-slideshowrc in a loop for better debugging and security. Bug fixes: Added "+repage" in convert lines after cropping when using internal .mpc image format. ( Fixes Kenburns and crop errors with ImageMagick > 6.2.2 ) Fixed kenburns problems with black backgrounds. Fixed "geometry does not contain image" problem with kenburns effect. Works for slide or transition duration > 35 seconds now. Add quotes around yuv fifo to allow for spaces in output directory. Fixed "squishing" when fading out or crossfading to a scroll effect. Fixed problem where audio "fadein" was being rendered as a subtitle. Traps bad duration=0 for images and effects. 0.7.4 Bug fixes: Changed mpeg2enc process file descriptor from 55 to 3 for compatibility with bash >= 3.1 (fixes hang at wait for mpeg2enc to finish) Echos details to logfile about mpeg2enc process for future debugging. Output directory gets created if it does not exist. Fixed bug in kenburns positioning with black background. Better error messages when no oggdec or lame found. Fixed error where kenburns intermediate files were not being deleted. 0.7.3 New features: Fixed Kenburns zoom in adjusted to a "constant" velocity! You can include other .txt files by using a line include:filename.txt in your input .txt file. Thanks Thomas Weber! User can manually add chapter markers by using the "chapter" keyword alone on one line of the input .txt file. Added variable "mpeg2enc_params" so advanced users can easily change the parameters. All timing accurate to 0.001 (1 ms) now. Added -smp option to process faster on high-end machines. Added -writechaps option to write out chapter markers to .chap Bug fixes: Fixed bugs causing errors when spaces were in paths. Fixed bugs in the audio processing: error on last audio file. Changed mpeg2enc -M 3 (use multiprocessors) to -M 0 because 1.8.0 was crashing on athlon 64 X2 machines. Added "-compose src-over" option to composite calls for compatibility with Debian Etch. Fixed bug when passing a single audio file longer than the slideshow. Removed rpm check for supporting applications. Checks for crossfade duration = 0 and handles it correctly. Checks that audio and image files exist while parsing .txt file. Fixed minor bug where an extra (non-existant) subtitle was rendered. Fixed bug when fading in to a first slide that is a scroll effect. Subtitle timing bug fixed! Small fix in displaying total number of pictures processed Better logging to logfile. Fixed ignored line if last line does not contain a line break. 0.7.2 Faster Kenburns effect rendering when using black background. Allow multiple sequential audio files in input .txt file. Changed "head -1" to "head -n 1" Allow .png and .jpeg extensions. allow \n in subtitles to designate end-of line breakpoints Checks for required program version better now. Fixed ppmtoy4m compatibility error for compatibility with mjpegtools >= 1.6.3-0.1 Allow "exit" keyword in .txt file (for easier debugging). Fixed pixel aspect ratio problem. (hopefully) Add option to render subtitles with spumux and .srt files (beta) Cleans up old temporary files if they exist. Better logfile output. Hopefully catches program call errors. Title2 text and bar locations referenced to bottom of frame for better PAL/NTSC compatibility. Subtitle stays constant between slides if they both have the same subtitle (thanks Andre Weilert) All temporary files are created in a temporary directory now. Fixed bug when fading in to a scroll effect. (remove tab at EOL). Changed progress indicator slightly. 0.7.1 Added log file output to dvd-slideshow.log Updated documentation and examples. Background color can now take a #RRGGBB value. Nicer progress indicator. AC3 audio is now the default. Pass -mp2 to force MP2 audio. Autocrop works on background images now also. Added code to check for all temporary fade_xxxx.ppm images before proceeding to encode mpeg video. Fadein or crossfade to a scroll effect works correctly now. 0.7.0 Default variables can be set in a ${HOME}/.dvd-slideshowrc file Default variables can be set in the input .txt file Crossfade and fadein to kenburns effect correctly fades to the first frame geometry instead of the whole image. New keywords for the start and end points in kenburns effect: topleft/middle/middleright etc. See docs for details. New keywords for the crop function also. 9999 audio files possible now. Used to be a limit of 9 Fixed bug when fading in to a cropped image. Removed -R 2 and -c options in mpeg2enc because some people had problems. Fixed subtitle timing bug, so now the subtitles appear and disappear closer to the correct time. Changed encoded audio bitrate from 224kb/s to 128kb/s Works with toolame 0.2m beta and 0.2L now Got rid of calls to NetPBM functions, so it is no longer required... Changed "wc -m" call to "wc --chars" for better compatibility. Fixed syntax so spaces should be allowed in input files now. Changed "seq2 2 1" to "seq2 2 -1 1" for better compatibility Added option to "autocrop" images (-c) that are close to the output aspect ratio, but not quite. Title syntax changed... (see documentation) Fadein/crossfade to a title or background slide works now. Fadein/fadeout/crossfade works when previous/next slide is not actually an image/title/background. The next real slide will be used instead. Fixed bug in Low quality mode (-L) (extracopies bug) Fixed bug with subtitles with new versions of imagemagick. White can be used a a background keyword for white backgrounds. 0.6.0 Fixed major bug/error when generating long slideshows. Now all video gets piped in YUV fomat through mpeg2enc in one single block. (fix by Mike Beller) Added option to generate AC3 audio files (requires ffmpeg) Fixed title slide when using -L (low quality mode) Allow for slide durations to be specified in hundreths of a second: 5.23 Reports total audio and video lengths at the beginning of the code. Fixed bug when using subtitles. (no subtitles were generated) Changed output files to be .vob extension instead of .mpg Better font searching (thanks Jim Crumley) Use backslash to escape a colon in subtitles (thanks Jim Crumley) Allow avi input files. pre-alpha support. (thanks Jim Crumley) 0.5.4 Added option to re-define background image from text file input. Code cleanup (slightly) Added support for two audio tracks. Added audio effects: fadein/fadeout Default command-line audio fadein/fadeout time is 3 seconds. 0.5.2 Fixed bug in musictitle Title info parsing. Checks to make sure a slidshow name is passed. Added low-quality mode (-L) for testing. Speeds things up about 4x. Reduced verbosity. Checks for required fonts. Subtitles look much better now. Word-wraps long subtitle lines into two lines. 0.5.0 Added KenBurns effect! See docs for usage. Added scroll effect! See docs for usage. Added crop effect. See docs for usage. Audio can be started and stoped for multiple files within the text file. See docs for usage. Added "musictitle" option for displaying audio info. You can now comment out lines in the textfile by using the # character. Also ignores blank lines in textfile. Fades can now have up to 9999 frames. Total slides can now be 9999. You guys are crazy. fixed small bug when no chapters are specified. Chapter markers are now rounded up to the next full second due to a bug in some versions of dvdauthor. Only checks for oggdec or lame if you pass an ogg or mp3 file. Changed syntax of command line input for files and audio. Passing images on the command line is no longer "public". Use the text file in put instead. Fixed audio problem with some mp3 files getting pops in them. 0.4.8 Changed audio to process raw (headerless) audio files before joining them. Fixed bug when passing multiple audio files (again). Fixed audio fadein/fadeout time to 1 second Fixed bug in audio where it plays to fast when burned on dvd. Checks to make sure audio files exist before processing. 0.4.6 Fixed bug when passing multiple audio files. (thanks Scott Merrill) Removed -t option from toolame command for better support for old versions. 0.4.4 Only writes chapter markers when there is a picture or title First chapter marker is now fixed at time 0 Max number of chapter markers is now 99 (thanks Jens Gecius) Fixed bug when checking for toolame (thanks Jens Gecius) Added "crossfade" option! Will use mpeg3cat from libmpeg3 to join mpegs if available. Small fix to allow semicolons in subtitles (thanks Jim Crumley) Added -s option to mpeg2enc calls for (maybe?) better compatibility. 0.4.2 Current working directory will be used if -o not specified. Allow "background" keyword in text file to insert background. Make sure all ImageMagick calls have -depth 8 to make ppmtoy4m happy. No font is specified in ImageMagick calls, so it should use the default. Changed default menu to a steelblue gradient when no image is passed. 0.4 Fixed bug when no background specified (again). Added error checking to make sure image files exist. Ogg audio format supported (you must have oggdec). Uses toolame for mp2 audio encoding when available. Audio timing improved. Fixed bug when double-quotes were in subtitle. Added black, fadein, and fadeout options in txtfile! -p (PAL format option) added. Not tested, but should work. 0.3 Fixed error when no background specified. Now default is black Added checking for required programs before running. 0.2 Initial release' } help () { echo "`basename $0` Version $version " echo 'http://dvd-slideshow.sourceforge.net' echo 'Copyright 2003-2006 Scott Dylewski ' echo echo 'Description: Creates a dvd-compatible mpeg2 video from a bunch of images. You can add music if you want also. Supports several effects like fadein/fadeout/crossfade/crop/kenburns. Usage: dvd-slideshow [-n ] [-o ] [-b ] [-a -a ... -a ] [-p] [-L | -H] [-mp2] [-r] [-smp] -f input_file.txt Options: [-n slideshow_name] The program uses this string as the filename base for the output files so you can distinguish it from other slideshows that you can send to the same output directory. [-o ] Directory where the final .vob and dvdauthor .xml files will be written. Default is to write in the directory where dvd-slideshow was run. [-b ] Image to use for the background of the slideshow. All of the pictures will be overlaid on top of this background image. If no file is specified, black will be used for the slideshow and a blue gradient for the title slide. [-a