Answers.Body: <p>In the end I add to use the following options and tell ffmpeg wich colorSpace i am using and how to decode it to display on screen.</p>
  
  <pre><code>ffmpeg -f rawvideo -r 30 -pix_fmt rgba -s 1920x1017 -i - -threads 0 -y -c:v libopenh264 -pix_fmt yuv444p -b:v 8000K -vf vflip,scale=out_color_matrix=bt709 -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-26T10:03:09.557Z
Answers.LastActivityDate: 2019-03-26T10:03:09.557Z
Answers.UserDisplayName: Paltoquet
Body: <p>I have a list of raw bitmap in rgba format, captured with an openGL frameBuffer.
  I want to export them in a video, currently i am using the following command:</p>
  
  <pre><code>ffmpeg -f rawvideo -r 30 -pix_fmt rgba -s 1920x1018 -i - -threads 0 -y -c:v libx264 -pix_fmt yuv420p -b:v 8000K -vf vflip,drawbox=10:20:200:60:red@1:t=fill result.mp4
  </code></pre>
  
  <p>When I open the output video in different viewers (vlc, windows media player), the resulting color are shifted and appears more green. </p>
  
  <p>For example I draw a solid red rectangle (255, 0, 0) got translated to (255, 24, 0)</p>
  
  <p>I have played with pix_fmt and the format filter with no result.</p>
  
  <p><a href="https://i.sstatic.net/Ycj2U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ycj2U.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-18T10:02:30.707Z
Comments.Text: *got translated to* --> measured, how?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-18T10:04:23.877Z
Comments.Text: screen capture and paint's color Picker, but it's visible in the video. The player might be the problem i try 2 of them, if you know a way to keep the original pixel value just for testing purposes
Comments.UserDisplayName: Paltoquet
Tags: <ffmpeg><colorspace>
Title: Color shift FFmpeg raw RGBA images to YUV format
UserDisplayName: Paltoquet
ThreadText: # Color shift FFmpeg raw RGBA images to YUV format
  
  (Asked by: username_0 on 2019-03-18)
  
  I have a list of raw bitmap in rgba format, captured with an openGL frameBuffer.
  I want to export them in a video, currently i am using the following command:
  
  ```
  ffmpeg -f rawvideo -r 30 -pix_fmt rgba -s 1920x1018 -i - -threads 0 -y -c:v libx264 -pix_fmt yuv420p -b:v 8000K -vf vflip,drawbox=10:20:200:60:red@1:t=fill result.mp4
  
  ```
  
  When I open the output video in different viewers (vlc, windows media player), the resulting color are shifted and appears more green.
  
  For example I draw a solid red rectangle (255, 0, 0) got translated to (255, 24, 0)
  
  I have played with pix\_fmt and the format filter with no result.
  
  [![enter image description here](https://i.sstatic.net/Ycj2U.png)](https://i.sstatic.net/Ycj2U.png)
  
  **Tags:** ffmpeg, colorspace
  
  > **Comments:**
  > **username_1**: *got translated to* --> measured, how?  
  > **username_0**: screen capture and paint's color Picker, but it's visible in the video. The player might be the problem i try 2 of them, if you know a way to keep the original pixel value just for testing purposes  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-03-26. Score: 1
  
  In the end I add to use the following options and tell ffmpeg wich colorSpace i am using and how to decode it to display on screen.
  
  ```
  ffmpeg -f rawvideo -r 30 -pix_fmt rgba -s 1920x1017 -i - -threads 0 -y -c:v libopenh264 -pix_fmt yuv444p -b:v 8000K -vf vflip,scale=out_color_matrix=bt709 -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4
  
  ```
  
  
  ---
  
  