Acceptable ac3 parameters for DVD, according to wikipedia
AC-3: 48 kHz sampling rate, 1 to 5.1 (6) channels, up to 448 kbit/s
Meaning that your sample rate is much too low. You need to use "-ar 44800" if you want it to be dvd-video compatible.
pcm and mp2 audio formats are also acceptable, within certain ranges. Check the link.
Error while opening encoder for output stream #0.0: maybe incorrect parameters such as bit rate, rate, width
It seems that ffmpeg only accepts certain combinations of bitrates and samplerates for ac3. Your command works if I change the -ab to 192k or 256k, for example. But I can only set it to 384k if I increase the samplerate to 44100 or 48000. I don't know if this is a limitation of ac3 itself, or just ffmpeg.
Also, starting a couple of years ago, ffmpeg changed the reading of the bitrate parameter to be bits-per-second. You need to use "-ab 256k" to specify kilobits.
ffmpeg -i /dev/zero -ac 2 -ar 22050 -ab 282 -acodec ac3 -y file.ac3
ERROR: /dev/zero unknown format
FFmpeg doesn't know what the endless stream of zeros it's getting is supposed to represent. If you want to create a silent ac3, you need to specify the input parameters of the raw data. I believe you can use something like this:
ffmpeg -ar 48000 -ac 2 -f s16le -i /dev/zero -acodec ac3 -ab 64k -t 4 silence.ac3
The parameters of ffmpeg before the input file specify what format the input will be read as, while the ones following it specify what the output value will be (parameters not explictly stated will be the same as the input). In this case, we're telling it to treat /dev/zero as if it were in the 16-bit pcm format (little-endian), but I suppose any of the raw pcm formats would work. Finally, use -t to state the number of seconds to encode.