Answers.Body: <p>Since you're asking for "uncompressed" I assume you don't care about file size. If so, I suggest rendering to mjpeg. This smoothing issue is because your command is defaulting to h.264. The difference between h.264 and mjpeg is that mjpeg is intra-frame compression only, but h.264 is intra- and inter-frame compression. As such, mjpeg is a massive file by comparison, but each frame is unique and not dependent on previous frames like in h.264. One benefit is frame fidelity, enough should fix your issue. Mjpeg is also pretty universal. You won't need a codec pack to play it. </p>
  
  <p>To make your images into an mjpeg video run:</p>
  
  <pre><code> ffmpeg -framerate 20 -i slice%04d.png c:v mjpeg -q:v 3 -an output.mov
  </code></pre>
  
  <ul>
  <li><code>c:v mjpeg</code> means video codec</li>
  <li><code>-q:v 3</code> is a quality control factor. Range is a linear 2-31, lower is better. Tune the number to your tastes. </li>
  <li><code>-an</code> means no audio channel included. This is good to run if that's your goal, as some codecs confuse players if you don't. </li>
  <li>Output is mov but I'm pretty sure you can wrap mp4 or avi too. Mp4 seems mostly likely to work for your users on windows as well as mac.</li>
  </ul>
  
  <p>Before you try this, maybe don't quite give up on h.264 yet. Run your original command with the crf flag. </p>
  
  <pre><code> ffmpeg -framerate 20 -i slice%04d.png -crf 18 -an test.mp4
  </code></pre>
  
  <ul>
  <li><code>crf</code> is "constant rate factor", and is a quality control. Range is exponential 0-60something. Lower is better and 18 is considered functionally lossless.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-31T02:51:12.187Z
Answers.Text: This was a really insightful answer, even disregarding the commands you came up with, so thank you for that! The first option worked when I outputted to .mov and the result looks great! It actually failed to run as an .mp4 for the same command, which is interesting. The latter command failed for me with the latest ffmpeg that I downloaded and compiled on my system today (version 4.1.4) because it claimed it did not recognize the `-crf` command. Not sure what's up with that.
Answers.UserDisplayName: spektr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-31T14:55:51.610Z
Answers.Text: @spektr Probably have to add `-c:v libx264` to get the crf flag to work. Let me know.
Answers.UserDisplayName: user3643
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-31T15:01:31.210Z
Answers.Text: Optionally, run the h264 command on your mjpeg output if you want a smaller file size.
Answers.UserDisplayName: user3643
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-31T02:44:19.143Z
Answers.LastActivityDate: 2019-07-31T02:44:19.143Z
Answers.UserDisplayName: user3643
Body: <p>I have been digging around here and on the ffmpeg site trying to find some commands to use to generate a movie from a set of images. The command I tried that gives me a video I can watch on my MacBook is</p>
  
  <pre><code>ffmpeg -framerate 20 -i slice%04d.png test.mp4
  </code></pre>
  
  <p>This produces a video but the problem is it smooths out some of the features. I need to capture the sharp features of these images. To give a sense, a single frame from this video is shown below.</p>
  
  <p><a href="https://i.sstatic.net/7TtDq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7TtDq.png" alt="time slicing sample image"></a></p>
  
  <p>The video is smoothing out some of the details, especially from frame to frame. I assume this is a compression issue, so I would like to just avoid compressing the video. Unfortunately, everything I have tried from other help sites and the ffmpeg site do not produce a video file I can actually visualize on my mac. Can anyone provide me with a better command line call to solve this problem?</p>
  
Tags: <video><ffmpeg><video-quality><compression>
Title: How to prevent frame smoothing (i.e. get really sharp frame images) when making a video with ffmpeg?
UserDisplayName: spektr
ThreadText: # How to prevent frame smoothing (i.e. get really sharp frame images) when making a video with ffmpeg?
  
  (Asked by: username_0 on 2019-07-31)
  
  I have been digging around here and on the ffmpeg site trying to find some commands to use to generate a movie from a set of images. The command I tried that gives me a video I can watch on my MacBook is
  
  ```
  ffmpeg -framerate 20 -i slice%04d.png test.mp4
  
  ```
  
  This produces a video but the problem is it smooths out some of the features. I need to capture the sharp features of these images. To give a sense, a single frame from this video is shown below.
  
  [![time slicing sample image](https://i.sstatic.net/7TtDq.png)](https://i.sstatic.net/7TtDq.png)
  
  The video is smoothing out some of the details, especially from frame to frame. I assume this is a compression issue, so I would like to just avoid compressing the video. Unfortunately, everything I have tried from other help sites and the ffmpeg site do not produce a video file I can actually visualize on my mac. Can anyone provide me with a better command line call to solve this problem?
  
  **Tags:** video, ffmpeg, video-quality, compression
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-31. Score: 2 | Accepted answer
  
  Since you're asking for "uncompressed" I assume you don't care about file size. If so, I suggest rendering to mjpeg. This smoothing issue is because your command is defaulting to h.264. The difference between h.264 and mjpeg is that mjpeg is intra-frame compression only, but h.264 is intra- and inter-frame compression. As such, mjpeg is a massive file by comparison, but each frame is unique and not dependent on previous frames like in h.264. One benefit is frame fidelity, enough should fix your issue. Mjpeg is also pretty universal. You won't need a codec pack to play it.
  
  To make your images into an mjpeg video run:
  
  ```
   ffmpeg -framerate 20 -i slice%04d.png c:v mjpeg -q:v 3 -an output.mov
  
  ```
  
  * `c:v mjpeg` means video codec
  * `-q:v 3` is a quality control factor. Range is a linear 2-31, lower is better. Tune the number to your tastes.
  * `-an` means no audio channel included. This is good to run if that's your goal, as some codecs confuse players if you don't.
  * Output is mov but I'm pretty sure you can wrap mp4 or avi too. Mp4 seems mostly likely to work for your users on windows as well as mac.
  
  Before you try this, maybe don't quite give up on h.264 yet. Run your original command with the crf flag.
  
  ```
   ffmpeg -framerate 20 -i slice%04d.png -crf 18 -an test.mp4
  
  ```
  
  * `crf` is "constant rate factor", and is a quality control. Range is exponential 0-60something. Lower is better and 18 is considered functionally lossless.
  
  > **Comments:**
  > **username_0**: This was a really insightful answer, even disregarding the commands you came up with, so thank you for that! The first option worked when I outputted to .mov and the result looks great! It actually failed to run as an .mp4 for the same command, which is interesting. The latter command failed for me with the latest ffmpeg that I downloaded and compiled on my system today (version 4.1.4) because it claimed it did not recognize the `-crf` command. Not sure what's up with that.  
  > **username_1**: @username_0 Probably have to add `-c:v libx264` to get the crf flag to work. Let me know.  
  > **username_1**: Optionally, run the h264 command on your mjpeg output if you want a smaller file size.  
  
  ---
  
  