Skip to content

GIF to MP4

Jerry Hogsett edited this page Mar 7, 2023 · 3 revisions

Screenshot 2023-03-06 162018

Example - Original GIF Example - GIF to MP4 (frame size X2, frame rate X4)
http_t0 tagstat com_image03_0_21c475648484948484881505552 https://user-images.githubusercontent.com/825994/220932548-d40b54b5-811b-4637-8adc-6bf26fdcc52b.mp4

Uses

  • Recover the Original Video from an Animated GIF
  • Create a High-Def version of a Low-Res / Low-FPS Video
  • Recover the original video from a timelapse video
  • Easily create a slow-motion video in one-click

Important

Two third-party packages are required to use this feature:

  • FFmpeg for file conversion free download
    • ffmpeg.exe and ffprobe.exe must be available on the system path
  • Real-ESRGAN for frame restoration/upscaling see wiki page
    • The realesrgan directory must be copied to the VFIformer-WebUI directory

How it works

  1. Set GIF File to a GIF, MP4 or other video file on this server
    • The feature has been tested with GIF, MP4 and MPG files
  2. Set GIF Frame Size Upscale Factor to choose a zoom factor
    • Choose a value to set the enlargement size of the frame
    • The default is 4.0, with a range of 1.0 to 8.0
    • Tip: Frames will have noise removed even if set to a 1.0 zoom factor
  3. Set GIF Frame Rate Upscale Factor to choose an inflation factor
    • Choose a value to set the FPS increase for the video
    • The default is 4, the range is from 1 to 8
  4. Choose a Frame Processing Order
    • Rate, then Size is faster overall, and requires less VRAM
      • Smaller images are faster to interpolate
    • Size, then Rate is slower, but may produce higher quality
      • VFIformer may work better with original content at its native rate
  5. Set MP4 File to a path and filename on this server for the converted MP4 file
    • Leave blank to use a default .mp4 filename in the same location
    • It will use the original name an include conversion details
  6. Choose the video MP4 Frame Rate
  7. Set Quality to the required video quality
    • The range is 17-28 (17 is near-lossless)
    • Lower numbers = better quality with a higher file size
    • This value is passed to ffmpeg.exe as the -crf parameter
    • The range of quality values can be changed in config.yaml
  8. Click Convert
  9. GIF to MP4 is run to create a set of PNG frame files
  10. Video Inflation is run to create filler frames to increase FPS
  11. Upscale Frames is run to use Real-ESRGAN to clean and enlarge frames
  12. PNG to MP4 is run to create the output MP4 video

Notes

  • This process could be slow, perhaps many hours long!
  • Progress is shown in the console using a standard progress bar
  • The browser window does NOT need to be left open