Answers.Body: <p>Almost certainly due to the bit depth of 10 bpc: <code>yuv420p10le</code>.</p>
  <p>Encode to a standard pixel format of 8 bpc.</p>
  <pre><code>ffmpeg -i input -pix_fmt yuv420p -c:v libx264 -crf 18 -c:a copy output.mkv
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-13T00:48:55.837Z
Answers.Text: That did the trick! Thank you so much
Answers.UserDisplayName: Delhirio
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-11T04:27:46.387Z
Answers.LastActivityDate: 2021-01-11T04:27:46.387Z
Answers.UserDisplayName: Gyan
Body: <p>I'm having a lot of trouble casting a specific file on my Chromecast. At first it was because it was encoded with H265, which is not supported by my Chromecast device (2nd gen).</p>
  <p>I tried changing its encoding from H265 to H264 and it works great when I play it with VLC directly on my computer, but as soon as I cast it on my TV, there are visual patches of color appearing constantly. The sound is fine.</p>
  <p>I am able to cast youtube or my chromium screen with no such problem.</p>
  <p>I used the following command to convert it from h265 to h264, as found [here]:</p>
  <pre><code>ffmpeg -i input -c:v libx264 -crf 18 -c:a copy output.mkv
  </code></pre>
  <p>Here is the ffprobe from the original video:</p>
  <pre><code>Input #0, matroska,webm, from 'original.mkv':
  Metadata:
      encoder         : libebml v1.3.4 + libmatroska v1.4.5
      creation_time   : 2017-04-26T08:17:18.000000Z
    Duration: 00:11:24.65, start: 0.000000, bitrate: 1152 kb/s
      Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
      Metadata:
        title           : Encoded by: ImEverlasting
        BPS             : 997219
        BPS-eng         : 997219
        DURATION        : 00:11:24.601000000
        DURATION-eng    : 00:11:24.601000000
        NUMBER_OF_FRAMES: 16414
        NUMBER_OF_FRAMES-eng: 16414
        NUMBER_OF_BYTES : 85337214
        NUMBER_OF_BYTES-eng: 85337214
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp
      Metadata:
        BPS             : 151912
        BPS-eng         : 151912
        DURATION        : 00:11:24.650000000
        DURATION-eng    : 00:11:24.650000000
        NUMBER_OF_FRAMES: 32093
        NUMBER_OF_FRAMES-eng: 32093
        NUMBER_OF_BYTES : 13000851
        NUMBER_OF_BYTES-eng: 13000851
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:2(eng): Subtitle: subrip
      Metadata:
        BPS             : 101
        BPS-eng         : 101
        DURATION        : 00:11:14.239000000
        DURATION-eng    : 00:11:14.239000000
        NUMBER_OF_FRAMES: 243
        NUMBER_OF_FRAMES-eng: 243
        NUMBER_OF_BYTES : 8531
        NUMBER_OF_BYTES-eng: 8531
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:3: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x882, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : cover.jpg
        mimetype        : image/jpeg
      Stream #0:4: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1067x600, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : cover_land.jpg
        mimetype        : image/jpeg
      Stream #0:5: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 120x176, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : small_cover.jpg
        mimetype        : image/jpeg
      Stream #0:6: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 213x120, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : small_cover_land.jpg
        mimetype        : image/jpeg
  </code></pre>
  <p>And the ffprobe of the converted file:</p>
  <pre><code>Input #0, matroska,webm, from 'converted.mkv':
    Metadata:
      ENCODER         : Lavf58.45.100
    Duration: 00:11:24.65, start: 0.000000, bitrate: 2499 kb/s
      Stream #0:0: Video: h264 (High 10), yuv420p10le(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
      Metadata:
        title           : Encoded by: ImEverlasting
        BPS             : 997219
        BPS-eng         : 997219
        DURATION-eng    : 00:11:24.601000000
        NUMBER_OF_FRAMES: 16414
        NUMBER_OF_FRAMES-eng: 16414
        NUMBER_OF_BYTES : 85337214
        NUMBER_OF_BYTES-eng: 85337214
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        ENCODER         : Lavc58.91.100 libx264
      Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
      Metadata:
        BPS             : 151912
        BPS-eng         : 151912
        DURATION-eng    : 00:11:24.650000000
        NUMBER_OF_FRAMES: 32093
        NUMBER_OF_FRAMES-eng: 32093
        NUMBER_OF_BYTES : 13000851
        NUMBER_OF_BYTES-eng: 13000851
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:2(eng): Subtitle: ass (default)
      Metadata:
        BPS             : 101
        BPS-eng         : 101
        DURATION-eng    : 00:11:14.239000000
        NUMBER_OF_FRAMES: 243
        NUMBER_OF_FRAMES-eng: 243
        NUMBER_OF_BYTES : 8531
        NUMBER_OF_BYTES-eng: 8531
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        ENCODER         : Lavc58.91.100 ssa
  </code></pre>
  <p>Any idea as to what the problem could be?</p>
  
