Navigation

More coming soon!



2020-05-20

It took me forever to figure out how to get a working encode of a video using ffmpeg that will play on a Quadra 630. Hopefully this will help you.

  • ffmpeg's implementation of quicktime ima4 audio compression crashes quicktime with a type 3 (QT 2.5.1) or type 4 (QT 4.0.3) error. So we're stuck with sowt, which means to acheive similar compression from a 16-bit 44100Hz stereo source, we have to half the bit depth and the sampling rate to 8 and 22050 respectively, as well as converting to mono. If ima4 wasn't broken we could have 16-bit 22050Hz stereo audio.
  • In my tests, a 68k macintosh can not reliably play back anything better than 320x240@15p.
  • For HD video this means our target resolution is 320x180p.

Here's the video filter line I used:

vproc="pp=ac,pp=ac,pp=ac,hqdn3d=5,eq=contrast=256/220:brightness=1/512:saturation=256/224:gamma=16/16,scale=320:-4:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:sws_dither=2:in_range=0:out_range=2,minterpolate=fps=15:mi_mode=mci:me_mode=bidir:me=ntss:vsbmc=1,xbr=2,format=pix_fmts=rgb24"

And the audio filter line:

pan=mono|FC < 1.414FC+FR+FL+0.5BL+0.5SL+0.25LFE+0.125BR,aresample=resampler=soxr:osr=22050:cutoff=0.990:dither_method=shibata

And finally the command line, with the filters chains in the proper places.

@ffmpeg -v 32 -stats -y -i <filename> -vf <video filters> -c:v cinepak -q:v 30 -af <audio filters> -c:a adpcm_ima_qt -f mov <output filename>

Because ffmpeg's cinepak encoder is absurdly slow and mostly only exists so they can claim they can do it, rather than as a practical tool, expect this to render at approximately 0.2x realtime. A faster method would be to scale your HD content down on a modern PC, encode to prores as an intermediate, and then sneakernet it to an old G3 or G4 macintosh to do the encoding directly with quicktime. You could probably approach 2x or 3x realtime using this method, ffmpeg's encoder is that bad. (This also has the added bonus of allowing you to use ima4 for your audio, giving you somewhat higher quality.)





This page hosted by Get your own Free Home Page