欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

在Linux上將視頻轉(zhuǎn)換成動態(tài)gif圖片 (附:ffmpeg

系統(tǒng) 2301 0

雖然曾經(jīng)被認(rèn)為是過時的藝術(shù)形式,但動態(tài)GIF圖片現(xiàn)在復(fù)蘇了。如果你還沒有留意到,不少在線分享和社交網(wǎng)絡(luò)網(wǎng)站都開始支持動態(tài)GIF圖片,例如, Tumblr Flickr Google+ Facebook的部分地方 。由于在消費(fèi)和共享上的容易,GIF的動畫已經(jīng)成為主流互聯(lián)網(wǎng)文化的一部分了。

?

所以,你們中的一些人會好奇怎樣才能生成這樣的動態(tài)GIF圖片。已經(jīng)有各種各樣專門用來生成動態(tài)GIF圖片的在線或離線工具。另一種選擇是創(chuàng)建一副動態(tài)GIF圖片時關(guān)閉現(xiàn)有的視頻剪輯。在這個教程中,我會描述 在Linux上如何將一段視頻文件轉(zhuǎn)換成一副動態(tài)GIF圖片

?

作為一個更有用的例子,讓我展示如何 將一個YouTube視頻轉(zhuǎn)換成一副動態(tài)GIF圖片

?

第一步:下載YouTube視頻

?

首先,下載一個你想要轉(zhuǎn)換的YouTube視頻。你可以使用 youtube-dl 這個工具將YouTube視頻保存為MP4文件。假設(shè)你把你最愛的YouTube視頻保存為"funny.mp4"。(譯注:對于墻內(nèi)的同學(xué),請無視YT吧,自行去好人樓主那里尋找一個MP4吧,;-})

?

第二步:從視頻中解壓視頻幀

?

接下來,在Linux系統(tǒng)上 安裝FFmpeg ,我會用這個工具去解壓從視頻中解壓出視頻幀。

?

下面的指令會解壓出獨(dú)立的視頻幀,將它們保存為GIF圖片。確保使用諸如("out%04d.gif")的輸出文件格式。這樣,獨(dú)立的幀就被合適地命名并保存。

      ffmpeg -t <時長> -ss <hh:mm:ss格式的開始位置> -i <視頻文件> out%04d.gif
    

?

例如,如果你想解壓輸入視頻的視頻幀,從第10秒開始,每5秒一幀,請運(yùn)行下列命令。

      $ ffmpeg -t 5 -ss 00:00:10 -i funny.mp4 out%04d.gif 
    

?

在完成FFmpeg之后,你會看到一組創(chuàng)建出來的GIF文件,它們被命名為"out[\d+].gif"。

?

第三步:合并視頻幀進(jìn)一副動態(tài)GIF

?

下面這一步要合并單個的GIF文件成一副動態(tài)GIF圖片。為此,你可以使用ImageMagick。

?

首先,如果你還沒有的話,在Linux系統(tǒng)上 安裝ImageMagick

      convert -delay <幀數(shù)>x<每秒幀數(shù)> -loop 0 out*gif <輸出文件>
    

?

在這個命令中,"-delay"是控制動態(tài)速度的選項(xiàng)。這個選項(xiàng)表示在顯示下一幀畫面前需要等待的秒數(shù):幀數(shù)/每秒幀數(shù) 。"-loop 0"選項(xiàng)表示動畫的無限次循環(huán)。如果你愿意,你可以指定"-loop N"讓動畫只重復(fù)N次。

?

例如,為了生成一副每秒20幀和循環(huán)無數(shù)次的動態(tài)GIF圖片,使用如下命令。

      $ convert -delay 1x20 -loop 0 out*.gif animation.gif 
    

?

第四步(可選):減少動態(tài)GIF的大小

?

最后這一步(可選)是通過使用ImageMagick的GIF優(yōu)化功能來減少生成的GIF文件的大小。

?

使用下列命令去減少GIF大小。

      convert -layers Optimize animation.gif animation_small.gif 
    

?

現(xiàn)在你已經(jīng)準(zhǔn)備好在你的社交網(wǎng)絡(luò)上分享制作完成的GIF圖片。下面是一副我從一個可愛的YouTube視頻中生成的GIF樣例圖片。

?

享受技術(shù)帶來的樂趣吧!:-)

?


?

via: http://xmodulo.com/2013/11/convert-video-animated-gif-image-linux.html

譯者: KayGuoWhu 校對: wxy

原文由 LCTT 原創(chuàng)翻譯, Linux中國 榮譽(yù)推出

