Answers.Body: <p>@Gyan is correct. add
  -pix_fmt yuv420p</p>
  <p>I was in the exact situation @MatrixManAtYrService described and the video imported into Camtasia Studio correctly after converting with -pix_fmt yuv420p</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-25T21:07:14.040Z
Answers.LastActivityDate: 2021-04-25T21:07:14.040Z
Answers.UserDisplayName: CBTTJM
Body: <p>I'm using ffmpeg to create screencasts.  The command looks like this:</p>
  <pre><code>ffmpeg -f x11grab -framerate 30 \
      $(xwininfo | gawk 'match($0, /-geometry ([0-9]+x[0-9]+).([0-9]+).([0-9]+)/, a)\
        { print &quot;-video_size &quot; a[1] &quot; -i +&quot; a[2] &quot;,&quot; a[3] }') \
      screencast$(date +%H%M%S).mp4
  </code></pre>
  <p>When I import those into Camtasia for editing, I get a video of the correct dimensions, but it shows only blackness.  I've found that I can make the import work if I re-encode the screencasts with handbrake.</p>
  <pre><code>HandBrakeCLI -i screencast101253.mp4 -o screencast101253.m4v
  </code></pre>
  <p>This is what <code>ffprobe</code> says this about the videos that handbrake creates:</p>
  <pre><code>Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'screencast101253.m4v':
    Metadata:
      major_brand     : mp42
      minor_version   : 512
      compatible_brands: isomiso2avc1mp41
      creation_time   : 2020-12-04T17:54:49.000000Z
      title           : screencast102753
      encoder         : HandBrake 1.2.2 2019022400
    Duration: 00:01:43.93, start: 0.000000, bitrate: 81 kb/s
      Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1256x1080 [SAR 270:347 DAR 314:347], 77 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
      Metadata:
        creation_time   : 2020-12-04T17:54:49.000000Z
        handler_name    : VideoHandler
  </code></pre>
  <p>My question is: how can I change the ffmpeg command so that it produces a Camtasia-compatible video in the first place--so that I don't have to wait on handbrake?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-05T04:59:59.213Z
Comments.Text: Need to see ffprobe for the ffmpeg created file, but probably as simple as adding `-pix_fmt yuv420p`
Comments.UserDisplayName: Gyan
Tags: <ffmpeg><codec><conversion>
Title: Can I use ffmpeg to encode a video for Camtasia import?
UserDisplayName: MatrixManAtYrService
ThreadText: # Can I use ffmpeg to encode a video for Camtasia import?
  
  (Asked by: username_0 on 2020-12-04)
  
  I'm using ffmpeg to create screencasts. The command looks like this:
  
  ```
  ffmpeg -f x11grab -framerate 30 \
      $(xwininfo | gawk 'match($0, /-geometry ([0-9]+x[0-9]+).([0-9]+).([0-9]+)/, a)\
        { print "-video_size " a[1] " -i +" a[2] "," a[3] }') \
      screencast$(date +%H%M%S).mp4
  
  ```
  
  When I import those into Camtasia for editing, I get a video of the correct dimensions, but it shows only blackness. I've found that I can make the import work if I re-encode the screencasts with handbrake.
  
  ```
  HandBrakeCLI -i screencast101253.mp4 -o screencast101253.m4v
  
  ```
  
  This is what `ffprobe` says this about the videos that handbrake creates:
  
  ```
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'screencast101253.m4v':
    Metadata:
      major_brand     : mp42
      minor_version   : 512
      compatible_brands: isomiso2avc1mp41
      creation_time   : 2020-12-04T17:54:49.000000Z
      title           : screencast102753
      encoder         : HandBrake 1.2.2 2019022400
    Duration: 00:01:43.93, start: 0.000000, bitrate: 81 kb/s
      Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1256x1080 [SAR 270:347 DAR 314:347], 77 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
      Metadata:
        creation_time   : 2020-12-04T17:54:49.000000Z
        handler_name    : VideoHandler
  
  ```
  
  My question is: how can I change the ffmpeg command so that it produces a Camtasia-compatible video in the first place--so that I don't have to wait on handbrake?
  
  **Tags:** ffmpeg, codec, conversion
  
  > **Comments:**
  > **username_1**: Need to see ffprobe for the ffmpeg created file, but probably as simple as adding `-pix_fmt yuv420p`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-04-25. Score: 1 | Accepted answer
  
  @username_1 is correct. add
  -pix\_fmt yuv420p
  
  I was in the exact situation @username_0 described and the video imported into Camtasia Studio correctly after converting with -pix\_fmt yuv420p
  
  
  ---
  
  