I'm using FFmpeg to create a video from an audio track and a sequence of jpeg images (it's a 5fps animation. I've tried variations of CRF 0, 17 and 23 and I've tried 2 pass encoding with a bit rate of 2600k and the result is always the same. The video is fine on my laptop. When I upload it to Twitter the video is terrible quality to start with, including video and audio glitches (in the same place, regardless of CRF setting) when playing in a web browser. The quality is bad on the Twitter app at the beginning but the glitches aren't there. The video looks fine in YouTube when I upload it there.

When I watch other videos uploaded directly to Twitter they look fine for the entire video.

Any idea what's going on? I figure it must be something in my settings that is causing a problem when Twitter re-encodes the file.

These are my settings:

./ffmpeg -f image2 -pattern_type glob -framerate 5 -i 'frames//.jpeg' -i "audio.wav" -filter_complex "[1:0]apad" -shortest -c:v libx264 -crf 17 -pix_fmt yuv420p -c:a aac -b:a 528k -map_chapters -1 -s 1920x1080 -movflags +faststart "output.mp4"

./ffmpeg -pattern_type glob -framerate 5 -pix_fmt yuv420p -i 'frames/*/*.jpeg' -i audio/audio.wav -filter_complex "[1:0]apad" -shortest -c:a aac -b:a 528k -c:v libx264 -crf 17 -s 1920x1080 -movflags +faststart -r 25 output.mp4
ffmpeg version 3.4-tessus Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, image2, from 'frames/*/*.jpeg':
  Duration: 00:01:09.80, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1920x1080, 5 fps, 5 tbr, 5 tbn, 5 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'audio/audio.wav':
    encoded_by      : Logic Pro
    date            : 2017-11-27
    creation_time   : 09:21:01
    time_reference  : 158760000
    umid            : 0x00BFF090FFBFF890FFBFF890FFBF0091FFBF0091FFBF0891FFBF0891FFBF1091FFBF1091FFBF1891FFBF1891FFBF2091FFBF2091FFBF2891FFBF2891FFBF3091
    coding_history  : 
  Duration: 00:01:06.92, bitrate: 2119 kb/s
    Stream #1:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s32 (24 bit), 2116 kb/s
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #1:0 (pcm_s24le) -> apad (graph 0)
  apad (graph 0) -> Stream #0:0 (aac)
  Stream #0:0 -> #0:1 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[image2 @ 0x7fcf4b809800] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[libx264 @ 0x7fcf4b818c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x7fcf4b818c00] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264 @ 0x7fcf4b818c00] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 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=17.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
    encoder         : Lavf57.83.100
    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp (24 bit), 528 kb/s
      encoder         : Lavc57.107.100 aac
    Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuvj444p(pc), 1920x1080, q=-1--1, 25 fps, 12800 tbn, 25 tbc
      encoder         : Lavc57.107.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=   30 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=24 drframe=   55 fps= 34 q=22.0 size=     256kB time=00:00:00.08 bitrate=26193.7kbitsframe=   55 fps= 25 q=22.0 size=     256kB time=00:00:00.08 bitrate=26193.7kbitsframe=   60 fps= 16 q=22.0 size=     256kB time=00:00:00.28 bitrate=7489.1kbits/frame=   65 fps= 14 q=22.0 size=    1280kB time=00:00:00.48 bitrate=21842.6kbitsframe=   70 fps= 13 q=22.0 size=    1792kB time=00:00:00.68 bitrate=21586.4kbitsframe=   80 fps= 11 q=22.0 size=    2048kB time=00:00:01.08 bitrate=15533.7kbitsframe=   85 fps= 10 q=22.0 size=    3072kB time=00:00:01.28 bitrate=19659.9kbitsframe=   90 fps= 10 q=22.0 size=    3584kB time=00:00:01.48 bitrate=19837.1kbitsframe=   95 fps= 10 q=22.0 size=    3840kB time=00:00:01.68 bitrate=18723.9kbitsframe=  100 fps=8.8 q=22.0 size=    3840kB time=00:00:01.88 bitrate=16732.1kbitsframe=  110 fps=9.1 q=22.0 size=    4864kB time=00:00:02.28 bitrate=17475.8kbitsframe=  115 fps=8.5 q=22.0 size=    5888kB time=00:00:02.48 bitrate=19448.9kbitsframe=  120 fps=8.2 q=22.0 size=    6400kB time=00:00:02.68 bitrate=19562.6kbitsframe=  130 fps=8.6 q=22.0 size=    7168kB time=00:00:03.08 bitrate=19064.7kbitsframe=  135 fps=8.1 q=22.0 size=    7168kB time=00:00:03.28 bitrate=17902.2kbitsframe=  140 fps=8.0 q=22.0 size=    8192kB time=00:00:03.48 bitrate=19283.8kbitsframe=  150 fps=8.1 q=22.0 size=    8704kB time=00:00:03.88 bitrate=18376.8kbitsframe=  155 fps=7.7 q=22.0 size=    9216kB time=00:00:04.08 bitrate=18504.0kbitsframe=  160 fps=7.5 q=22.0 size=   10240kB time=00:00:04.28 bitrate=19599.3kbitsframe=  165 fps=7.5 q=22.0 size=   10496kB time=00:00:04.48 bitrate=19192.4kbitsframe=  175 fps=7.6 q=22.0 size=   11008kB time=00:00:04.88 bitrate=18478.8kbitsframe=  180 fps=7.4 q=22.0 size=   12032kB time=00:00:05.08 bitrate=19402.6kbitsframe=  185 fps=7.4 q=22.0 size=   12544kB time=00:00:05.28 bitrate=19462.0kbitsframe=  195 fps=7.6 q=22.0 size=   13568kB time=00:00:05.68 bitrate=19568.3kbitsframe=  200 fps=7.4 q=22.0 size=   13568kB time=00:00:05.88 bitrate=18902.7kbitsframe=  210 fps=7.6 q=22.0 size=   14592kB time=00:00:06.28 bitrate=19034.5kbitsframe=  215 fps=7.4 q=22.0 size=   15104kB time=00:00:06.48 bitrate=19094.3kbitsframe=  220 fps=7.3 q=22.0 size=   15872kB time=00:00:06.68 bitrate=19464.4kbitsframe=  230 fps=7.4 q=22.0 size=   16896kB time=00:00:07.08 bitrate=19549.6kbitsframe=  235 fps=7.4 q=22.0 size=   16896kB time=00:00:07.28 bitrate=19012.5kbitsframe=  245 fps=7.4 q=22.0 size=   18432kB time=00:00:07.68 bitrate=19660.7kbitsframe=  250 fps=7.3 q=22.0 size=   18688kB time=00:00:07.88 bitrate=19427.8kbitsframe=  260 fps=7.4 q=22.0 size=   19712kB time=00:00:08.28 bitrate=19502.4kbitsframe=  265 fps=7.3 q=22.0 size=   19712kB time=00:00:08.48 bitrate=19042.4kbitsframe=  270 fps=7.2 q=22.0 size=   20480kB time=00:00:08.68 bitrate=19328.5kbitsframe=  280 fps=7.4 q=22.0 size=   20992kB time=00:00:09.08 bitrate=18938.9kbitsframe=  285 fps=7.2 q=22.0 size=   21760kB time=00:00:09.28 bitrate=19208.7kbitsframe=  290 fps=7.2 q=22.0 size=   22272kB time=00:00:09.48 bitrate=19245.9kbitsframe=  295 fps=7.2 q=22.0 size=   22784kB time=00:00:09.70 bitrate=19230.2kbitsframe=  305 fps=7.3 q=22.0 size=   22784kB time=00:00:10.08 bitrate=18516.4kbitsframe=  310 fps=7.2 q=22.0 size=   23296kB time=00:00:10.28 bitrate=18564.2kbitsframe=  320 fps=7.4 q=22.0 size=   24064kB time=00:00:10.68 bitrate=18458.0kbitsframe=  325 fps=7.3 q=22.0 size=   24064kB time=00:00:10.88 bitrate=18118.7kbitsframe=  330 fps=7.2 q=22.0 size=   24320kB time=00:00:11.08 bitrate=17980.9kbitsframe=  340 fps=7.4 q=22.0 size=   24832kB time=00:00:11.48 bitrate=17719.8kbitsframe=  345 fps=7.3 q=22.0 size=   25088kB time=00:00:11.68 bitrate=17595.9kbitsframe=  350 fps=7.3 q=22.0 size=   25344kB time=00:00:11.88 bitrate=17476.2kbitsframe=  360 fps=7.4 q=22.0 size=   25856kB time=00:00:12.28 bitrate=17248.5kbitsframe=  365 fps=7.4 q=22.0 size=   25856kB time=00:00:12.48 bitrate=16972.1kbitsframe=  370 fps=7.4 q=22.0 size=   26368kB time=00:00:12.68 bitrate=17035.2kbitsframe=  380 fps=7.5 q=22.0 size=   26880kB time=00:00:13.08 bitrate=16834.9kbitsframe=  385 fps=7.4 q=22.0 size=   26880kB time=00:00:13.28 bitrate=16581.3kbitsframe=  390 fps=7.4 q=22.0 size=   27392kB time=00:00:13.48 bitrate=16646.5kbitsframe=  400 fps=7.5 q=22.0 size=   27904kB time=00:00:13.88 bitrate=16468.9kbitsframe=  410 fps=7.5 q=22.0 size=   28160kB time=00:00:14.28 bitrate=16154.5kbitsframe=  415 fps=7.4 q=22.0 size=   28672kB time=00:00:14.48 bitrate=16221.0kbitsframe=  425 fps=7.6 q=22.0 size=   29184kB time=00:00:14.88 bitrate=16066.8kbitsframe=  430 fps=7.5 q=22.0 size=   29184kB time=00:00:15.08 bitrate=15853.7kbitsframe=  435 fps=7.5 q=22.0 size=   29696kB time=00:00:15.28 bitrate=15920.7kbitsframe=  445 fps=7.6 q=22.0 size=   30208kB time=00:00:15.68 bitrate=15782.1kbitsframe=  455 fps=7.6 q=22.0 size=   30464kB time=00:00:16.08 bitrate=15519.9kbitsframe=  460 fps=7.6 q=22.0 size=   30976kB time=00:00:16.28 bitrate=15586.9kbitsframe=  470 fps=7.7 q=22.0 size=   31488kB time=00:00:16.68 bitrate=15464.6kbitsframe=  475 fps=7.6 q=22.0 size=   31488kB time=00:00:16.88 bitrate=15281.3kbitsframe=  480 fps=7.6 q=22.0 size=   31744kB time=00:00:17.08 bitrate=15225.2kbitsframe=  485 fps=7.6 q=22.0 size=   32000kB time=00:00:17.28 bitrate=15170.3kbitsframe=  495 fps=7.6 q=22.0 size=   32256kB time=00:00:17.68 bitrate=14945.7kbitsframe=  500 fps=7.6 q=22.0 size=   32768kB time=00:00:17.88 bitrate=15013.1kbitsframe=  510 fps=7.7 q=22.0 size=   33024kB time=00:00:18.28 bitrate=14799.3kbitsframe=  515 fps=7.6 q=22.0 size=   33024kB time=00:00:18.48 bitrate=14639.2kbitsframe=  520 fps=7.6 q=22.0 size=   33536kB time=00:00:18.68 bitrate=14707.0kbitsframe=  525 fps=7.6 q=22.0 size=   34048kB time=00:00:18.92 bitrate=14738.8kbitsframe=  535 fps=7.7 q=22.0 size=   34048kB time=00:00:19.28 bitrate=14466.8kbitsframe=  545 fps=7.7 q=22.0 size=   34560kB time=00:00:19.68 bitrate=14385.9kbitsframe=  550 fps=7.7 q=22.0 size=   34816kB time=00:00:19.88 bitrate=14346.7kbitsframe=  560 fps=7.7 q=22.0 size=   35328kB time=00:00:20.28 bitrate=14270.5kbitsframe=  565 fps=7.7 q=22.0 size=   35328kB time=00:00:20.48 bitrate=14131.2kbitsframe=  570 fps=7.6 q=22.0 size=   35840kB time=00:00:20.68 bitrate=14197.3kbitsframe=  580 fps=7.7 q=22.0 size=   36096kB time=00:00:21.08 bitrate=14027.4kbitsframe=  585 fps=7.7 q=22.0 size=   36096kB time=00:00:21.28 bitrate=13895.6kbitsframe=  590 fps=7.6 q=22.0 size=   36608kB time=00:00:21.48 bitrate=13961.5kbitsframe=  595 fps=7.7 q=22.0 size=   36864kB time=00:00:21.68 bitrate=13929.4kbitsframe=  605 fps=7.7 q=22.0 size=   37120kB time=00:00:22.08 bitrate=13772.0kbitsframe=  615 fps=7.7 q=22.0 size=   37632kB time=00:00:22.50 bitrate=13701.3kbitsframe=  620 fps=7.7 q=22.0 size=   37888kB time=00:00:22.68 bitrate=13685.1kbitsframe=  625 fps=7.7 q=22.0 size=   38144kB time=00:00:22.88 bitrate=13657.1kbitsframe=  635 fps=7.8 q=22.0 size=   38656kB time=00:00:23.28 bitrate=13602.6kbitsframe=  640 fps=7.7 q=22.0 size=   38656kB time=00:00:23.48 bitrate=13486.8kbitsframe=  645 fps=7.7 q=22.0 size=   39168kB time=00:00:23.68 bitrate=13550.0kbitsframe=  655 fps=7.8 q=22.0 size=   39424kB time=00:00:24.08 bitrate=13412.0kbitsframe=  660 fps=7.7 q=22.0 size=   39680kB time=00:00:24.28 bitrate=13387.9kbitsframe=  665 fps=7.7 q=22.0 size=   39936kB time=00:00:24.48 bitrate=13364.2kbitsframe=  670 fps=7.7 q=22.0 size=   40192kB time=00:00:24.68 bitrate=13340.9kbitsframe=  680 fps=7.8 q=22.0 size=   40448kB time=00:00:25.08 bitrate=13211.7kbitsframe=  690 fps=7.8 q=22.0 size=   40960kB time=00:00:25.48 bitrate=13168.9kbitsframe=  695 fps=7.8 q=22.0 size=   41472kB time=00:00:25.68 bitrate=13229.7kbitsframe=  705 fps=7.8 q=22.0 size=   41984kB time=00:00:26.08 bitrate=13187.6kbitsframe=  710 fps=7.8 q=22.0 size=   42240kB time=00:00:26.28 bitrate=13167.0kbitsframe=  715 fps=7.7 q=22.0 size=   42240kB time=00:00:26.48 bitrate=13067.6kbitsframe=  725 fps=7.7 q=22.0 size=   42752kB time=00:00:26.88 bitrate=13029.2kbitsframe=  735 fps=7.8 q=22.0 size=   43008kB time=00:00:27.28 bitrate=12915.0kbitsframe=  740 fps=7.7 q=22.0 size=   43264kB time=00:00:27.48 bitrate=12897.3kbitsframe=  745 fps=7.7 q=22.0 size=   43776kB time=00:00:27.68 bitrate=12955.6kbitsframe=  750 fps=7.7 q=22.0 size=   44032kB time=00:00:27.88 bitrate=12937.9kbitsframe=  760 fps=7.7 q=22.0 size=   44288kB time=00:00:28.28 bitrate=12829.1kbitsframe=  765 fps=7.7 q=22.0 size=   44800kB time=00:00:28.48 bitrate=12886.3kbitsframe=  775 fps=7.8 q=22.0 size=   45312kB time=00:00:28.88 bitrate=12853.0kbitsframe=  780 fps=7.7 q=22.0 size=   45312kB time=00:00:29.08 bitrate=12764.6kbitsframe=  785 fps=7.7 q=22.0 size=   45568kB time=00:00:29.28 bitrate=12749.1kbitsframe=  790 fps=7.7 q=22.0 size=   45824kB time=00:00:29.48 bitrate=12733.7kbitsframe=  800 fps=7.7 q=22.0 size=   46080kB time=00:00:29.88 bitrate=12633.4kbitsframe=  805 fps=7.7 q=22.0 size=   46592kB time=00:00:30.08 bitrate=12688.9kbitsframe=  815 fps=7.7 q=22.0 size=   47104kB time=00:00:30.48 bitrate=12660.0kbitsframe=  820 fps=7.7 q=22.0 size=   47104kB time=00:00:30.68 bitrate=12577.4kbitsframe=  825 fps=7.7 q=22.0 size=   47616kB time=00:00:30.88 bitrate=12631.8kbitsframe=  830 fps=7.7 q=22.0 size=   47616kB time=00:00:31.08 bitrate=12550.5kbitsframe=  840 fps=7.7 q=22.0 size=   48128kB time=00:00:31.48 bitrate=12524.3kbitsframe=  845 fps=7.7 q=22.0 size=   48128kB time=00:00:31.68 bitrate=12445.2kbitsframe=  850 fps=7.7 q=22.0 size=   48640kB time=00:00:31.88 bitrate=12498.7kbitsframe=  860 fps=7.8 q=22.0 size=   49152kB time=00:00:32.28 bitrate=12473.7kbitsframe=  865 fps=7.7 q=22.0 size=   49152kB time=00:00:32.48 bitrate=12396.9kbitsframe=  870 fps=7.7 q=22.0 size=   49408kB time=00:00:32.68 bitrate=12385.2kbitsframe=  880 fps=7.7 q=22.0 size=   49920kB time=00:00:33.08 bitrate=12362.3kbitsframe=  885 fps=7.7 q=22.0 size=   49920kB time=00:00:33.28 bitrate=12288.0kbitsframe=  890 fps=7.7 q=22.0 size=   50176kB time=00:00:33.48 bitrate=12277.2kbitsframe=  900 fps=7.8 q=22.0 size=   50688kB time=00:00:33.88 bitrate=12256.1kbitsframe=  905 fps=7.7 q=22.0 size=   50688kB time=00:00:34.08 bitrate=12184.1kbitsframe=  915 fps=7.7 q=22.0 size=   51200kB time=00:00:34.48 bitrate=12164.4kbitsframe=  920 fps=7.7 q=22.0 size=   51712kB time=00:00:34.68 bitrate=12215.2kbitsframe=  930 fps=7.8 q=22.0 size=   51968kB time=00:00:35.08 bitrate=12135.7kbitsframe=  935 fps=7.8 q=22.0 size=   51968kB time=00:00:35.28 bitrate=12066.9kbitsframe=  940 fps=7.7 q=22.0 size=   52480kB time=00:00:35.48 bitrate=12117.1kbitsframe=  950 fps=7.8 q=22.0 size=   52992kB time=00:00:35.88 bitrate=12098.9kbitsframe=  955 fps=7.8 q=22.0 size=   52992kB time=00:00:36.08 bitrate=12031.9kbitsframe=  960 fps=7.8 q=22.0 size=   53248kB time=00:00:36.28 bitrate=12023.3kbitsframe=  970 fps=7.8 q=22.0 size=   53760kB time=00:00:36.68 bitrate=12006.6kbitsframe=  975 fps=7.8 q=22.0 size=   53760kB time=00:00:36.88 bitrate=11941.5kbitsframe=  985 fps=7.8 q=22.0 size=   54272kB time=00:00:37.28 bitrate=11925.8kbitsframe=  990 fps=7.8 q=22.0 size=   54272kB time=00:00:37.48 bitrate=11862.2kbitsframe=  995 fps=7.8 q=22.0 size=   54784kB time=00:00:37.68 bitrate=11910.6kbitsframe= 1005 fps=7.8 q=22.0 size=   55296kB time=00:00:38.08 bitrate=11895.6kbitsframe= 1010 fps=7.8 q=22.0 size=   55296kB time=00:00:38.28 bitrate=11833.4kbitsframe= 1015 fps=7.8 q=22.0 size=   55552kB time=00:00:38.48 bitrate=11826.4kbitsframe= 1020 fps=7.8 q=22.0 size=   55808kB time=00:00:38.68 bitrate=11819.5kbitsframe= 1030 fps=7.8 q=22.0 size=   56064kB time=00:00:39.08 bitrate=11752.2kbitsframe= 1035 fps=7.8 q=22.0 size=   56576kB time=00:00:39.28 bitrate=11799.1kbitsframe= 1045 fps=7.8 q=22.0 size=   56832kB time=00:00:39.68 bitrate=11733.0kbitsframe= 1050 fps=7.8 q=22.0 size=   56832kB time=00:00:39.88 bitrate=11674.2kbitsframe= 1055 fps=7.8 q=22.0 size=   57344kB time=00:00:40.08 bitrate=11720.6kbitsframe= 1065 fps=7.8 q=22.0 size=   57856kB time=00:00:40.48 bitrate=11708.4kbitsframe= 1075 fps=7.9 q=22.0 size=   57856kB time=00:00:40.88 bitrate=11593.8kbitsframe= 1080 fps=7.9 q=22.0 size=   58368kB time=00:00:41.08 bitrate=11639.5kbitsframe= 1085 fps=7.9 q=22.0 size=   58624kB time=00:00:41.28 bitrate=11633.9kbitsframe= 1095 fps=7.9 q=22.0 size=   59136kB time=00:00:41.68 bitrate=11622.9kbitsframe= 1100 fps=7.9 q=22.0 size=   59392kB time=00:00:41.88 bitrate=11617.4kbitsframe= 1105 fps=7.9 q=22.0 size=   59392kB time=00:00:42.08 bitrate=11562.2kbitsframe= 1115 fps=7.9 q=22.0 size=   59904kB time=00:00:42.48 bitrate=11552.1kbitsframe= 1120 fps=7.9 q=22.0 size=   59904kB time=00:00:42.68 bitrate=11498.0kbitsframe= 1125 fps=7.9 q=22.0 size=   60416kB time=00:00:42.88 bitrate=11542.1kbitsframe= 1135 fps=7.9 q=22.0 size=   60672kB time=00:00:43.28 bitrate=11483.9kbitsframe= 1140 fps=7.9 q=22.0 size=   60672kB time=00:00:43.48 bitrate=11431.1kbitsframe= 1145 fps=7.9 q=22.0 size=   61184kB time=00:00:43.68 bitrate=11474.8kbitsframe= 1160 fps=7.9 q=22.0 size=   61696kB time=00:00:44.28 bitrate=11414.0kbitsframe= 1165 fps=7.9 q=22.0 size=   61952kB time=00:00:44.48 bitrate=11409.9kbitsframe= 1175 fps=7.9 q=22.0 size=   62464kB time=00:00:44.88 bitrate=11401.6kbitsframe= 1185 fps=8.0 q=22.0 size=   62720kB time=00:00:45.28 bitrate=11347.2kbitsframe= 1190 fps=8.0 q=22.0 size=   62976kB time=00:00:45.48 bitrate=11343.4kbitsframe= 1195 fps=8.0 q=22.0 size=   63232kB time=00:00:45.68 bitrate=11339.7kbitsframe= 1205 fps=8.0 q=22.0 size=   63744kB time=00:00:46.08 bitrate=11332.3kbitsframe= 1210 fps=7.9 q=22.0 size=   63744kB time=00:00:46.28 bitrate=11283.3kbitsframe= 1215 fps=7.9 q=22.0 size=   64256kB time=00:00:46.48 bitrate=11325.0kbitsframe= 1220 fps=7.9 q=22.0 size=   64512kB time=00:00:46.68 bitrate=11321.4kbitsframe= 1230 fps=7.9 q=22.0 size=   64512kB time=00:00:47.08 bitrate=11225.2kbitsframe= 1235 fps=7.9 q=22.0 size=   65024kB time=00:00:47.28 bitrate=11266.4kbitsframe= 1245 fps=8.0 q=22.0 size=   65536kB time=00:00:47.68 bitrate=11259.9kbitsframe= 1250 fps=7.9 q=22.0 size=   65536kB time=00:00:47.88 bitrate=11212.8kbitsMore than 1000 frames duplicated   
