Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can we talk about the awful video compression on Twitter and how the only workaround to Twitter shitting on your video is to submit it as a perfectly crafted gif which takes dozens of trial and error iterations to produce?

It's 2019. Every other media sharing site on the planet is friendlier to preserving video quality than Twitter is. For a platform which carries so much programming\technical content, having video compression set to 'DESTROY ANY KIND OF PIXEL LEVEL DETAIL' is super painful. I can't be the only user that stopped uploading video content because of the effort involved in hand-crafting Twitter gifs.

Everything that can be achieved with these specially produced gifs could also be achieved by simply upping video quality for small videos. Plus removing the insanity of creating such content. Plus actually saving bandwidth since gifs are super wasteful.

There's a whole category of articles about how to 'trick' Twitter into preserving the quality of your image or video upload. That's insane. Define and publish some compression specs at which you won't destroy the content.



The funniest and most depressing part of all this is that twitter 'gifs' are mp4s


What video compression they use inside mp4 container?


Picked a "gif" at random:

  Format                                   : MPEG-4
  Format profile                           : Base Media / Version 2
  Codec ID                                 : mp42
  File size                                : 1.61 MiB
  Duration                                 : 4s 890ms
  Overall bit rate                         : 2 766 Kbps
  Encoded date                             : UTC 2018-06-07 09:34:57
  Tagged date                              : UTC 2018-06-07 09:34:57

  Video
  ID                                       : 1
  Format                                   : AVC
  Format/Info                              : Advanced Video Codec
  Format profile                           : Baseline@L3.0
  Format settings, CABAC                   : No
  Format settings, ReFrames                : 1 frame
  Codec ID                                 : avc1
  Codec ID/Info                            : Advanced Video Coding
  Duration                                 : 4s 890ms
  Bit rate                                 : 2 764 Kbps
  Width                                    : 720 pixels
  Height                                   : 414 pixels
  Display aspect ratio                     : 1.739
  Frame rate mode                          : Variable
  Frame rate                               : 33.538 fps
  Original frame rate                      : 1 000.000 fps
  Minimum frame rate                       : 33.333 fps
  Maximum frame rate                       : 1 000.000 fps
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Progressive
  Bits/(Pixel*Frame)                       : 0.276
  Stream size                              : 1.61 MiB (100%)
  Title                                    : Twitter v1.0-757770b7c8e9d79a526cdff77e74666386274fdf
  Writing library                          : x264 core 148
  Encoding settings                        : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=1 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=2:1.00
  Encoded date                             : UTC 2018-06-07 09:34:57
  Tagged date                              : UTC 2018-06-07 09:34:57


The videos look pretty bad when uploaded to Twitter from a Switch (e.g., https://mobile.twitter.com/crotchmedia/status/10754735897831...). So this is Twitter’s fault, huh?


I just wish they’d up the file size and length maximums. Kind of amazed they don’t as I know quite a few outlets that don’t like using YouTube and would gladly host it on twitter. It’d also help keep people on twitter longer = more ads.


Sorry, but how is it possible to create "perfectly created gif" to replace the video you're uploading? IIRC, the largest gifs Twitter seems to support is 15MB. You're having problems with seconds of video?


Yes, seconds of video. That's the price you have to pay on Twitter to not have your content turned into a blob of smudge.

15mb is the total bucket size you need to fill. How you fill that bucket depends on:

Length

Palette

Dithering settings

The actual amount of pixels changed in the segment of video you're showing

You then embark on a journey to take your original 10 second video segment and produce the ideal 15mb gif by tweaking all of the above.

Or you just upload the whole 10 second video to imgur and get back an 8mb pixel perfect mp4.

https://twitter.com/DeusVerus/status/1004657962663596032

https://twitter.com/spetulla/status/1072604230681329665

https://twitter.com/mbostock/status/1064241248049881088

https://twitter.com/veltman/status/1068226765632327680

All of these posts are hand-crafted gifs designed to work around Twitter's video compression.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: