Body: <p>how do I upscale a video to 4k or 2k with ffmpeg? youtube encodes the videos which results in some quality loss of the video. So to make youtube use VP09 encoder on my videos, I have to export the video in 2k or 4k</p>
  <p>I record videos at 1080P this way :</p>
  <pre><code>ffmpeg \
  -f x11grab \
  -framerate 60 \
  -video_size &quot;1920x1080&quot; \
  -i :1 \
  -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 \
  -vf setpts=N/FR/TB \
  -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 \
  output.mp4 \
  </code></pre>
  <p>My upscale ffmpeg command ( produces laggy videos )</p>
  <pre><code>ffmpeg -i output.mp4 -vf scale=-1:2160:flags=lanczos -c:v libx264 -crf 21 -framerate 60 out.mp4
  </code></pre>
  <p>How do I export the video in 2k or 4k without the lag?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T07:43:50.690Z
Comments.Text: I'm not sure why people go to all this trouble to avoid AVC/H264. If you get that right in the first place it looks absolutely fine. I don't see the benefit of artificially upscaling to try get VP09, the 1080 will still be h264.
Comments.UserDisplayName: Tetsujin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-29T11:31:46.233Z
Comments.Text: when youtube uses AVC then my video's color quality gets reduced :/
Comments.UserDisplayName: siduck
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-29T11:37:04.457Z
Comments.Text: That's likely more to do with your profiling than YouTube itself. See my comment on your other question.
Comments.UserDisplayName: Tetsujin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-29T12:02:55.757Z
Comments.Text: no its not, my video looks fine locally ( accurate colors ) but when I upload it on youtube, youtube compresses it. youtube uses AVC for small channels and mine is a small channel so it used AVC which resulted in reduced quality colors
Comments.UserDisplayName: siduck
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-30T05:47:50.643Z
Comments.Text: 'Fine locally' is not an accurate methodology. Is your display calibrated? If so, what is it calibrated to, sRGB, Rec709…? If not, then you have no idea what you are uploading, only that it responds differently once it's on YouTube, which implies you are calibrated to [or approximated to] sRGB, as I said on the other thread. You *always* have to pre-empt Rec709 on sRGB, as the gamut is approximately the same, but the 'gamma' (transfer function/white point) is not.
Comments.UserDisplayName: Tetsujin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-30T05:47:55.533Z
Comments.Text: See https://www.richardlackey.com/choosing-video-color-space/ which doesn't actually cover what happens with YouTube specifically, though it does mention the lightening effect.
Comments.UserDisplayName: Tetsujin
Tags: <ffmpeg><video><encoding><video-quality><decoding>
Title: Export a video to 4k or 2k with FFMPEG and without lag (UPSCALE VIDEO)
UserDisplayName: siduck
ThreadText: # Export a video to 4k or 2k with FFMPEG and without lag (UPSCALE VIDEO)
  
  (Asked by: username_0 on 2022-07-27)
  
  how do I upscale a video to 4k or 2k with ffmpeg? youtube encodes the videos which results in some quality loss of the video. So to make youtube use VP09 encoder on my videos, I have to export the video in 2k or 4k
  
  I record videos at 1080P this way :
  
  ```
  ffmpeg \
  -f x11grab \
  -framerate 60 \
  -video_size "1920x1080" \
  -i :1 \
  -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 \
  -vf setpts=N/FR/TB \
  -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 \
  output.mp4 \
  
  ```
  
  My upscale ffmpeg command ( produces laggy videos )
  
  ```
  ffmpeg -i output.mp4 -vf scale=-1:2160:flags=lanczos -c:v libx264 -crf 21 -framerate 60 out.mp4
  
  ```
  
  How do I export the video in 2k or 4k without the lag?
  
  **Tags:** ffmpeg, video, encoding, video-quality, decoding
  
  > **Comments:**
  > **username_1**: I'm not sure why people go to all this trouble to avoid AVC/H264. If you get that right in the first place it looks absolutely fine. I don't see the benefit of artificially upscaling to try get VP09, the 1080 will still be h264.  
  > **username_0**: when youtube uses AVC then my video's color quality gets reduced :/  
  > **username_1**: That's likely more to do with your profiling than YouTube itself. See my comment on your other question.  
  > **username_0**: no its not, my video looks fine locally ( accurate colors ) but when I upload it on youtube, youtube compresses it. youtube uses AVC for small channels and mine is a small channel so it used AVC which resulted in reduced quality colors  
  > **username_1**: 'Fine locally' is not an accurate methodology. Is your display calibrated? If so, what is it calibrated to, sRGB, Rec709…? If not, then you have no idea what you are uploading, only that it responds differently once it's on YouTube, which implies you are calibrated to [or approximated to] sRGB, as I said on the other thread. You *always* have to pre-empt Rec709 on sRGB, as the gamut is approximately the same, but the 'gamma' (transfer function/white point) is not.  
  > **username_1**: See https://www.richardlackey.com/choosing-video-color-space/ which doesn't actually cover what happens with YouTube specifically, though it does mention the lightening effect.  
  
  ---
  
  ## 0 answers
  
  