frame= 1255 fps=7.9 q=22.0 size=   65792kB time=00:00:48.08 bitrate=11209.8kbitsframe= 1265 fps=8.0 q=22.0 size=   66304kB time=00:00:48.48 bitrate=11203.8kbitsframe= 1270 fps=7.9 q=22.0 size=   66304kB time=00:00:48.68 bitrate=11157.8kbitsframe= 1285 fps=7.9 q=22.0 size=   66816kB time=00:00:49.28 bitrate=11107.1kbitsframe= 1290 fps=7.9 q=22.0 size=   67328kB time=00:00:49.48 bitrate=11146.9kbitsframe= 1300 fps=8.0 q=22.0 size=   67840kB time=00:00:49.88 bitrate=11141.6kbitsframe= 1305 fps=7.9 q=22.0 size=   67840kB time=00:00:50.08 bitrate=11097.1kbitsframe= 1310 fps=7.9 q=22.0 size=   68096kB time=00:00:50.28 bitrate=11094.7kbitsframe= 1320 fps=8.0 q=22.0 size=   68608kB time=00:00:50.68 bitrate=11089.9kbitsframe= 1325 fps=7.9 q=22.0 size=   68608kB time=00:00:50.88 bitrate=11046.3kbitsframe= 1330 fps=7.9 q=22.0 size=   68864kB time=00:00:51.08 bitrate=11044.1kbitsframe= 1340 fps=8.0 q=22.0 size=   69376kB time=00:00:51.48 bitrate=11039.8kbitsframe= 1350 fps=8.0 q=22.0 size=   69632kB time=00:00:51.88 bitrate=10995.1kbitsframe= 1355 fps=7.9 q=22.0 size=   70144kB time=00:00:52.08 bitrate=11033.4kbitsframe= 1365 fps=8.0 q=22.0 size=   70656kB time=00:00:52.48 bitrate=11029.2kbitsframe= 1370 fps=7.9 q=22.0 size=   70912kB time=00:00:52.68 bitrate=11027.2kbitsframe= 1375 fps=7.9 q=22.0 size=   70912kB time=00:00:52.88 bitrate=10985.5kbitsframe= 1385 fps=8.0 q=22.0 size=   71424kB time=00:00:53.28 bitrate=10981.7kbitsframe= 1395 fps=8.0 q=22.0 size=   71680kB time=00:00:53.68 bitrate=10938.9kbitsframe= 1400 fps=8.0 q=22.0 size=   72192kB time=00:00:53.88 bitrate=10976.2kbitsframe= 1410 fps=8.0 q=22.0 size=   72704kB time=00:00:54.28 bitrate=10972.6kbitsframe= 1415 fps=8.0 q=22.0 size=   72704kB time=00:00:54.48 bitrate=10932.3kbitsframe= 1420 fps=8.0 q=22.0 size=   73216kB time=00:00:54.68 bitrate=10969.0kbitsframe= 1430 fps=8.0 q=22.0 size=   73728kB time=00:00:55.08 bitrate=10965.5kbitsframe= 1435 fps=8.0 q=22.0 size=   73984kB time=00:00:55.28 bitrate=10963.8kbitsframe= 1440 fps=8.0 q=22.0 size=   74240kB time=00:00:55.48 bitrate=10962.0kbitsframe= 1445 fps=8.0 q=22.0 size=   74496kB time=00:00:55.68 bitrate=10960.3kbitsframe= 1455 fps=8.0 q=22.0 size=   74752kB time=00:00:56.08 bitrate=10919.5kbitsframe= 1460 fps=7.9 q=22.0 size=   75264kB time=00:00:56.28 bitrate=10955.3kbitsframe= 1465 fps=7.9 q=22.0 size=   75520kB time=00:00:56.48 bitrate=10953.6kbitsframe= 1470 fps=7.9 q=22.0 size=   75776kB time=00:00:56.68 bitrate=10951.9kbitsframe= 1480 fps=7.9 q=22.0 size=   76032kB time=00:00:57.08 bitrate=10911.9kbitsframe= 1485 fps=7.9 q=22.0 size=   76544kB time=00:00:57.28 bitrate=10947.1kbitsframe= 1490 fps=7.9 q=22.0 size=   77056kB time=00:00:57.48 bitrate=10981.9kbitsframe= 1495 fps=7.9 q=22.0 size=   77312kB time=00:00:57.68 bitrate=10980.2kbitsframe= 1505 fps=7.9 q=22.0 size=   77824kB time=00:00:58.08 bitrate=10976.8kbitsframe= 1510 fps=7.9 q=22.0 size=   78080kB time=00:00:58.28 bitrate=10975.1kbitsframe= 1515 fps=7.8 q=22.0 size=   78592kB time=00:00:58.48 bitrate=11009.3kbitsframe= 1520 fps=7.8 q=22.0 size=   79104kB time=00:00:58.68 bitrate=11043.3kbitsframe= 1530 fps=7.8 q=22.0 size=   79360kB time=00:00:59.08 bitrate=11004.0kbitsframe= 1540 fps=7.9 q=22.0 size=   80384kB time=00:00:59.48 bitrate=11069.3kbitsframe= 1545 fps=7.8 q=22.0 size=   80384kB time=00:00:59.68 bitrate=11033.9kbitsframe= 1550 fps=7.8 q=22.0 size=   80896kB time=00:00:59.88 bitrate=11067.1kbitsframe= 1555 fps=7.8 q=22.0 size=   81152kB time=00:01:00.08 bitrate=11065.2kbitsframe= 1565 fps=7.8 q=22.0 size=   81408kB time=00:01:00.48 bitrate=11026.7kbitsframe= 1570 fps=7.8 q=22.0 size=   81920kB time=00:01:00.68 bitrate=11059.5kbitsframe= 1575 fps=7.8 q=22.0 size=   82432kB time=00:01:00.88 bitrate=11092.0kbitsframe= 1580 fps=7.8 q=22.0 size=   82688kB time=00:01:01.08 bitrate=11090.0kbitsframe= 1590 fps=7.8 q=22.0 size=   83456kB time=00:01:01.48 bitrate=11120.2kbitsframe= 1595 fps=7.8 q=22.0 size=   83456kB time=00:01:01.68 bitrate=11084.2kbitsframe= 1600 fps=7.8 q=22.0 size=   84224kB time=00:01:01.88 bitrate=11150.0kbitsframe= 1610 fps=7.8 q=22.0 size=   84736kB time=00:01:02.28 bitrate=11145.7kbitsframe= 1615 fps=7.8 q=22.0 size=   84736kB time=00:01:02.48 bitrate=11110.1kbitsframe= 1620 fps=7.7 q=22.0 size=   85248kB time=00:01:02.68 bitrate=11141.5kbitsframe= 1625 fps=7.7 q=22.0 size=   85504kB time=00:01:02.88 bitrate=11139.4kbitsframe= 1635 fps=7.7 q=22.0 size=   85760kB time=00:01:03.28 bitrate=11102.2kbitsframe= 1640 fps=7.7 q=22.0 size=   86272kB time=00:01:03.48 bitrate=11133.3kbitsframe= 1650 fps=7.8 q=22.0 size=   86784kB time=00:01:03.88 bitrate=11129.2kbitsframe= 1655 fps=7.7 q=22.0 size=   86784kB time=00:01:04.08 bitrate=11094.5kbitsframe= 1660 fps=7.7 q=22.0 size=   87296kB time=00:01:04.28 bitrate=11125.2kbitsframe= 1670 fps=7.7 q=22.0 size=   87808kB time=00:01:04.68 bitrate=11121.3kbitsframe= 1675 fps=7.7 q=22.0 size=   87808kB time=00:01:04.88 bitrate=11087.0kbitsframe= 1680 fps=7.7 q=22.0 size=   88064kB time=00:01:05.08 bitrate=11085.1kbitsframe= 1690 fps=7.8 q=22.0 size=   88576kB time=00:01:05.48 bitrate=11081.5kbitsframe= 1695 fps=7.7 q=22.0 size=   88576kB time=00:01:05.68 bitrate=11047.7kbitsframe= 1700 fps=7.7 q=22.0 size=   88832kB time=00:01:05.88 bitrate=11046.0kbitsframe= 1705 fps=7.7 q=22.0 size=   89088kB time=00:01:06.08 bitrate=11044.3kbitsframe= 1715 fps=7.7 q=22.0 size=   89344kB time=00:01:06.48 bitrate=11009.4kbitsframe= 1720 fps=7.7 q=22.0 size=   89856kB time=00:01:06.68 bitrate=11039.3kbitsframe= 1730 fps=7.7 q=22.0 size=   90368kB time=00:01:07.08 bitrate=11036.0kbitsframe= 1735 fps=7.7 q=22.0 size=   90368kB time=00:01:07.28 bitrate=11003.2kbitsframe= 1740 fps=7.7 q=22.0 size=   90624kB time=00:01:07.48 bitrate=11001.6kbitsframe= 1745 fps=7.7 q=22.0 size=   90880kB time=00:01:07.68 bitrate=11000.1kbits[mp4 @ 0x7fcf4b80d800] Starting second pass: moving the moov atom to the beginning of the file
frame= 1745 fps=7.5 q=-1.0 Lsize=   93152kB time=00:01:09.82 bitrate=10929.1kbits/s dup=1396 drop=0 speed=0.302x    
video:89776kB audio:3318kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.062878%
[aac @ 0x7fcf4b817a00] Qavg: 65467.379
[libx264 @ 0x7fcf4b818c00] frame I:30    Avg QP:14.43  size:378130
[libx264 @ 0x7fcf4b818c00] frame P:439   Avg QP:17.96  size:183234
[libx264 @ 0x7fcf4b818c00] frame B:1276  Avg QP:17.89  size:   114
[libx264 @ 0x7fcf4b818c00] consecutive B-frames:  2.2%  0.7%  0.9% 96.3%
[libx264 @ 0x7fcf4b818c00] mb I  I16..4:  0.1% 97.1%  2.8%
[libx264 @ 0x7fcf4b818c00] mb P  I16..4:  0.4% 49.3%  4.7%  P16..4:  5.4%  8.7%  4.3%  0.0%  0.0%    skip:27.3%
[libx264 @ 0x7fcf4b818c00] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.4%  0.0%  0.0%  direct: 0.0%  skip:99.6%  L0:41.5% L1:52.9% BI: 5.6%
[libx264 @ 0x7fcf4b818c00] 8x8 transform intra:91.5% inter:92.3%
[libx264 @ 0x7fcf4b818c00] coded y,u,v intra: 98.2% 34.7% 37.1% inter: 5.1% 1.3% 1.1%
[libx264 @ 0x7fcf4b818c00] i16 v,h,dc,p: 25% 74%  1%  0%
[libx264 @ 0x7fcf4b818c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 19% 41%  2%  3%  3%  1%  3%  4%
[libx264 @ 0x7fcf4b818c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 23% 10%  3% 11% 10%  4%  4%  4%
[libx264 @ 0x7fcf4b818c00] Weighted P-Frames: Y:19.1% UV:8.0%
[libx264 @ 0x7fcf4b818c00] ref P L0: 40.8% 21.5% 14.6% 18.0%  5.1%
[libx264 @ 0x7fcf4b818c00] ref B L0: 77.4% 15.6%  7.0%
[libx264 @ 0x7fcf4b818c00] ref B L1: 96.3%  3.7%
[libx264 @ 0x7fcf4b818c00] kb/s:10536.35
  • Try adding -r 25 output option. Other stuff: -b:a 528k is overboard, -f image2 is superfluous, /.jpeg is invalid and should be *.jpeg.
    – llogan
    Commented Nov 29, 2017 at 19:52
  • @LordNeckbeard I've set the audio to that because I read that is the highest bitrate possible for aac. Even at that bitrate I can hear slight cracking/odd artefacts and below that I can certainly hear them. I'm not using /.jpeg but when I copied in 'frames/*/*.jpeg' it changed it. Using -r 25 I can't even upload to Twitter now. I get error messages Your media file could not be processed and Cannot read property ‘code’ of undefined.
    – Westicle
    Commented Nov 29, 2017 at 21:33
  • Please edit your question to include the complete console output from ffmpeg. You can format it by highlighting and pressing ctrl+k or using the Code Sample button (looks like {}).
    – llogan
    Commented Nov 29, 2017 at 22:02
  • @LordNeckbeard cool, that's done now.
    – Westicle
    Commented Nov 29, 2017 at 22:33
  • Your original command is different than your new command. Option placement matters: -pix_fmt yuv420p needs to be an output option, so move it before the output file.
    – llogan
    Commented Nov 29, 2017 at 22:39


You must log in to answer this question.

Browse other questions tagged .