VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. what is an easy to use to convert very short mp4 videos to gif?
    Quote Quote  
  2. In Virtualdub2

    1 File->Open Video File .. load mp4
    2 [Mark In] and [Mark Out] Specify the 'start' and 'end'
    3 Video->Filters .. if you want apply crop and resize
    4 File->Export->Animated Gif.. (infinity loop)

    Image
    [Attachment 50665 - Click to enlarge]
    責任者
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    The quality, unfortunately, is not optimal. It seems to build a common 256 color palette over the whole clip. If you have very varying colors, you will notice the quantization. Other tools do a better job here, using partial palette changes, but are not so easy to use (e.g. JASC Animation Shop 3 supports hardly any common video format, not even all VfW codecs in AVI).
    Quote Quote  
  4. This batch file was posted here in the past. It builds a global palette then renders using that palette and error diffusion.

    Code:
    @echo off
    ::** create animated GIF w/ optimized palette
    ::
    :: https://ffmpeg.org/ffmpeg-all.html#gif-2
    :: http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
    :: http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
    
    if not exist "%~dpnx1" goto :EOF
    cd "%~dp1" 
    
    ::** generate palette
    @echo on
    @echo.
    "c:\program files\ffmpeg\bin\ffmpeg.exe" ^
     -v warning -i "%~nx1" ^
     -vf "palettegen" ^
     -y tmp-palette.png
    
    ::** generate GIF
    @echo.
    "c:\program files\ffmpeg\bin\ffmpeg.exe" ^
     -v warning -i "%~nx1" ^
     -i tmp-palette.png ^
     -lavfi "[0][1:v] paletteuse" ^
     "%~n1.gif"
    @echo off
    
    del /q tmp-palette.png
    
    if errorlevel 1 pause
    goto :eof
    Change the path to ffmpeg.exe if necessary. You can then drag/drop any video file onto the batch file to make a GIF.

    A comparison 0f VirtualDub vs ffmpeg using a source with many colors and smooth gradients:

    VirtualDub GIF:
    Image
    [Attachment 50683 - Click to enlarge]


    ffmpeg GIF:
    Image
    [Attachment 50684 - Click to enlarge]
    Quote Quote  
  5. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Wow, that is a clear and noticeable comparison example!

    Scott
    Quote Quote  
  6. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Can I have the original, please? Would like to try the same with Animation Shop 3.
    Quote Quote  
  7. Originally Posted by LigH.de View Post
    Can I have the original, please? Would like to try the same with Animation Shop 3.
    This was made with VirtualDub's Tools -> Create Test Video -> RGB Color Cube. Cropped and decimated.
    Image Attached Files
    Quote Quote  
  8. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Not extremely different to the ffmpeg result. It offers two quantization techniques: Octree and Median cut. But they differ obviously only when there are dominant colors.

    VirtualDub seems to omit error diffusion. I know there are a variety of such algorithms, too, with more or less spread.
    Image Attached Images    
    Quote Quote  
  9. Gif to mp4

    Here a avisynth script with waifu2X(reduction noise and scale), convert any animated video or gif.

    https://youtu.be/kdbhFVZ4vIM
    Last edited by EsteveJohnson; 2nd Nov 2019 at 14:38.
    Quote Quote  



Similar Threads