Posted on Sa 18 Februar 2017

Encode videos to send via WhatsApp

WhatsApp currently is kind of picky about the video format that supports. To my knowledge only: MP4 (H264 + aac)

I use avconv to convert my existing video files:

INPUT_FILE=~/vids/ground_spiral.MP4

avconv -i $INPUT_FILE \
       -f mp4 -c:v h264 -b:v 1200k -g 300 -bf 2 -s 640x352 \
       -c:a aac -b:a 64k -ac 1 \
       /tmp/output.MP4

You can try with different settings for better quality. In the example it will reencode the video with a bitrate of 1200k and a resolution of 640x352. Audio will have a bitrate of 64k and it will be monoaural (use -ac 2 for stereo).

To only convert a part of the original video specify start and end like this:

-ss 00:1:02 -to 00:2:43

Author: Maximiliano Padulo

Category: misc

Tags: video, encoding, whatsapp

© Maximiliano Padulo. Site built with Pelican. Theme forked from perec. Member of the Internet Defense League.