我尝试使用 FFmpeg 剪切 gif,-ss
但-t
与原始 gif 相比,质量急剧下降。
我正在使用这个命令:
ffmpeg -y `
-i "S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.gif" `
-ss 1.65 -t 1.65 `
"S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo Short.gif"
我尝试使用-c copy
,但收到一条错误消息Error writing trailer
,我还看到有一个 gif 复用器-c:v gif
,但我似乎找不到它的任何选项。
我尝试做的事情可行吗?剪切 gif 而不损失质量?
完整日志:
PS C:\Windows\system32> ffmpeg -y `
>> -i "S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.gif" `
>> -ss 1.65 -t 1.65 `
>> "S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo Short.gif"
ffmpeg version N-94652-g808a6717e0 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.101 / 58. 55.101
libavformat 58. 31.104 / 58. 31.104
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.101 / 7. 58.101
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, gif, from 'S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.gif':
Duration: 00:00:04.01, start: 0.000000, bitrate: 34953 kb/s
Stream #0:0: Video: gif, bgra, 853x480 [SAR 64:64 DAR 853:480], 30 fps, 30 tbr, 100 tbn, 100 tbc
Stream mapping:
Stream #0:0 -> #0:0 (gif (native) -> gif (native))
Press [q] to stop, [?] for help
Output #0, gif, to 'S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo Short.gif':
Metadata:
encoder : Lavf58.31.104
Stream #0:0: Video: gif, bgr8, 853x480 [SAR 1:1 DAR 853:480], q=2-31, 200 kb/s, 30 fps, 100 tbn, 30 tbc
Metadata:
encoder : Lavc58.55.101 gif
frame= 49 fps= 40 q=-0.0 Lsize= 9301kB time=00:00:01.64 bitrate=46460.4kbits/s speed=1.33x
video:9301kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000210%
原始 gif 创作:
ffmpeg -y `
-i "S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.ts" `
-vf fps=30,scale=-1:480:flags=lanczos,palettegen `
"S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.png"
ffmpeg -y `
-i "S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.ts" `
-i "S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.png" `
-filter_complex "fps=30,scale=-1:480:flags=lanczos[x];[x][1:v]paletteuse" `
"S:\Videos\Saved Clips\PSW\Mad Wooloo\Mad Wooloo EL.gif"