Webm to gif linux

Конвертер WEBM в GIF

Сконвертируйте ваши webm-файлы в gif онлайн и бесплатно

  • Image
  • Document
  • Ebook
  • Audio
  • Archive
  • Video
  • Presentation
  • Font
  • Vector
  • CAD
  • abc
  • abw
  • csv
  • dbk
  • djvu
  • dng
  • doc
  • docm
  • docx
  • erf
  • ebm
  • ewm
  • emw
  • gzip
  • kwd
  • odt
  • oxps
  • ppt
  • pptx
  • pdf
  • rtf
  • rar
  • txt
  • wps
  • xls
  • xlsx
  • zip
  • Image
  • Document
  • Ebook
  • Audio
  • Archive
  • Video
  • Presentation
  • Font
  • Vector
  • CAD
  • abc
  • abw
  • csv
  • dbk
  • djvu
  • dng
  • doc
  • docm
  • docx
  • erf
  • ebm
  • ewm
  • emw
  • gzip
  • kwd
  • odt
  • oxps
  • ppt
  • pptx
  • pdf
  • rtf
  • rar
  • txt
  • wps
  • xls
  • xlsx
  • zip

WEB Media

Формат для обмена изображениями

Как сконвертировать WEBM в GIF

Загрузите webm-файл(ы)

Выберите файлы с компьютера, Google Диска, Dropbox, по ссылке или перетащив их на страницу.

Выберите «в gif»

Выберите gif или любой другой формат, который вам нужен (более 200 поддерживаемых форматов)

Загрузите ваш gif-файл

Позвольте файлу сконвертироваться и вы сразу сможете скачать ваш gif-файл

Источник

Как в Linux сконвертировать видео в GIF?

Подскажите, чем в Linux делаются такие вещи? Есть ли такая функция в Kdenlive? Просто он есть в репозитории, и я его уже установил.

Нашел еще Gifcurry.

Но в репозитории его нет, а со снапами я не дружу.

ffmpeg -v warning -i file.mp4 -vf «fps=24,scale=360:-1:flags=lanczos,palettegen» -y /tmp/palette.png ffmpeg -v warning -i file.mp4 -i /tmp/palette.png -lavfi «fps=24,scale=360:-1:flags=lanczos [x]; [x][1:v] paletteuse» -y file.gif

С фильтрами сам играйся.

Фильтры мне вроде не надо, только вырезать полноразмерный кадр в конкретном промежутке времени и превратить его в gif.

fps и scale — это тоже фильтры.

Я там посмотрел ключ -r (это фпс). Какой обычно выставляют фпс гифкам, если хочется чтобы плавнее была? Как в видео?

Я тебе уже сказал: с этими параметрами сам играйся, сам подбирай, как тебе больше нравится.

Спасибо, в целом получилось, хотя даже с низким разрешением гифки какие-то жирные, и какой-то странный эффект в виде «сетки», хотя может это специфика формата, вроде на многих гифках так.

Ты палитру для каждого файла не забываешь создать?

Делал командой отсюда.

Палитра тут вроде не затрагивается, значит стандартный результат.

ImageMagick тоже может:

Ребят, подскажите, а какой размер 1-минутной гифки (из фильма) приемлем? И какое обычно принято разрешение выставлть таким гифкам? Хочется вырезать смешной момент и запостить, но если выставить -vf scale=720:-1, то минутная гифка весит больше 50 мегов. Юзать 512?

конвертни в ч\б, будет копейки весить

Вроде рекомендуют гифки делать не больше 512 пикселей по горизонтали. Почекал гуглкартинки, там большинство гифок 500-512 пикселей, в принципе они неплохо масштабируются, может и правда нет смысла делать большое разрешение.

ЛОР как эталонный сервис художественного вкуса =)

Забавно, заметил что если делать гифки из старых рипов формата avi, в таком же разрешении как и фильм (например 480p), то итоговая гифка получается в 4 раза больше по размеру. И это при том, что она даже звук не хранит! Как такое возможно?

А еще при риповании авишек возникает такое сообщение:

В результате все-равно рипуется, но сама гифка почему-то проигрывает видео в 2 раза медленнее, чем в фильме. При том что частоту кадров указываю такую же, которую показывает VLC.

