Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
fuss:ffmpeg [2017/11/29 08:15] – [Install a Full FFmpeg Distribution on Debian] officefuss:ffmpeg [2019/01/04 19:24] – [Convert Video to GIF Animation] office
Line 304: Line 304:
 ffmpeg -i dump.gif -vf "setpts=0.25*PTS" -r 7 final.gif ffmpeg -i dump.gif -vf "setpts=0.25*PTS" -r 7 final.gif
 </code> </code>
-  * ''setpts=0.25*PTS'' will set the speed as 4 times the current speed, +  * ''setpts=0.25*PTS'' will set the speed as $4times the current speed, 
-  * ''-r 1'' will drop or duplicate frames to achieve 7 frames per second+  * ''-r 1'' will drop or duplicate frames to achieve $7frames per second
  
 Achieving an acceptable GIF is a games of push and pull between the value of ''-r'' and the value of ''setpts''. Achieving an acceptable GIF is a games of push and pull between the value of ''-r'' and the value of ''setpts''.
  
 +Other very useful filters are:
 +  * ''decimate'' - will merge / drop duplicate frames hence lowering the GIF size,
 +  * ''deflicker'' - will attempt to stabilize the video,
 +  * ''scale'' - will scale the movie (down) and hence can be used to lower the file size
 +
 +In one pass:
 +<code bash>
 +ffmpeg -i a.gif -vf "deflicker, decimate=cycle=4, fps=8, setpts=0.35*PTS, scale=360:trunc(ow/a/2)*2" b.gif
 +</code>
 +the actions performed will be:
 +  * ''deflicker'' - attempt to deflicker / stabilize the video,
 +  * ''decimate=cycle=4'' - crop duplicate frames at a rate of $1$ duplicate frame out of $4$,
 +  * ''fps=8'' - attempt to set the framerate to $8$ frames per second,
 +  * ''setpts=0.35*PTS'' - speed up the movie by $0.35$ of the original speed.
 +
 +====== Lowest Common Denominator Settings Compatible with All Sites ======
 +
 +The settings produce an output file with the ''faststart'' flag such that the video can be sought through without having to buffer the entire file.
 +<code bash>
 +ffmpeg -i $INPUT_FILE \
 +  -c:v libx264 -crf 23 -profile:v baseline -level 3.0 -pix_fmt yuv420p \
 +  -c:a aac -ac 2 -b:a 128k \
 +  -movflags faststart \
 +  output.mp4
 +</code>
  

fuss/ffmpeg.txt · Last modified: 2024/01/14 23:08 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.