I tried to upload a video file (mp4) to Twitter but the site complained it couldn't be uploaded. It seems Twitter has some conditions in order to allow a video upload:
File Type: MP4 or MOV
Max Time: 2 minutes and 20 seconds
Minimum Resolution: 32 x 32
Maximum Resolution: 1920 x 1200
Aspect Ratios: 1:2.39 - 2.39:1 range (inclusive)
Maximum Frame rate: 40 fps
Maximum Video Bitrate: 25 Mbps
And here you are the general infos about the video I was trying to upload but Twitter kept saying there was a problem while processing it (the infos I got through mediainfo):
General
Complete name : tmp03.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/mp41)
File size : 6.71 MiB
Duration : 2mn 15s
Overall bit rate mode : Constant
Overall bit rate : 417 Kbps
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Writing application : Lavf58.29.100
Video
ID : 1
Format : MPEG-4 Visual
Format profile : Simple@L1
Format settings, BVOP : No
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : 20
Duration : 2mn 15s
Bit rate mode : Constant
Bit rate : 281 Kbps
Width : 720 pixels
Height : 405 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.032
Stream size : 4.52 MiB (67%)
Writing library : Lavc58.54.100
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 2mn 15s
Duration_LastFrame : -19ms
Bit rate mode : Constant
Bit rate : 129 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Frame rate : 46.875 fps (1024 spf)
Compression mode : Lossy
Stream size : 2.07 MiB (31%)
Default : Yes
Alternate group : 1
Encoded date : UTC 1904-01-01 00:00:00
Tagged date : UTC 1904-01-01 00:00:00
Can you tell me what's wrong with the video file??
Best regards!
Twitter does not accept MPEG-4 Part 2 video. This is an old video format. Re-encode to H.264:
ffmpeg -i input.mp4 -c:v libx264 -crf 20 -preset slow -vf format=yuv420p -c:a aac -movflags +faststart output.mp4
not divisible by 2
error see this answer.-c:a aac
to -c:a copy
to preserve the audio quality.option | explanation |
---|---|
-c:v libx264 |
Chooses video encoder libx264 |
-crf 20 |
x264 quality level |
-preset slow |
x264 encoding speed vs compression efficiency preset |
-vf format=yuv420p |
Ensures YUV 4:2:0 chroma subsampling for compatibility |
-c:a aac |
Chooses audio encoder aac |
-movflags +faststart |
Enables fast start: may allow Twitter to begin processing faster |