Answers.Body: <p>libx264 is a very efficient encoder, so that bitrate isn't unusual. In fact, it's on the higher side, but since you're capturing a game, I expect there is constant motion involved, and your preset is ultrafast which disables some of the aggressive compression.</p>
  
  <p>When you say <code>80MB/s</code>, I believe you're thinking of uncompressed full raster i.e. 1280 x 720 x 12 bits/pixel x 60 fps. Lossless does not mean uncompressed, just like there can be a compressed ZIP of a binary program.</p>
  
  <hr>
  
  <p>BTW, the <code>-framerate 60</code> goes before <code>-i video="Game Capture 4K60 Pro Video 01"</code> as it's an input option.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-17T19:37:23.723Z
Answers.LastActivityDate: 2018-10-17T19:37:23.723Z
Answers.UserDisplayName: Gyan
Answers.Body: <p>Whilst the x264 codec is quite efficient, if you want to make sure x264 does not do as much compression whilst there is lots of motion, you could use use quantization parameter <code>-qp 0</code>. There is a lot of information at the following links:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/40668616/whats-the-difference-with-crf-and-qp-in-ffmpeg">https://stackoverflow.com/questions/40668616/whats-the-difference-with-crf-and-qp-in-ffmpeg</a></li>
  <li><a href="http://slhck.info/articles/crf" rel="nofollow noreferrer">http://slhck.info/articles/crf</a></li>
  </ul>
  <p>A key part of the article is this:</p>
  <blockquote>
  <p>If you had only simple ways at hand to compare the quality of video
  sequences (e.g., based on a per-frame measurement of signal to noise
  ratio, PSNR), you may look at a CRF encoding and say it was lower
  quality than the CQP variant. But if you’re a human being,
  subjectively, the CRF copy will look equal or better to the CQP
  version</p>
  </blockquote>
  <p>However, a user on the stackoverflow link above seems to think the <code>-qp 0</code> was better for their game screenrecordings. This could potentially be a better fit if you're doing frame rate analysis (ie. the compression might be imperceptible to you, but not by your frame rate analyzer).</p>
  <p>This will result in higher file sizes you expect.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-03T17:28:29.207Z
Answers.LastActivityDate: 2020-10-03T17:28:29.207Z
Answers.UserDisplayName: aleksk
Body: <p>I’ve been attempting to do lossless game capture as I’ve been working on a program to do frame rate analysis. I haven’t had much luck finding a program that does lossless capture as AmaRecTV, Dxtory, and Virtualdub all seem to be abandoned.  I’m trying to use FFmpeg and have come up with the following command:</p>
  
  <p><code>ffmpeg -y -f dshow -rtbufsize 500M -i video="Game Capture 4K60 Pro Video 01" -framerate 60 -vsync 0 -c:v libx264 -preset ultrafast -crf 0 -pix_fmt yuv420p "e:\Captures\out.mkv"</code></p>
  
  <p>Unfortunately, the file size doesn’t seem large enough to be lossless.  For example, according to MediaInfo, I got an overall bit rate of 132 Mb/s (16.5 MB/s) for a 720p 60 fps capture.  However, I’m pretty sure that a lossless 720p, 60 fps, 4:2:0 file should be closer to 640 Mb/s (80MB/s).</p>
  
  <p>I’m using Windows 10 1809 x64, a nightly build of FFmpeg x64 that is newer than 4.0.2, Nvidia 399.24, and an Elgato 4K60 Pro.</p>
  
  <p>Does this command produce lossless capture?  And how can I improve it?</p>
  
Tags: <ffmpeg><video-capture>
Title: Lossless Capture with FFmpeg
UserDisplayName: Trevor
ThreadText: # Lossless Capture with FFmpeg
  
  (Asked by: username_0 on 2018-10-17)
  
  I’ve been attempting to do lossless game capture as I’ve been working on a program to do frame rate analysis. I haven’t had much luck finding a program that does lossless capture as AmaRecTV, Dxtory, and Virtualdub all seem to be abandoned. I’m trying to use FFmpeg and have come up with the following command:
  
  `ffmpeg -y -f dshow -rtbufsize 500M -i video="Game Capture 4K60 Pro Video 01" -framerate 60 -vsync 0 -c:v libx264 -preset ultrafast -crf 0 -pix_fmt yuv420p "e:\Captures\out.mkv"`
  
  Unfortunately, the file size doesn’t seem large enough to be lossless. For example, according to MediaInfo, I got an overall bit rate of 132 Mb/s (16.5 MB/s) for a 720p 60 fps capture. However, I’m pretty sure that a lossless 720p, 60 fps, 4:2:0 file should be closer to 640 Mb/s (80MB/s).
  
  I’m using Windows 10 1809 x64, a nightly build of FFmpeg x64 that is newer than 4.0.2, Nvidia 399.24, and an Elgato 4K60 Pro.
  
  Does this command produce lossless capture? And how can I improve it?
  
  **Tags:** ffmpeg, video-capture
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-10-17. Score: 2 | Accepted answer
  
  libx264 is a very efficient encoder, so that bitrate isn't unusual. In fact, it's on the higher side, but since you're capturing a game, I expect there is constant motion involved, and your preset is ultrafast which disables some of the aggressive compression.
  
  When you say `80MB/s`, I believe you're thinking of uncompressed full raster i.e. 1280 x 720 x 12 bits/pixel x 60 fps. Lossless does not mean uncompressed, just like there can be a compressed ZIP of a binary program.
  
  ---
  
  BTW, the `-framerate 60` goes before `-i video="Game Capture 4K60 Pro Video 01"` as it's an input option.
  
  
  ---
  
  ### Answer by username_2 on 2020-10-03. Score: 0
  
  Whilst the x264 codec is quite efficient, if you want to make sure x264 does not do as much compression whilst there is lots of motion, you could use use quantization parameter `-qp 0`. There is a lot of information at the following links:
  
  * <https://stackoverflow.com/questions/40668616/whats-the-difference-with-crf-and-qp-in-ffmpeg>
  * <http://slhck.info/articles/crf>
  
  A key part of the article is this:
  
  > If you had only simple ways at hand to compare the quality of video
  > sequences (e.g., based on a per-frame measurement of signal to noise
  > ratio, PSNR), you may look at a CRF encoding and say it was lower
  > quality than the CQP variant. But if you’re a human being,
  > subjectively, the CRF copy will look equal or better to the CQP
  > version
  
  However, a user on the stackoverflow link above seems to think the `-qp 0` was better for their game screenrecordings. This could potentially be a better fit if you're doing frame rate analysis (ie. the compression might be imperceptible to you, but not by your frame rate analyzer).
  
  This will result in higher file sizes you expect.
  
  
  ---
  
  