iosswiftavplayermp4

Downloading Gifv files for use in AVPlayer in Swift


I've been working with Imgur's API for fetching a retrieving photos but whenever I try and download a gifv, or webm I can't download or play it. Now Imgur's API has no direct way to download the gifv as an mp4. Is their anyway I can convert the downloaded gifv to a playable mp4 in Swift?


Solution

  • Is their anyway I can convert the downloaded gifv to a playable mp4 in Swift?

    Not really.

    gifv is not a real file format but a set of HTML5 rules that imgur uses on their webpages to deliver their new GIFs: the server decides which file it delivers upon several criteria like bandwidth.

    gifv is actually a wrapper on their server containing a WebM file, a MP4 and a re-encoded GIF.

    You can't use it as it is, a GIFV is only playable via an HTML code snippet generated by this imgur page.