DiRT 4
Not enough ratings
Make Gifs
By GenC 🐱‍👤
How to make gifs! (from videos)
May require around 10 minutes to first set up. After that, you can make gifs from short videos in under a minute.
   
Award
Favorite
Favorited
Unfavorite
Restrictions
Only works for Windows. Well, if you're playing DiRT 4 on PC, you're probably not playing on osx or linux anyways.

Some video file formats may have problems.

Works perfectly fine with Nvidia shadowplay recorded clips.
Part A: Get FFmpeg
  1. Go to http://ffmpeg.zeranoe.com/builds/
  2. Select either the stable or the beta build (the stable build is circled in the image)
  3. Select 64-bit or 32-bit depending on your system
  4. Make sure static linking is selected (shared should work too)
  5. Download FFmpeg
Part B: Set Up FFmpeg
  1. Extract the .zip that you just downloaded.


  2. Navigate to the extracted ffmpeg folder. Find the bin folder. Right-click the address bar and select "Copy address as text."

  3. Tap the windows logo key. (Or click the start button)


  4. Type in "environment variables." It should search automatically. Click on the result titled "Edit the system environment variables."



  5. Select "Environment Variables..."


  6. Select "PATH."
  7. Click on "Edit," as shown in the picture above. (DO NOT SELECT THE WRONG ONE)



  8. Click on "New."
  9. Paste the address you found from step 2.
  10. Click "OK" through all the windows.
Part C: Setting up the scripts
  1. Navigate to your video captures folder. (Why? These scripts are run by dragging your video files onto them. It's easier if the video files are right next to the scripts.)



  2. Make three ".bat" files: "!splitvideo.bat", "!cropvideo.bat", and "!makegif.bat" (You can actually name these whatever you want. Just make sure they are .bat files.)
    If you don't know how to make a .bat file, google it[www.google.com].

  3. Right-click and select "Edit" for each file; then, copy and paste code:
!splitvideo.bat
@echo off set /p a="Split start(seconds): " set /p b="Split end(seconds): " ffmpeg -i "%~nx1" -ss %a% -to %b% -c copy "[CUT] %~nx1" pause

!cropvideo.bat
@echo off :SELECTCROP set /p w="Crop Size Width (pixels) (last: %w%): " set /p h="Crop Size Height (pixels) (last: %h%): " set /p x="Offset from LEFT to RIGHT (last: %x%): " set /p y="Offset from TOP to BOTTOM (last: %y%): " ffplay -i "%~nx1" -vf "crop=%w%:%h%:%x%:%y%" set /p keep="Keep? (y/n): " if %keep% == y goto MAKECROP if %keep% == Y goto MAKECROP goto SELECTCROP :MAKECROP ffmpeg -i "%~nx1" -filter:v "crop=%w%:%h%:%x%:%y%" -c:a copy "[%w% x %h%] %~nx1" pause ::see http://ffmpeg.org/ffmpeg-filters.html#crop ::and https://video.stackexchange.com/questions/4563/how-can-i-crop-a-video-with-ffmpeg ::for more info

!makegif.bat
@echo off set /p fps="Frames per second: " set /p width="Width: " ::ffmpeg -i "%~nx1" -vf "fps=%fps%,scale=640:-1" -r %fps% -an -sn -f image2pipe -vcodec png - | convert -loop 0 -layers Optimize - "%~n1.gif" ::ffmpeg -i "%~nx1" -vf "fps=%fps%,scale=640:-1" -an -sn -f gif - "%~n1.gif" ffmpeg -y -i "%~nx1" -vf "fps=%fps%,scale=640:-1:flags=lanczos,palettegen" "palette.png" ffmpeg -y -i "%~nx1" -i "palette.png" -filter_complex "fps=%fps%,scale=%width%:-1:flags=lanczos[x];[x][1:v]paletteuse" "%~n1.gif" pause

Make sure to save the files before closing them.
Part D: Using the scripts
Simply drag the video you want to edit onto the script you want to use. A window should open that will ask you for options.

Your original video file will not get overridden. Each script creates a new output file every time.

Recommended order of usage:
  1. !splitvideo.bat
  2. !cropvideo.bat
  3. !makegif.bat

!splitvideo.bat Instructions
It will ask you for the start and end time stamps (in seconds) of the split. It will create a new video from the input video starting at <start time stamp> and ending at <end time stamp>.
Start time stamp + duration is not implemented, although that can be accomplished by a minor change in the script.

!cropvideo.bat Instructions
It will ask you for the width of the crop, the height of the crop, and the offsets of the upper-left corner of the cropped video from the original position.
Then, it plays the result. You can rewind the result by right-clicking towards the left edge of the video. You can exit by pressing escape.
If you don't like the result, you can easily go back and edit each crop parameter again.

!makegif.bat Instructions
It only asks for framerate. I recommend framerates of 15, 24, and 30, depending on how much action is going on in the video.
Make sure your gif's file size is under 8 MB (8000 kB) or else Steam won't accept it as an upload.