File size reduction in Linux?
Matt Graham
danceswithcrows at usa.net
Sat Dec 12 10:52:44 MST 2009
From: mike Enriquez <mylinux at cox.net>
> I have a problem. I need to reduce my video files to from 40MB to
> about 5-10 MB. My service provider says my files are too large and
> blocks them. So I wonder if anyone has had this problem.
> Has anyone in the Linux community encounter this before?
Nope. You're the first person who's ever needed to resize a bunch
of video files. Actually, there's a very useful utility called
ffmpeg that can re-encode audio and video to a ton of different
formats. However, it's not really n00b-friendly. I used the file
at http://crow202.org/~mhgraham/presets.xml (originally part of a
frontend written in some bizarre dialect of Pascal) and a bit of
shell to come up with this:
#!/bin/bash
# converttoflv.sh
# no error checking at all. Converts first arg to second arg
ffmpeg -i $1 -vcodec flv -f flv -r 29.97 -s 320x240 -aspect \
4:3 -b 300kb -g 160 -cmp dct -subcmp dct -mbd 2 -flags +aic+cbp+mv0+mv4 \
-trellis 1 -ac 1 -ar 22050 -ab 56kb $2
...which, when invoked as "converttoflv.sh thing.avi thing.flv", will
turn thing.avi into a 320x240 FLV with a low bitrate audio stream at
22KHz and a 29.97 frames/sec framerate. The resulting videos are
suitable for FlowPlayer and probably YouTube. There are a metric
ton of reasonable presets in the XML file above, and they have
descriptions. You can roll your own script(s) from that in about
30 seconds depending on your needs, or modify the command lines to
get something different.
There's probably something more polished out there, but the video
re-encoding projects I found via freshmeat/sourceforge were all
half-finished or special purpose.
--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see
More information about the PLUG-discuss
mailing list