3

I'm trying to convert a video to in order to upload it on twitter. The Twitter requirements are:

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

The original resolution was 3600x1200, but after running

ffmpeg -i output.mp4 -filter:v "scale='min(1280,iw)':min'(720,ih)':force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output_twitter.mp4

It still doesn't change the aspect ratio (visually) when I open it with a GUI player (the resolution seems lower though). However, from the command line, mediainfo seems to suggest that the output resolution is now 1280x720:

mediainfo output_twitter.mp4  

General
Complete name                            : output_twitter.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 842 KiB
Duration                                 : 24 s 0 ms
Overall bit rate                         : 287 kb/s
Writing application                      : Lavf57.83.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 4:4:4 Predictive@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 24 s 0 ms
Bit rate                                 : 285 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Original display aspect ratio            : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Chroma subsampling                       : 4:4:4
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.012
Stream size                              : 834 KiB (99%)
Writing library                          : x264 core 152 r2854 e9a5903
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=4 / threads=22 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Twitter still doesn't accept it. Any ideas for what I'm doing wrong? Thanks

Edit: you can download the video here: https://wetransfer.com/downloads/c2a0143ca4f0a2a7b8bac0de36dd2cf620200228175053/ab0c28e7f09cb456b2cf30c9bb7827dc20200228175053/440f1f

1 Answer 1

3

Most platforms don't like full chroma formats, so add -pix_fmt yuv420p. Remaining parameters look acceptable.

2
  • Thanks! That worked. Feb 28, 2020 at 20:37
  • @RazvanValentinMarinescu Or append format=yuv420p to your filterchain. No difference since -pix_fmt yuv420p is an alias for format filter, but it is tidier.
    – llogan
    Feb 28, 2020 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.