Autoplay gif on device with video on desktop


#1

Although it’s explained in this forum that you can’t have autoplay video on an iPhone / device, because of policies to protect cellular data usage, I still wanted to do it. So I’ve come up with a way, and it does work. However, I would welcome some feedback. I realize that some may object to this on principle – we shouldn’t be eating up people’s cellular data – but I am sensitive to that, and have taken efforts to keep the animated.gif just as small as you like starting from the original.mp4

Click the animation below to see it in better quality. You’ll see there is,

  1. an image bric on top with the animated.gif,
  2. a H6 bric below that with a text link to vid/original.mp4, and
  3. a video bric below that with the original.mp4.

I then turn off tablet and phone visibility for (3) and desktop visibility for (1) & (2), and go to preview mode to demonstrate that it works in both desktop and device modes.

One minor problem is that in device mode, the animated gif (1) does not stay centered as it should but shifts to left justified for some reason. However, when I’ve exported and actually tested on my iPhone, it is centered.

Another thing that really confused me was that (1) & (2) would disappear in edit mode – no matter what I did, I could not find a way to click on them (“there’s no reverse bread crumb path”). But then I found that by reducing the window size (1) & (2) again became visible (seems to me this should only happen in preview mode?). I’m using 2.5 build 8

I expect some may wonder how I made the animated.gif, so I’ll give some details. I use ffmpeg, which I think is an incredible program for free. Plus it has the added benefit of a retro command-line interface.

Here are the ffmpeg commands I used to produce the animated .gif in (1). I stared with (3) which is a 470px by 470px original.mp4, and reduced it to 200px by 200px as follows:
ffmpeg -i original.mp4 -s 200x200 -c:a copy smaller.mp4

I then made the animated gif using that smaller.mp4
ffmpeg -i smaller.mp4 -r 10 animated.gif

The “-r 10” determines the number of frames in the animated.gif. -r 10 produces an acceptable 1.8MB animation with 212 frames, “-r 1” gives a very choppy 0.2MB animation with 22 frames and “-r 15” gives a smooth animation with 316 frames.

If you want to learn more about ffmpeg, here’s a 20-min presentation about how to use it, and here’s a page that provides 20 ffmpeg examples