MediaBashing

From XPUB & Lens-Based wiki

core concepts: bitmap, PCM, frame rate, sampling rate, frame size, data rate, compression, lossless vs. lossy compression, codecs, spatial compression, temporal compression, keyframes, VBR, 2-pass encoding


http://en.wikipedia.org/wiki/Pulse-code_modulation http://en.wikipedia.org/wiki/Video_compression

Examples

Examples of appending images in bash, including a simply "flow" layout algorithm... BashAppendingImages

Encoding Videos (including flash flv's) to DIVX/AVI with mencoder

Basically to encode any format that mplayer understands to a divx file (which is a version of mpeg4, and typically stored in an "avi" format file), you use something along the lines of:

mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=600 -o newmovie.avi sourcemovie.flv

This specifies the "libavcodec" (lavc) to do the video compression, and options to that (separate) library are given as "lavcopts". To, for instance, specify an output frame frame (ofps) of 15fps *and* to limit the maximum number of frames between keyframes to one second (15 frame thus), you could use:

mencoder -oac mp3lame -ofps 15 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=600:keyint=15 -o newmovie.avi sourcemovie.flv

Images to movie

with ffmpeg

ffmpeg -y -r 3 -b 1800 -sameq -i frames/%06d.png foo.mp4

source: http://electron.mit.edu/~gsteele/ffmpeg/

with mencoder

mencoder "mf://*.jpg" -o movie.avi -ovc lavc -lavcopts vcodec=mjpeg

source: http://www.gfd.geophys.ethz.ch/~pjt/makingMovies.html also: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-enc-images.html

Movie to images

with ffmpeg

ffmpeg -i movie.avi -f image2 -y -r .01 -an frame %06d.jpg
ffmpeg -i FILE0007.MOV -f image2 -y -an frame%06d.png
ffmpeg -i source.mov -an -y -t 0:0:0.001 -f image2 poster.png
ffmpeg -i source.mov -an -y -ss 0:01:30 -t 0:0:0.001 -f image2 frame.png

mplayer

mplayer -vo png rearwindow.avi


Important command line tools

video

audio

  • ["sox"]

Other useful (GUI) apps

Audacity, Kino

Resources

older page

MoreMediaBashing