Answers.Body: <h1><code>ffmpeg</code> example</h1>
  <p><strong>tl;dr:</strong> The important options are <code>-preset slow</code> and <code>-crf 20</code>:</p>
  <pre><code>ffmpeg -i input -c:v libx264 -preset slow -crf 20 -vf format=yuv420p -c:a aac -ac 2 -movflags +faststart output.mp4
  </code></pre>
  <p>The other options are to ensure compatibility.</p>
  <hr />
  <h1>How to find out what Vimeo uses</h1>
  <h2>1. Download video using <code>youtube-dl</code>:</h2>
  <pre><code>youtube-dl https://vimeo.com/123456789
  </code></pre>
  <h2>2. Get encoding info</h2>
  <p>Assuming x264 is used to encode, and the encoding settings weren't stripped out, you can see what version was used and view the encoding settings.</p>
  <h3>Using <code>mediainfo</code></h3>
  <p>Refer to the &quot;Encoding settings&quot; line.</p>
  <pre><code>mediainfo input.mp4
  </code></pre>
  <h3>Using <code>strings</code> (Linux or macOS)</h3>
  <pre><code>strings input.mp4 | grep x264
  </code></pre>
  <h3>Example output</h3>
  <p><code>x264 - core 157 r10 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=34 lookahead_threads=5 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 stitchable=1 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=infinite keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=5 qpmax=69 qpstep=4 vbv_maxrate=5500 vbv_bufsize=15000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00</code></p>
  <ul>
  <li><p>This shows that <code>-preset slow</code> and <code>-crf 20</code> were used. The options are set by <code>-preset</code>, so <strong>there is no need to manually attempt to set each option</strong>.</p>
  </li>
  <li><p>VBV is enabled for streaming. In <code>ffmpeg</code> this is set with <code>-maxrate 5500k</code> and <code>-bufsize 15000k</code>. I just used the values shown in the encoding settings above.</p>
  </li>
  <li><p>Thanks to Vimeo for not stripping the SEI (they certainly could have like YouTube) and allowing us to see what they used. Perhaps they wanted to show that they appreciate the open source tools they use.</p>
  </li>
  </ul>
  <h1>Also see</h1>
  <ul>
  <li><a href="https://trac.ffmpeg.org/wiki/Encode/H.264" rel="nofollow noreferrer">FFmpeg Wiki: H.264 Video Encoding Guide</a></li>
  <li><a href="https://trac.ffmpeg.org/wiki/Encode/AAC" rel="nofollow noreferrer">FFmpeg Wiki: AAC Audio Encoding Guide</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-27T10:20:05.813Z
Answers.Text: As always +1 for this very nice answer LordNeckbeard!
Answers.UserDisplayName: p2or
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2015-03-27T03:18:54.023Z
Answers.LastActivityDate: 2021-04-15T18:53:36.867Z
Answers.LastEditDate: 2021-04-15T18:53:36.867Z
Answers.UserDisplayName: llogan
Body: <p>I like Vimeo, but I rather host a player and video myself. So I was wondering if someone knows how to get the closest result to Vimeo quality, but from FFMPEG?</p>
  
  <p>It seems that Vimeo uses 1280 pixels width for it's HD videos, but I'm wondering if there are presets or settings out in the wild that can specify bitrate, quality etc for FFMPEG?</p>
  
Tags: <ffmpeg>
Title: How to get FFMPEG output the same quality as Vimeo?
UserDisplayName: Taapo
ThreadText: # How to get FFMPEG output the same quality as Vimeo?
  
  (Asked by: username_0 on 2015-03-26)
  
  I like Vimeo, but I rather host a player and video myself. So I was wondering if someone knows how to get the closest result to Vimeo quality, but from FFMPEG?
  
  It seems that Vimeo uses 1280 pixels width for it's HD videos, but I'm wondering if there are presets or settings out in the wild that can specify bitrate, quality etc for FFMPEG?
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-03-27. Score: 5 | Accepted answer
  
  # `ffmpeg` example
  
  **tl;dr:** The important options are `-preset slow` and `-crf 20`:
  
  ```
  ffmpeg -i input -c:v libx264 -preset slow -crf 20 -vf format=yuv420p -c:a aac -ac 2 -movflags +faststart output.mp4
  
  ```
  
  The other options are to ensure compatibility.
  
  ---
  
  # How to find out what Vimeo uses
  
  ## 1. Download video using `youtube-dl`:
  
  ```
  youtube-dl https://vimeo.com/123456789
  
  ```
  
  ## 2. Get encoding info
  
  Assuming x264 is used to encode, and the encoding settings weren't stripped out, you can see what version was used and view the encoding settings.
  
  ### Using `mediainfo`
  
  Refer to the "Encoding settings" line.
  
  ```
  mediainfo input.mp4
  
  ```
  
  ### Using `strings` (Linux or macOS)
  
  ```
  strings input.mp4 | grep x264
  
  ```
  
  ### Example output
  
  `x264 - core 157 r10 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=34 lookahead_threads=5 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 stitchable=1 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=infinite keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=5 qpmax=69 qpstep=4 vbv_maxrate=5500 vbv_bufsize=15000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00`
  
  * This shows that `-preset slow` and `-crf 20` were used. The options are set by `-preset`, so **there is no need to manually attempt to set each option**.
  * VBV is enabled for streaming. In `ffmpeg` this is set with `-maxrate 5500k` and `-bufsize 15000k`. I just used the values shown in the encoding settings above.
  * Thanks to Vimeo for not stripping the SEI (they certainly could have like YouTube) and allowing us to see what they used. Perhaps they wanted to show that they appreciate the open source tools they use.
  
  # Also see
  
  * [FFmpeg Wiki: H.264 Video Encoding Guide](https://trac.ffmpeg.org/wiki/Encode/H.264)
  * [FFmpeg Wiki: AAC Audio Encoding Guide](https://trac.ffmpeg.org/wiki/Encode/AAC)
  
  > **Comments:**
  > **username_2**: As always +1 for this very nice answer LordNeckbeard!  
  
  ---
  
  