Answers.Body: <p>You specify a preset and a quality value at the same time and by that overriding the preset.
  I would also recommend you don't encode with ffmpeg while capturing as this would be pretty slow on most PCs.</p>
  
  <p>The "error" in your ffmpeg commandline is the option <code>-crf 1</code>. <code>CRF</code> is a quality setting of x264 and the lower the value the higher the bitrate of the video will be. Setting it to <code>1</code> will make the video pretty much lossless. Just leave that command out and maybe use a preset like <code>medium</code> or <code>slow</code> and not <code>ultrafast</code> like you have right now to get a decent quality.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-01T18:22:11.373Z
Answers.LastActivityDate: 2014-09-02T01:53:27.130Z
Answers.LastEditDate: 2014-09-02T01:53:27.130Z
Answers.UserDisplayName: timonsku
Answers.Body: <h1><code>-preset</code></h1>
  
  <p>Use the slowest preset that is fast enough that it does not drop frames. You can see if <code>ffmpeg</code> is dropping frames in the console output (if I recall correctly). Presets are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow.</p>
  
  <h1><code>-crf</code></h1>
  
  <p>Use the highest <code>-crf</code> value that still provides an acceptable quality level. Range is 0-51. 0 is lossless, 18 is generally considered to be visually lossless or nearly so, 23 is default, and 51 is worst quality. Using a value of 1 will likely result in a huge file.</p>
  
  <h3>Also see:</h3>
  
  <ul>
  <li><a href="https://trac.ffmpeg.org/wiki/Encode/H.264">FFmpeg H.264 Video Encoding Guide</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-06T08:28:56.090Z
Answers.Text: Thanks a lot for the same input file the initial size was 1.3Go and now only 39Mo.
Answers.UserDisplayName: La Chamelle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-24T23:45:40.390Z
Answers.Text: ultrafast for anything but lossless is a bad idea.  `-preset superfast -x264-params cabac=0` is MUCH better quality per bitrate (RD), and almost as fast.
Answers.UserDisplayName: Peter Cordes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-02T01:50:30.483Z
Answers.LastActivityDate: 2014-09-02T01:50:30.483Z
Answers.UserDisplayName: llogan
Body: <p>I try to create video with <a href="http://code.google.com/p/gource/wiki/Videos" rel="nofollow">gource</a>. I succeed with the following command line:</p>
  
  <pre><code>gource $LOG_FILE --log-format custom --stop-at-end --caption-file ${FILENAME}_captions.log --caption-duration 3 --title $TITLE --seconds-per-day 0.7 --auto-skip-seconds 1 --date-format\
   "%d/%m/%y" --hide "mouse,progress" --user-scale 0.6 --caption-size 20 -1380x950 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420\
  p -crf 1 -threads 4 -bf 0 $FILENAME.mp4
  </code></pre>
  
  <p>But the video are too big, 9Go for 4 min. How can I reduce the size with ffmpeg?</p>
  
  <p>I use Fedora.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-24T23:53:50.423Z
Comments.Text: Others answers already addressed your `-crf 1`, but `-bf 0` makes little sense.  x264 only uses B frames when they will help overall quality.  If you need compat with ancient hardware players, use `-profile baseline`.  (One case where x264's b-frame decisions aren't optimal (or weren't in 2009?) is a series of not-very-similar still pictures, where lots of I macroblocks are needed: http://forum.doom9.org/showthread.php?t=145005)
Comments.UserDisplayName: Peter Cordes
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-24T23:55:01.040Z
Comments.Text: Also, x264 auto-detects how many threads to use.  Only use `-threads` if you want it not to saturate all your CPUs.  (like if `gource` needs significant CPU time?)
Comments.UserDisplayName: Peter Cordes
Tags: <ffmpeg>
Title: gource and ffmpeg reduce video size
UserDisplayName: La Chamelle
ThreadText: # gource and ffmpeg reduce video size
  
  (Asked by: username_0 on 2014-09-01)
  
  I try to create video with [gource](http://code.google.com/p/gource/wiki/Videos). I succeed with the following command line:
  
  ```
  gource $LOG_FILE --log-format custom --stop-at-end --caption-file ${FILENAME}_captions.log --caption-duration 3 --title $TITLE --seconds-per-day 0.7 --auto-skip-seconds 1 --date-format\
   "%d/%m/%y" --hide "mouse,progress" --user-scale 0.6 --caption-size 20 -1380x950 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420\
  p -crf 1 -threads 4 -bf 0 $FILENAME.mp4
  
  ```
  
  But the video are too big, 9Go for 4 min. How can I reduce the size with ffmpeg?
  
  I use Fedora.
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Others answers already addressed your `-crf 1`, but `-bf 0` makes little sense.  x264 only uses B frames when they will help overall quality.  If you need compat with ancient hardware players, use `-profile baseline`.  (One case where x264's b-frame decisions aren't optimal (or weren't in 2009?) is a series of not-very-similar still pictures, where lots of I macroblocks are needed: http://forum.doom9.org/showthread.php?t=145005)  
  > **username_1**: Also, x264 auto-detects how many threads to use.  Only use `-threads` if you want it not to saturate all your CPUs.  (like if `gource` needs significant CPU time?)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2014-09-02. Score: 7 | Accepted answer
  
  # `-preset`
  
  Use the slowest preset that is fast enough that it does not drop frames. You can see if `ffmpeg` is dropping frames in the console output (if I recall correctly). Presets are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow.
  
  # `-crf`
  
  Use the highest `-crf` value that still provides an acceptable quality level. Range is 0-51. 0 is lossless, 18 is generally considered to be visually lossless or nearly so, 23 is default, and 51 is worst quality. Using a value of 1 will likely result in a huge file.
  
  ### Also see:
  
  * [FFmpeg H.264 Video Encoding Guide](https://trac.ffmpeg.org/wiki/Encode/H.264)
  
  > **Comments:**
  > **username_0**: Thanks a lot for the same input file the initial size was 1.3Go and now only 39Mo.  
  > **username_1**: ultrafast for anything but lossless is a bad idea.  `-preset superfast -x264-params cabac=0` is MUCH better quality per bitrate (RD), and almost as fast.  
  
  ---
  
  ### Answer by username_2 on 2014-09-01. Score: 4
  
  You specify a preset and a quality value at the same time and by that overriding the preset.
  I would also recommend you don't encode with ffmpeg while capturing as this would be pretty slow on most PCs.
  
  The "error" in your ffmpeg commandline is the option `-crf 1`. `CRF` is a quality setting of x264 and the lower the value the higher the bitrate of the video will be. Setting it to `1` will make the video pretty much lossless. Just leave that command out and maybe use a preset like `medium` or `slow` and not `ultrafast` like you have right now to get a decent quality.
  
  
  ---
  
  