Answers.Body: <p>Yes, you do need a ffmpeg build with gray pixel format enabled. You should get your binary from the Windows link at <a href="https://ffmpeg.org/download.html" rel="nofollow noreferrer">ffmpeg</a>. Download the latest 32-bit static build.</p>
  
  <p>You can check if your build has gray enabled by running </p>
  
  <pre><code>ffmpeg -pix_fmts | findstr /r gray
  </code></pre>
  
  <p>It should list an entry for gray. </p>
  
  <p>And use <code>format=gray</code> in your <code>vf</code> chain and <code>-pix_fmt yuv420p</code> together for broad compatibility.</p>
  
  <blockquote>
    <p>The command below is for linux. <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr" rel="nofollow noreferrer"><code>grep</code></a> will work as <a href="http://man7.org/linux/man-pages/man1/grep.1.html" rel="nofollow noreferrer"><code>findstr</code></a>!</p>
  
  <pre><code>ffmpeg -pix_fmts | grep -i gray
  </code></pre>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-31T10:55:24.007Z
Answers.Text: Running your command on my current FFMPEG results in 
    IO... gray                   1             8
    IO... gray16be               1            16
    IO... gray16le               1            16
  Does this mean it has gray enabled?
Answers.UserDisplayName: WoogieBoogie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-31T11:16:54.290Z
Answers.Text: Ok, just follow the last line of my answer. Should work with your current build.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-31T12:43:31.907Z
Answers.Text: Running the command 
  ffmpeg -i input.mov -vf format=gray -pix_fmt yuv420p output.mp4
  results in a black screen.  I wonder if trying to do the conversion from .mov to mp4 at the same time is the problem? Now I think of it I'll try separate commands
Answers.UserDisplayName: WoogieBoogie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-31T12:49:12.770Z
Answers.Text: Separating out the conversion from .mov -> .mp4 and the conversion to grayscale (using your commands) worked. Thanks :)
Answers.UserDisplayName: WoogieBoogie
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-03-31T09:55:20.923Z
Answers.LastActivityDate: 2019-01-15T10:24:35.947Z
Answers.LastEditDate: 2019-01-15T10:24:35.947Z
Answers.UserDisplayName: Gyan
Body: <p>I am currently using an FFMPEG command like:</p>
  
  <p>ffmpeg -i input.mov -vf scale=1920:1080 output.mp4</p>
  
  <p>to convert varying input format file to a fixed resolution MP4 output file.  One final step I need is to make the output Black and White (the input files will be full color).</p>
  
  <p>I have tried both 
      -pix_fmt gray 
  and
      -vf format=gray,format=yuv422p</p>
  
  <p>but both just result in a black output video.</p>
  
  <p>After much trawling of google, it looks like the FFMPEG exe I downloaded (for windows) wasn't compiled with the "-enable-gray" option, but I don't know if this makes any difference and don't know how to obtain a windows FFMPEG with this option enabled (building FFMPEG myself looks like a lot of hard work).
  Any advice welcome!  Thanks.</p>
  
  <p>PS I should add that the conversion I'm currently doing and any grayscale conversion could be separate steps if required.</p>
  
Tags: <ffmpeg>
Title: Convert variable input formats to black and white MP4
UserDisplayName: WoogieBoogie
ThreadText: # Convert variable input formats to black and white MP4
  
  (Asked by: username_0 on 2016-03-31)
  
  I am currently using an FFMPEG command like:
  
  ffmpeg -i input.mov -vf scale=1920:1080 output.mp4
  
  to convert varying input format file to a fixed resolution MP4 output file. One final step I need is to make the output Black and White (the input files will be full color).
  
  I have tried both
  -pix\_fmt gray
  and
  -vf format=gray,format=yuv422p
  
  but both just result in a black output video.
  
  After much trawling of google, it looks like the FFMPEG exe I downloaded (for windows) wasn't compiled with the "-enable-gray" option, but I don't know if this makes any difference and don't know how to obtain a windows FFMPEG with this option enabled (building FFMPEG myself looks like a lot of hard work).
  Any advice welcome! Thanks.
  
  PS I should add that the conversion I'm currently doing and any grayscale conversion could be separate steps if required.
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-31. Score: 4 | Accepted answer
  
  Yes, you do need a ffmpeg build with gray pixel format enabled. You should get your binary from the Windows link at [ffmpeg](https://ffmpeg.org/download.html). Download the latest 32-bit static build.
  
  You can check if your build has gray enabled by running
  
  ```
  ffmpeg -pix_fmts | findstr /r gray
  
  ```
  
  It should list an entry for gray.
  
  And use `format=gray` in your `vf` chain and `-pix_fmt yuv420p` together for broad compatibility.
  
  > The command below is for linux. [`grep`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr) will work as [`findstr`](http://man7.org/linux/man-pages/man1/grep.1.html)!
  >
  > ```
  > ffmpeg -pix_fmts | grep -i gray
  >
  > ```
  
  > **Comments:**
  > **username_0**: Running your command on my current FFMPEG results in    IO... gray                   1             8   IO... gray16be               1            16   IO... gray16le               1            16 Does this mean it has gray enabled?  
  > **username_1**: Ok, just follow the last line of my answer. Should work with your current build.  
  > **username_0**: Running the command  ffmpeg -i input.mov -vf format=gray -pix_fmt yuv420p output.mp4 results in a black screen.  I wonder if trying to do the conversion from .mov to mp4 at the same time is the problem? Now I think of it I'll try separate commands  
  > **username_0**: Separating out the conversion from .mov -> .mp4 and the conversion to grayscale (using your commands) worked. Thanks :)  
  
  ---
  
  