0

I am making an app in Unity on Windows 10. I want to convert a .gif file to a .mp4 file. But the problem is, I have NO clue how to do that, I searched online and I found this solution, but I have no idea how to do that. Also, I tried to search how to get the frames of a GIF file and it gave a solution for Windows Form application Not what I want to do! Also I have another problem: I am unable to use Bitmap in unity for some reason. I downloaded the code from this website, but I got multiple errors. My solution to those errors:

  1. I downloaded System.Drawing.Common from NuGet, but I still got the same errors.
  2. I even referenced System.Drawing to my project from Assemblies. None of them worked for me. Expected Answer for this question is(Any one):
  3. How to use the following in unity:
import moviepy.editor as mp
clip = mp.VideoFileClip("mygif.gif")
clip.write_videofile("myvideo.mp4")
  1. How to Convert .gif to .mp4 and save it to disk in c#.
Harsh
  • 17
  • 1
  • 6

1 Answers1

1

https://ffmpeg.org/

ffmpeg -f gif -i infile.gif outfile.mp4

Within unity you can use .net Process class to launch the conversion.

tripleee
  • 175,061
  • 34
  • 275
  • 318
Weezah
  • 44
  • 3