原文地址: http://linux.cn/thread/12298/1/1/

?

1. 安裝ffmpeg

?

Install FFmpeg in Ubuntu

?

Either click this link or run this command in the terminal to install FFmpeg.

      sudo apt-get install ffmpeg
    

?

Install FFmpeg in Fedora

?

FFmpeg can be directly installed from the repos. Just run the following command.

      su -c 'yum install ffmpeg'
    

?

Install FFmpeg in any Linux system from source

?

This howto will be helpful to all the linuxers who either want to have a fully customized installation of FFmpeg or are having some trouble in installing the default package from the distro repos or want to try the latest release.

?

First of all you will have to download the latest source from the main website . Now, untar it.

      tar -xvjf ffmpeg-0.5.tar.bz2
    

?

Install FFmpeg with default options

?

once you are done with this, in order to install FFmpeg with the default config and options run

      ./configure
    

?

from within the FFmpeg source directory. When the configuration script finishes compile it by running make

      make
    

?

If the compile finishes without any errors run 'make install' as root to install FFmpeg

      su -c 'make install'
    

?

Install FFmpeg with customized settings

?

If you want to install FFmpeg by customizing some installation options then you can pass some special parameter while running configure script. Run the following command to find out various options available while running configure script.

      ./configure --help
    

?

This will show you various options to customize the default installation. Most of the time the default installation will work for you but there is one option which most of us might need freqeuntly. It is

?

--enable-libmp3lame: This one is a must if you want to work with mp3. Encoding mp3 won't be possible without it.

?

Although in order to make this option work you will need lame installed. You will get the warning at the time of configuring it. This can be done by installing the library "libmp3lame". You can either install it directly from the repos.

      sudo apt-get install libmp3lame0
    

?

or, you can install libmp3lame directly from the source from their website .

?

Once you are done with 'lame's' installation. this run configure again, if successful run ' make ' and then ' make install ' as root.

?

原文: http://linuxers.org/tutorial/how-install-ffmpeg-linux

?

2. 安裝ImageMagick

?

ImageMagick is a suite of command line utilities for image conversion and editing. As one of the most popular image editing software suite, ImageMagick can support almost all kinds of raster image types including GIF, JPEG, PDF, PNG, Postscript, SVG, and TIFF.

?

Install ImageMagick on Debian, Ubuntu or Linux Mint

?

ImageMagick is included in a base repository of Debian-based systems. So simply use apt-get command.

      sudo apt-get install imagemagick 
    

?

Install ImageMagick on Fedora, CentOS or RHEL

?

ImageMagick is also part of standard RedHat-based systems. Thus installation is straightforward with yum command.

      sudo yum install ImageMagick 
    

?

Install ImageMagick on OpenSUSE

?

Installation of ImageMagick is straightforward on OpenSUSE with the use of zypper command.

      sudo zypper install imagemagick 
    

?

原文: http://xmodulo.com/2013/03/how-to-save-youtube-videos-on-linux.html

?

在Linux上將視頻轉(zhuǎn)換成動態(tài)gif圖片 (附:ffmpeg和ImageMagick安裝方法)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 蜜桃免费一区二区三区 | 国产一区二区久久精品 | 色视频网站在线观看 | 午夜精品一区 | 亚洲色片网站 | 亚洲在线观看免费视频 | 婷婷精品 | 91青青青国产在观免费影视 | 久久99视频精品 | 玖玖精品视频在线观看 | 黄色小视频在线免费看 | 成人午夜毛片在线看 | 污网站在线免费看 | 欧美大码毛片在线播放 | 国产欧美综合精品一区二区 | 亚洲免费观看在线视频 | 欧美日韩一区二区三区在线观看 | 久草最新在线 | 国产精品久久一区 | 总攻调教各种受肉 | 久久福利剧场 | 欧美黑人ⅹxxx片 | 欧美爽爽爽爽爽爽视频 | 哥斯拉大战金刚2在线观看免费完整版 | 亚洲永久中文字幕在线 | 成人欧美在线观看免费视频 | 免费午夜不卡毛片 | 欧美极品在线观看 | 亚洲精品久| 激情福利视频 | 国产区久久 | 亚洲综合精品一区二区三区中文 | 想要xx在线观看 | jiucao视频在线观看 | 天天干天天色 | 亚洲人成网站在线播放观看 | 午夜成人在线视频 | 欧美在线视频一区二区 | 国产激情偷乱视频一区二区三区 | 国产免费小视频 | 在线观看av网站永久 |