Difference between revisions of "Ffmpeg-examples"

From wikipost
Jump to navigationJump to search
Line 7: Line 7:
  
  
 +
ffmpeg -y -i INFILE.mp4 -c:v libx264 -crf 23  -vb 200k -c:a copy OUTFILE.mp4
 +
 +
 +
Audio codecs and options:
 +
 +
-acodec libvo_aacenc -ac 1 -ab 94000 -ar 16000
 +
-acodec aac -ac 2 -ab 128k
 +
-acodec copy
 +
-an
 +
 +
 +
Time selection:
 +
 +
    -ss = start-time offset (0 = begin, 5:00 = after 5 minutes)
 +
    -t  = duration (1:00 = one minute, 1:45:00 = 1 hour and 45 minutes)
 +
 +
    -ss 2:23
 +
    -ss 1:49 -t 1:58:02
 +
    -t 2:15:06
 +
 +
 +
Screen resolution:
 +
 +
    -s 1280x720
 +
 +
 +
Resize and Crop options:
 +
 +
  Resize: -vf scale=iw*2:ih
 +
 +
      -vf "setsar=1/0.75" // Set the pixel sample aspect ratio.
 +
      -vf "setdar=64:27"  // Set the frame display aspect ratio.
 +
 +
  Crop: -vf crop=<width>:<height>:<from t/b>:<from l/r>
 +
 +
      -vf crop=680:440:300:50
 +
 +
 +
keyframes:
 +
 +
      -force_key_frames 1
  
ffmpeg -y -i INFILE.mp4 -c:v libx264 -crf 23  -vb 200k -c:a copy OUTFILE.mp4
 
  
 
</code>
 
</code>

Revision as of 13:35, 28 July 2020

Bunch of ffmpeg examples on one page


ffmpeg -y -i INFILE.mp4 -vcodec mpeg4 -vb 200k -acodec libvo_aacenc -ac 1 -ab 94000 -ar 16000 OUTFILE.mp4


ffmpeg -y -i INFILE.mp4 -c:v libx264 -crf 23 -vb 200k -c:a copy OUTFILE.mp4


Audio codecs and options:

-acodec libvo_aacenc -ac 1 -ab 94000 -ar 16000 
-acodec aac -ac 2 -ab 128k
-acodec copy
-an


Time selection:

   -ss = start-time offset (0 = begin, 5:00 = after 5 minutes)
   -t  = duration (1:00 = one minute, 1:45:00 = 1 hour and 45 minutes)
   -ss 2:23
   -ss 1:49 -t 1:58:02
   -t 2:15:06


Screen resolution:

    -s 1280x720


Resize and Crop options:

  Resize: -vf scale=iw*2:ih
     -vf "setsar=1/0.75" // Set the pixel sample aspect ratio.
     -vf "setdar=64:27"  // Set the frame display aspect ratio.
  Crop: -vf crop=<width>:<height>:<from t/b>:<from l/r>
     -vf crop=680:440:300:50


keyframes:

     -force_key_frames 1