Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg - whatsapp: video format not supported

I have two videos (.mp4) files. One uploads to whatsapp and another does not.

Using ffmpeg I checked their properties:

a) Properties of video which uploads:

  Duration: 00:00:56.45, start: 0.148000, bitrate: 1404 kb/s     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x1080, 1359 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)     Metadata:       handler_name    : VideoHandler     Stream #0:1(eng): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s (default)     Metadata:       handler_name    : SoundHandler At least one output file must be specified 

b) video which does not upload to whatsapp (because its says format not supported)

  Duration: 00:00:56.10, start: 0.000000, bitrate: 543 kb/s     Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p, 1080x1080 [SAR 1:1 DAR 1:1], 464 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 47.95 tbc     Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 56 kb/s 

The difference in video I noticed:

(avc1 / 0x31637661) vs (H264 / 0x34363248)

1359 kb/s vs 464 kb/s

90k tbn vs 23.98 tbn

What can be the reason?

Also the second video is not being played in Android.

The link for the video is https://drive.google.com/open?id=0B4UM6vTHw4pyMExQQ1lxZGp0N2c

like image 502
Santhosh Avatar asked Oct 06 '16 05:10

Santhosh


People also ask

Which format of video is supported by WhatsApp?

WhatsApp supports H. 264 and MPEG-4 codec for videos and audio, AAC, and AC3. Moving on, the WhatsApp-supported video formats include MP4, MKV, AVI, MOV, and also 3GP.

Is MP4 format not supported in WhatsApp?

WhatsApp does not support all the video formats out there. As a matter of fact, the platform currently supports only MP4, MKV, AVI, 3GP, and MOV files. Sometimes, it's the encoding or the audio codec that's preventing you from sending videos to your contacts.

Does FFmpeg work with MP4?

FFmpeg can input most container formats natively, including MP4, . ts, MOV, AVI, Y4M, MKV, and many others. This is the output file. No switch necessary; just the file name.


1 Answers

There are some options for a better compatibility:

ffmpeg -i broken.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p working.mp4

With -profile:v baseline -level 3.0 you make the file more compatible with most older players, including WhatsApp ;). Although, this disables some advanced features.

-pix_fmt yuv420p is necessary to compile to baseline (YUV planar color space with 4:2:0 chroma subsampling).

Also, you can adjust other options as bitrate, framerate, audio, etc.

Source: H.264 docs

like image 113
Mario Mey Avatar answered Sep 28 '22 23:09

Mario Mey