Стив Джобс, ты же гений (хоть и мертвый), ты то должен знать! Подскажи, почему гифки с avi в том же разрешении и фпс что и в оригинальном видео — получаются в 4-5 раз толще? Да и не только с avi, вот mp4 файлы тоже, с них гифки получаются большие. Походу так с любого видео.

Я всегда считал, что смысл гифок в том, что можно запостить прикольный отрывок из фильма, не вырезая сам кусок фильма, который весит немало. Но гифка с аналогичными параметрами (480p, 25 fps) весит аж в 4 раза больше, аналогичного куска avi. Разве это справедливо?

Читайте также:  Ежедневные обои windows 10

Если у тебя есть Мак, попробуй заюзать Gif Brewery

Нету у меня его. А что, мак лучше жмет гифки?

А чем можно измерить длину (время) гифки? Чтобы проверить, что время действительно получилось правильным, и нет косяков с фпс.

Нет конечно. Просто это в кой то веки нормально написанная гуевая софтина для создания гифок, там интуитивный интерфейс и она сразу из коробки решает часть вопросов. У нас она стала чем-то вроде стандарта для выкладывания гифок в статьях (там где надо показать, как щелкаются кнопочки, итп). Если бы ты был маководом, это было бы идеальное решение. А вот ставить виртуалку макоси ради неё, думаю, совершенно излишне, лучше изучить ffmpeg

А не знаешь, можно ли задавать милисекунды в ffmpeg? Формат 00:00:00 не всегда подходит, нужно записать видео с определенной секунды, но вначале гифки влезает кадр с другой сцены, что совершенно портит всю гифку. А если передвинуть на секунду вперед, то весь прикол теряется.

тебе поможет 00:01:02.500

Но только учти, что в реальности у тебя видео работает не в терминах миллисекунд, а терминах фреймов, и в реальности у тебя видео начнётся не с этой миллисекунды, а с достаточно близкого места, с которого ffmpeg смог что-то восстановить (а в каких-то неудачных случаях первым кадром будет вообще месиво). Так что доверяй, но проверяй

Давно это можно online.

Вроде 2020 на подходе и логичнее было бы выкладывать видео на сайты. Но нет, тормозной, уродский и огромный gif все ещё жив 🙁

Онлайн не интересно, хотя для кого-то тоже вариант. По мне эти сервисы сродни «закачай фотки своих домашних, чтоб убрать красные глаза» вместо того, чтобы заюзать Gimp. Конечно тут не персональные данные, а мемасики из фильмов, но все-равно почему-то противно. На чем зарабатывают такие сервисы?

Да я видел, щас многие встраивают плееры с wemb, как-бы вместо gif. Не знаю что лучше. У некоторых на сайтах плееры, проигрывающие gif, прямо с кнопкой stop/play.

Еще раз спасибо за совет. Я предполагал, что именно такой формат он может поддерживать, но т.к. нигде в примерах не видел милисекунд, то даже не стал сначала пробовать, а оно действительно есть и работает.

ВК и телега конвертят гифки назад в видео, так что если планируется публикация там, то размер не важен.

Обычно там гора банеров

А можно ли как-то ставить гифку на паузу? Например, чтобы проверить первый и последний кадр. Вроде Gwenview паузить не умеет.

ffmpeg-ом отрезать самое начало и конец, и вот их уже открывать. Иначе процесс затянется на ночь, если ты открываешь что-то там достаточно большое, гимп — живтоне небыстое

GIF – отвратительный допотопный формат, который популярен сугубо по историческим причинам. И сжатие в нём допотопное, оно хорошо жмёт только картинки с однотонной заливкой, типа мультиков; реальные съёмки и прочие сложные изображения он сжимает крайне плохо, любой видеокодек справится лучше.

В одном кадре GIF поддерживает максимум 256 цветов. Поэтому для сжатия съёмок приходится имитировать остальные цвета дизерингом (той самой сеткой). Причём ffmpeg мог бы рассчитывать оптимальную набор цветов для каждого кадра, если бы ты использовал команду из первого поста – но ты поумничал и использовал более простую, с ней используется универсальная палитра, с которой дизеринга будет ещё больше. И кстати, области с дизерингом не сжимаются вообще, поэтому чем меньше дизеринга, тем не только выглядеть лучше будет, но и весить меньше.

