There are two possibilities presented here, using.
EDIT: Both scripts have now been condensed and modified to play only a single frame for the duration of however many seconds are specified. mplayer can handle very low FPS (eg. 0.008547009 and 0.003154574 FPS worked fine, ie. 117 and 317 seconds playing time).
NOTE: On the Ubuntu 10.04 machine. mplayer does not play the first frame, so I've needed to include 2 frames to achieve the specified time. So, be aware that another player may play both frames and thereby double the playing time.
AviSynth is a versatile/poweful frame-server. There is no GUI. It is a scripting language for non-linear audio-video editing/creating/filtering.
Being a frame server, it does not need to create a video on disk. It can serve the video/audio directly, frame-by-frame, to any AviSynth aware tool, be it a media player or encoder...
AviSynth is Free and Open Source Software written for Windows (have I lost you? :) ... Attempts were made, but it was not successfully ported to *nix (I believe the developers tried but it got bogged down as its original design was heavily hooked into Windows stuff. It does, however, work well under wine. The wine version of mplayer and Avidemux can process .avs scripts (there are others; eg VirtualDub, and AvsPmod which is a mini-"IDE" GUI for Avisynth).
Here is an AviSynth script to do what you want.
myslide 15 20 "Hello from AviSynth"
#!/bin/bash
fontSize=$1; sec=$2; text="$3"
>>test.avs printf 'Blankclip( 2 ,width=640 ,height=480 ,fps=1/float(%s), color=$000000)\n' "$sec"
>>test.avs printf ' \ .Subtitle("%s", font="Arial", size=%s, text_color=$ff0000, align=5)\n' "$text" "$fontSize"
wine avs2yuv.exe test.avs - 2>/dev/null |
ffmpeg -b 100 -i - "test.mp4" 2>/dev/null
mplayer test.mp4
avs2yuv is a command-line program, intended for use under Wine, to interface between Avisynth and Linux-based video tools.
avs2yuv only reads a video stream, but AviSynth can frame-serve audio and video to Avidemux via AvsProxy (which ships with Avidemux)...
---
Here is another way, using convert from package imagemagick. This method creates a series of .jpg images.
myslide 15 20 "Hello from convert"
#!/bin/bash
fontSize=$1; sec=$2; text="$3"
FPS=$(awk 'END{print 1/'$2'}' /dev/null)
convert -background lightblue -fill blue -pointsize $fontSize -gravity center -size 640x480 caption:"$text" "test$$0.jpg"
cp test$$0.jpg "test$$1.jpg" # Add 1 extra; mplayer doesn't play ist frame (on test system)
ffmpeg -y -r $FPS -b 100 -i test$$%d.jpg test.mp4
rm test$$*.jpg # remove temp images
mplayer test.mp4