Tags: <ffmpeg><screen-casting>
Title: Converting h265 video to h264 with ffmpeg results in glitchy visuals with Chromecast
UserDisplayName: Delhirio
ThreadText: # Converting h265 video to h264 with ffmpeg results in glitchy visuals with Chromecast
  
  (Asked by: username_0 on 2021-01-10)
  
  I'm having a lot of trouble casting a specific file on my Chromecast. At first it was because it was encoded with H265, which is not supported by my Chromecast device (2nd gen).
  
  I tried changing its encoding from H265 to H264 and it works great when I play it with VLC directly on my computer, but as soon as I cast it on my TV, there are visual patches of color appearing constantly. The sound is fine.
  
  I am able to cast youtube or my chromium screen with no such problem.
  
  I used the following command to convert it from h265 to h264, as found [here]:
  
  ```
  ffmpeg -i input -c:v libx264 -crf 18 -c:a copy output.mkv
  
  ```
  
  Here is the ffprobe from the original video:
  
  ```
  Input #0, matroska,webm, from 'original.mkv':
  Metadata:
      encoder         : libebml v1.3.4 + libmatroska v1.4.5
      creation_time   : 2017-04-26T08:17:18.000000Z
    Duration: 00:11:24.65, start: 0.000000, bitrate: 1152 kb/s
      Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
      Metadata:
        title           : Encoded by: ImEverlasting
        BPS             : 997219
        BPS-eng         : 997219
        DURATION        : 00:11:24.601000000
        DURATION-eng    : 00:11:24.601000000
        NUMBER_OF_FRAMES: 16414
        NUMBER_OF_FRAMES-eng: 16414
        NUMBER_OF_BYTES : 85337214
        NUMBER_OF_BYTES-eng: 85337214
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp
      Metadata:
        BPS             : 151912
        BPS-eng         : 151912
        DURATION        : 00:11:24.650000000
        DURATION-eng    : 00:11:24.650000000
        NUMBER_OF_FRAMES: 32093
        NUMBER_OF_FRAMES-eng: 32093
        NUMBER_OF_BYTES : 13000851
        NUMBER_OF_BYTES-eng: 13000851
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:2(eng): Subtitle: subrip
      Metadata:
        BPS             : 101
        BPS-eng         : 101
        DURATION        : 00:11:14.239000000
        DURATION-eng    : 00:11:14.239000000
        NUMBER_OF_FRAMES: 243
        NUMBER_OF_FRAMES-eng: 243
        NUMBER_OF_BYTES : 8531
        NUMBER_OF_BYTES-eng: 8531
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:3: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x882, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : cover.jpg
        mimetype        : image/jpeg
      Stream #0:4: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1067x600, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : cover_land.jpg
        mimetype        : image/jpeg
      Stream #0:5: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 120x176, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : small_cover.jpg
        mimetype        : image/jpeg
      Stream #0:6: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 213x120, 90k tbr, 90k tbn, 90k tbc (attached pic)
      Metadata:
        filename        : small_cover_land.jpg
        mimetype        : image/jpeg
  
  ```
  
  And the ffprobe of the converted file:
  
  ```
  Input #0, matroska,webm, from 'converted.mkv':
    Metadata:
      ENCODER         : Lavf58.45.100
    Duration: 00:11:24.65, start: 0.000000, bitrate: 2499 kb/s
      Stream #0:0: Video: h264 (High 10), yuv420p10le(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
      Metadata:
        title           : Encoded by: ImEverlasting
        BPS             : 997219
        BPS-eng         : 997219
        DURATION-eng    : 00:11:24.601000000
        NUMBER_OF_FRAMES: 16414
        NUMBER_OF_FRAMES-eng: 16414
        NUMBER_OF_BYTES : 85337214
        NUMBER_OF_BYTES-eng: 85337214
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        ENCODER         : Lavc58.91.100 libx264
      Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
      Metadata:
        BPS             : 151912
        BPS-eng         : 151912
        DURATION-eng    : 00:11:24.650000000
        NUMBER_OF_FRAMES: 32093
        NUMBER_OF_FRAMES-eng: 32093
        NUMBER_OF_BYTES : 13000851
        NUMBER_OF_BYTES-eng: 13000851
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:2(eng): Subtitle: ass (default)
      Metadata:
        BPS             : 101
        BPS-eng         : 101
        DURATION-eng    : 00:11:14.239000000
        NUMBER_OF_FRAMES: 243
        NUMBER_OF_FRAMES-eng: 243
        NUMBER_OF_BYTES : 8531
        NUMBER_OF_BYTES-eng: 8531
        _STATISTICS_WRITING_APP: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v9.6.0 ('Slave To Your Mind') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-04-26 08:17:18
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-26 08:17:18
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        ENCODER         : Lavc58.91.100 ssa
  
  ```
  
  Any idea as to what the problem could be?
  
  **Tags:** ffmpeg, screen-casting
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-11. Score: 0 | Accepted answer
  
  Almost certainly due to the bit depth of 10 bpc: `yuv420p10le`.
  
  Encode to a standard pixel format of 8 bpc.
  
  ```
  ffmpeg -i input -pix_fmt yuv420p -c:v libx264 -crf 18 -c:a copy output.mkv
  
  ```
  
  > **Comments:**
  > **username_0**: That did the trick! Thank you so much  
  
  ---
  
  