Если не критичен именно GIF, лучше и не возись с этой фекалией мамонта, а используй WebP: он почти всеми современными браузерами и просмотрщиками картинок поддерживается. Ну или хотя бы APNG – он весит больше, чем WebP, но чуть универсальнее.

Источник

How to Convert Video to GIF in Linux [Terminal and GUI Methods]

Last updated August 10, 2020 By Dimitrios 9 Comments

Animated GIFs are everywhere on the internet. From blog posts to social media, GIFs can be used in a humorous as well as explanatory way.

Even on It’s FOSS, we use GIFs to show a certain step in action. It is better than still images and shorter than loading a video.

In this tutorial, I will show you how to convert a video clip to GIF. I’ll discuss both:

  • Command line way to convert video to GIF
  • GUI tool for converting video to GIF

Method 1: Create GIF from Video using ffmpeg in command line

FFmpeg is a video and audio converter that can also grab from a live audio/video source. It can also resize video on the fly without compromising the quality.

Читайте также:  Расширенное управление питанием процессора windows 10

FFmpeg is a powerful tool and can be used for various scenarios, if you are curious here is the official documentation. We also have a good collection of ffmpge usage examples.

In this example, I will use the Linux Mint 20 new feature presentation video. I downloaded the video from YouTube using youtube-dl and then I trimmed the video to get the first 5 seconds.

Make sure to install ffmpeg using your distribution’s package manager:

Once you have selected the video that you want to convert, open your terminal and change directory where your video is saved. Below is a general principle, where input is the actual name of the video, following by the video format and the name that you want your gif to be.

The output name can be something totally different to the input name, but I tend to use something similar, as it helps to identify it when you have a folder full of files.

Press the enter key to execute the command and your gif will be ready shortly.

You should find the GIF file in the same folder as your video file unless you specified some other path for the output file).

Method 2: Converting video to GIF using Gifcurry GUI application

Gifcurry is an open-source, easy-to-use app GIF maker app.

It uses ffmpeg and imagemagick to process video and convert to GIF. It can be used both in command-line and the graphical user interface, although this tutorial will only cover the GUI part.

It can be installed using snap and other package managers, but I recommend using the AppImage because I found some issue with other packages.

Before you attempt to open gifcurry, you need to make sure that the required dependencies are already installed.

Open and use gifcurry

To make an Appimage executable is very straight forward and you grant the permission at the file properties as following:

When you open Gifcurry you will be prompted to navigate to the file that you want to convert and at this example I will use again the initial video. As ffmpeg, Gifcurry is not limited to purely converting videos to gif and vice versa. Some of the features are listed.

A few other Gifcurry Features

  • Add text to gif
  • Choose starting time
  • Set duration
  • Adjust gif width
  • Adjust Quality

At the last step, you have to choose the file name, the file format and click save.

The final result is here:

Conclusion

If you are recording your screen in Linux, you may use Peek to record it a gif instead of a video instead of converting the video to gif later.

Either you choose the command line or the graphical user interface, your job will get done lightning fast both ways.

Let me know which way you prefer and feel free to request any further explanation at the comments section.

Like what you read? Please share it with others.

Источник

How to create an animated GIF from MP4 video via command line?

I want make an animated .gif from an .mp4 video. I would prefer to do it from the command line, so please only list command line tools.

4 Answers 4

ffmpeg 3.4.4 can do it directly on Ubuntu 18.04

You likely want to use something like:

Image info: 426kB, 45 frames, 512×512 apparent size, coalesced, conversion time on a Lenovo P51: 0.5s.

The above conversion also worked after a ulimit -Sv 1000000 (DRAM usage limited to 1GB), so it does «not consume huge amounts of memory» like previous attempts I did with Imagemagick which almost killed my machine. 500MB however failed because ffmpeg failed to load its shared libraries. time to upgrade your RAM ;-)?

Test data generation procedure described on this post.

The output has a visible dotting pattern, which is not as visible in «ffmpeg + convert» method below. We can try to improve the image quality with methods described at:

E.g. using the palettegen filter:

