Symptom
I created a twitter bot with ffmpeg-python. When I uploaded a video created by ffmpeg-python to twitter, it returned [{‘code’: 324, ‘message’: ‘Not valid video’}] error.
Cause
The video was encoded by mp4, which is obsolete for twitter.
Solution
Use the h264 codec for twitter.
ffmpeg.output(video, video_out, vcodec=’h264′)