FFmpeg Tips

Have a static image displayed while a song plays.

    $ ffmpeg -i audio.mp3 -loop_input -i albumcover.jpg -vcodec libx264 -preset slow -crf 20 -threads 0 -acodec copy -shortest output.mkv 

Have a static image displayed while the whole album plays as one long track. This command assumes your input files, *mp3, have 2 channels and the sampling rate is 44100. Run ffmpeg -i on your input audio files to determine the correct settings for these values.

    $ ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i <(for i in *mp3;do ffmpeg -i "$i" -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -y /dev/stdout 2>/dev/null;done) -loop_input -i albumcover.jpg -vcodec libx264 -preset slow -crf 20 -threads 0 -acodec flac -shortest output.mkv

I have no idea why anyone would want this but here's how to encode a movie that plays backwards. People have requested this in #ffmpeg.
    Dump all video frames
    $ ffmpeg -i input.mkv -an -qscale 1 %06d.jpg

    Dump audio
    $ ffmpeg -i input.mkv -vn -ac 2 audio.wav

    Reverse audio
    $ sox -V audio.wav backwards.wav reverse

    Cat video frames in reverse order to FFmpeg as input
    $ cat $(ls -t *jpg) | ffmpeg -f image2pipe -vcodec mjpeg -r 25 -i - -i backwards.wav -vcodec libx264 -preset slow -crf 20 -threads 0 -acodec flac output.mkv

Use mencoder to deinterlace PAL dv and double the frame rate from 25 to 50, then pipe to FFmpeg.

    $ mencoder input.dv -of rawvideo -ofps 50 -ovc raw -vf yadif=3,format=i420 -nosound -really-quiet -o - | ffmpeg -vsync 0 -f rawvideo -s 720x576 -r 50 -pix_fmt yuv420p -i - -vcodec libx264 -preset slow -crf 20 -threads 0 video.mkv

FFmpeg provides better compression than the flac reference encoder. Omitting -use_lpc 8 will give you slightly larger files but the time spent encoding will be considerably less.
    $ ffmpeg -i input.wav -compression_level 12 -use_lpc 8 output.flac