Image info: 979K, 45 frames, 512×512 apparent size, coalesced, conversion time on a Lenovo P51: 3.5s.

  • the dotting pattern is much less visible now
  • GIF size roughly doubled. TODO: why does simply choosing a palette increase the image size? Is it because now more colors so we need more bits per color? How to observe each palette?
  • generation time was 7x slower, presumably because ffmpeg is first scanning through the entire video to determine an optimal palette
Читайте также:  Gaming upgrade to windows 10

We could also play with documented palettegen parameters like palettegen=max_colors=16 to achieve different size quality trade-off points.

Argument breakdown

-ss 00:00:03 -to 00:00:06 : start and end time to cut the video from.

No, GIFs are not the best way to pirate distribute videos online.

-vf scale=512:-1 : make the output 512 pixels in height, and adjust width to maintain the aspect ratio.

This is a common use case for images for the web, which tend to have much smaller resolution than video.

If you remove this option, the output GIF has the same height as the input video.

-r 15 : sampling FPS.

For example, the original video was 30 FPS, so -r 15 means that ffmpeg will pick one frame in every 2 ( = 30 / 15 ).

The perceived output FPS is adjusted to match the input however, so you won’t notice a speedup, only greater granularity.

The input FPS can be found with ffprobe , and the total number of input frames can be found with mediainfo as explained at: https://superuser.com/questions/84631/how-do-i-get-the-number-of-frames-in-a-video-on-the-linux-command-line/1044894#1044894

I recommend this option because video formats usually have a higher framerate due to the larger resolution. With smaller GIFs, the lower framerate is less noticeable, and so we can skip some frames and make smaller GIFs.

Video camera footage example

If you want to see the result quality of a video camera video from Wikimedia Commons with a similar command:

Image info: 1.3MB, 75 frames, 512×288 apparent size, coalesced (has minimal effect however, because footage pans slightly from the start), conversion time on a Lenovo P51: 2.3s.

Here is a version with palettegen but only 2 seconds to fit the 2MiB upload limit:

Image info: 1.5MB, 30 frames, 512×288 apparent size, conversion time on a Lenovo P51: 43s.

also works, but the output GIF would be way larger than the input video, because video formats can compress more efficiently across frames with advanced algorithms, while GIF can only does a simple rectangular frame diff.

Before pre 18.04: ffmpeg + convert one-liner without intermediate files

ffmpeg could not handle GIF previously. The best I had was something along:

Image info: 995kB, 45 frames, 512×512 apparent size, coalesced.

For the Atlantis shuttle footage, and analogous:

produced better looking output, but the final GIF was considerably larger at 6.2MB, so I can’t upload it.

Explanation of some of the arguments:

-loop 0 : add the Netscape Gif extension Loop count field to the output. 0 means infinite loop as described at: http://www.vurdalakov.net/misc/gif/netscape-looping-application-extension eog , firefox and chromium all loop infinitely by default even without it, so I’m not sure how necessary it is anymore.

-delay 5 : time waited before showing the next frame, in hundreths of second, as described at: https://en.wikipedia.org/wiki/GIF#Animated_GIF byte 324. So 100 means 1 FPS, 5 means 1 / 0.5 == 20FPS .

-deconstruct : compress across frames with rectangular diffs, see also: how can I resize an animated GIF file using ImageMagick?

Even if you reduce the height and framerate, the output GIF may still be larger than the video, since «real» non-GIF video formats compress across frames, while GIF only compresses individual frames.

worked, but almost killed my computer because of memory overflow, and produced an ouptput 100x larger for my 2s 1Mb input file. Maybe one day ImageMagick will catch up.

Tested on Ubuntu 17.10.

Gifski

This is another option that was brought to my attention and which claims intelligent algorithms, so let’s try it out.

First we need to convert the video to a sequence of images, and then feed that into gifsky, e.g.:

Image info: 954K, 45 frames, 512×512 apparent size, not coalesced, conversion time on a Lenovo P51: 4.8s.

Image info: 1.6M, 30 frames, 512×288 apparent size, not coalesced, conversion time on a Lenovo P51: 2.8s.

So for me, subjectively, this did not appear to offer significant benefit over ffmpeg’s palettegen .

Источник

Оцените статью