Difference between revisions of "Ffmpeg"

From Wasya Wiki
Jump to: navigation, search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
  
 
  ffmpeg -i <input>.mp4 <output>.webm
 
  ffmpeg -i <input>.mp4 <output>.webm
  
  ffmpeg -i MVI_0083.MP4 -s 960x540 20190322_out.webm
+
  ffmpeg -i MVI_0083.MP4 -s 960x540 -crf 18 20190322_out.webm
 
  ffmpeg -i MVI_0083.MP4 -s 960x540 20190322_out.mp4
 
  ffmpeg -i MVI_0083.MP4 -s 960x540 20190322_out.mp4
 +
ffmpeg.exe -i "test.avi" -c:v libx264 -crf 20 -c:a aac -strict -2 "test.mp4"
 +
 +
You might want to use the -ss and -t options to create short test encodes. -ss being the start time and -t being the duration — both in seconds. You probably don’t need to encode the entire video to determine what’s acceptable.
 +
 +
=== crf ===
 +
* 0 = lossless
 +
* 18 = visually lossless
 +
* 23 = default
 +
* 28 = sane low quality
 +
* 51 = worst quality possible
 +
* The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.
 +
 +
=== Common Video Screen Sizes ===
 +
* [https://wasyaco.com/wp-content/uploads/2024/02/Vector_Video_Standards8.jpeg screens]
 +
 +
* 960x540 horizontal (540x960 vertical)
 +
* 640x360
 +
* 512x288 (288x512)
 +
* 340x202
 +
 +
* 360x240 3:2
 +
* 720x480 3:2

Latest revision as of 18:41, 5 February 2024


ffmpeg -i <input>.mp4 <output>.webm
ffmpeg -i MVI_0083.MP4 -s 960x540 -crf 18 20190322_out.webm
ffmpeg -i MVI_0083.MP4 -s 960x540 20190322_out.mp4
ffmpeg.exe -i "test.avi" -c:v libx264 -crf 20 -c:a aac -strict -2 "test.mp4"

You might want to use the -ss and -t options to create short test encodes. -ss being the start time and -t being the duration — both in seconds. You probably don’t need to encode the entire video to determine what’s acceptable.

crf

  • 0 = lossless
  • 18 = visually lossless
  • 23 = default
  • 28 = sane low quality
  • 51 = worst quality possible
  • The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.

Common Video Screen Sizes

  • 960x540 horizontal (540x960 vertical)
  • 640x360
  • 512x288 (288x512)
  • 340x202
  • 360x240 3:2
  • 720x480 3:2