Thursday 23 February 2012

ffmpeg: transpose and watermark together

Command to transpose and watermark a video at the same time using ffmpeg:

ffmpeg -i test.mp4 -vf 'movie=watermark.png [watermark]; [in] transpose=1 [trans]; [trans][watermark] overlay=2:2 [out]' -y output.mp4

Good luck!

Tuesday 21 February 2012

Google Apps: Mail server settings

To configure Google apps as the mail server for your domain (provided you have created the MX records on your domain), use these settings:


    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
      :address              => 'smtp.gmail.com',
      :port                 => 587,
      :domain               => 'domain.com',
      :user_name            => 'user@domain.com',
      :password             => 'password',
      :authentication       => 'plain',
      :enable_starttls_auto => true
    }

Thursday 16 February 2012

ffmpeg: video conversion parameters

Sample ffmpeg conversion command - iOS and Android compatible.

ffmpeg -i test.mov -s 432x320 -vcodec libx264 -coder 0 -trellis 0 -bf 0 -subq 6 -refs 5 -me_range 16 -g 250 -sc_threshold 40 -keyint_min 25 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -acodec libfaac -ac 2 -b:v 384k -ar 16000 -ab 32000 -r 25 -partitions +parti4x4+parti8x8+partp4x4+partp8x8 -cmp 256 -flags +loop+mv4 -aspect 3:2 -y output.mp4


Tuesday 7 February 2012

Unix: Search and replace script

Simple Unix command to replace text within a directory.

find app/views/ -type f -print0 | xargs -0 sed -i 's/SearchText/ReplaceText/g'