Answers.Body: <p>Forget it. Posting this question made me pay more attention to the log: if anyone is interested the answer is that you have to specify the colour space - "-pix_fmt yuv420p" in my case. Sorry guys.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-12T16:41:24.440Z
Answers.Text: What's the default profile and colour space that's used if you don't specify either `-profile:v` or `-pix_fmt` ?
Answers.UserDisplayName: Dan W
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-23T13:16:04.367Z
Answers.LastActivityDate: 2016-12-23T13:16:04.367Z
Answers.UserDisplayName: Maldoror
Answers.Body: <p>In my case, i did this:</p>
  <pre><code>ffmpeg -loop 1 -i background.jpg -i input.mp3  -y -pix_fmt yuv420p -shortest -c:v libx264 -c:a aac -c:s mov_text -strict experimental -vprofile baseline -level 2  -threads 0 out4.mp4
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-21T04:50:27.123Z
Answers.LastActivityDate: 2022-03-21T21:36:50.523Z
Answers.LastEditDate: 2022-03-21T21:36:50.523Z
Answers.UserDisplayName: Mohammed Yasar Shaikh
Body: <p>Ok, I have a feeling this might be a silly question, but I can't see what I am doing wrong. This is my command:</p>
  
  <p>ffmpeg -i input.mov -c:v libx264 -profile:v baseline output.mp4</p>
  
  <p>and the error it returns is: "Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height"</p>
  
  <p>I tried specifying the audio codec and using the other profiles, all to no avail... But the command works if I drop the -profile</p>
  
  <p>Here is the log:</p>
  
  <pre><code>ffmpeg version N-78758-g5156578 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 5.3.0 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
    libavutil      55. 19.100 / 55. 19.100
    libavcodec     57. 27.100 / 57. 27.100
    libavformat    57. 26.100 / 57. 26.100
    libavdevice    57.  0.101 / 57.  0.101
    libavfilter     6. 37.100 /  6. 37.100
    libswscale      4.  0.100 /  4.  0.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
  Guessed Channel Layout for  Input Stream #0.0 : 7.1
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '16BL3.mov':
    Metadata:
      major_brand     : qt  
      minor_version   : 537199360
      compatible_brands: qt  
      creation_time   : 2016-12-16 09:39:01
      timecode        : 00:16:02;15
    Duration: 00:00:53.95, start: 0.557267, bitrate: 59879 kb/s
      Stream #0:0(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 8 channels, s32 (24 bit), 9216 kb/s (default)
      Metadata:
        creation_time   : 2016-12-16 09:39:01
        handler_name    : Apple Alias Data Handler
      Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
      Metadata:
        creation_time   : 2016-12-16 09:39:01
        handler_name    : Apple Alias Data Handler
        timecode        : 00:16:02;15
      Stream #0:2(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
      Metadata:
        creation_time   : 2016-12-16 10:23:54
        handler_name    : Apple Alias Data Handler
        timecode        : 00:16:02;15
  No pixel format specified, yuv422p for H.264 encoding chosen.
  Use -pix_fmt yuv420p for compatibility with outdated media players.
  x264 [error]: baseline profile doesn't support 4:2:2
  [libx264 @ 0371fa00] Error setting profile baseline.
  [libx264 @ 0371fa00] Possible profiles: baseline main high high10 high422 high444
  Output #0, mp4, to 'bloco3.mp4':
    Metadata:
      major_brand     : qt  
      minor_version   : 537199360
      compatible_brands: qt  
      timecode        : 00:16:02;15
      Stream #0:0(eng): Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 29.97 fps (default)
      Metadata:
        creation_time   : 2016-12-16 10:23:54
        handler_name    : Apple Alias Data Handler
        timecode        : 00:16:02;15
        encoder         : Lavc57.27.100 libx264
      Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)
      Metadata:
        creation_time   : 2016-12-16 09:39:01
        handler_name    : Apple Alias Data Handler
        encoder         : Lavc57.27.100 aac
  Stream mapping:
    Stream #0:2 -&gt; #0:0 (mpeg2video (native) -&gt; h264 (libx264))
    Stream #0:0 -&gt; #0:1 (pcm_s24le (native) -&gt; aac (native))
  Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
  </code></pre>
  
  <p>Any clue on what might be going on?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-13T10:05:29.123Z
Comments.Text: Great question and I'm surprised ffmpeg doesn't use a default pixel format for the baseline profile like it does with the high444 profile.
Comments.UserDisplayName: Dan W
Tags: <ffmpeg>
Title: Error while trying to set ffmpeg profile
UserDisplayName: Maldoror
ThreadText: # Error while trying to set ffmpeg profile
  
  (Asked by: username_0 on 2016-12-23)
  
  Ok, I have a feeling this might be a silly question, but I can't see what I am doing wrong. This is my command:
  
  ffmpeg -i input.mov -c:v libx264 -profile:v baseline output.mp4
  
  and the error it returns is: "Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit\_rate, rate, width or height"
  
  I tried specifying the audio codec and using the other profiles, all to no avail... But the command works if I drop the -profile
  
  Here is the log:
  
  ```
  ffmpeg version N-78758-g5156578 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 5.3.0 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
    libavutil      55. 19.100 / 55. 19.100
    libavcodec     57. 27.100 / 57. 27.100
    libavformat    57. 26.100 / 57. 26.100
    libavdevice    57.  0.101 / 57.  0.101
    libavfilter     6. 37.100 /  6. 37.100
    libswscale      4.  0.100 /  4.  0.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
  Guessed Channel Layout for  Input Stream #0.0 : 7.1
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '16BL3.mov':
    Metadata:
      major_brand     : qt  
      minor_version   : 537199360
      compatible_brands: qt  
      creation_time   : 2016-12-16 09:39:01
      timecode        : 00:16:02;15
    Duration: 00:00:53.95, start: 0.557267, bitrate: 59879 kb/s
      Stream #0:0(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 8 channels, s32 (24 bit), 9216 kb/s (default)
      Metadata:
        creation_time   : 2016-12-16 09:39:01
        handler_name    : Apple Alias Data Handler
      Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
      Metadata:
        creation_time   : 2016-12-16 09:39:01
        handler_name    : Apple Alias Data Handler
        timecode        : 00:16:02;15
      Stream #0:2(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
      Metadata:
        creation_time   : 2016-12-16 10:23:54
        handler_name    : Apple Alias Data Handler
        timecode        : 00:16:02;15
  No pixel format specified, yuv422p for H.264 encoding chosen.
  Use -pix_fmt yuv420p for compatibility with outdated media players.
  x264 [error]: baseline profile doesn't support 4:2:2
  [libx264 @ 0371fa00] Error setting profile baseline.
  [libx264 @ 0371fa00] Possible profiles: baseline main high high10 high422 high444
  Output #0, mp4, to 'bloco3.mp4':
    Metadata:
      major_brand     : qt  
      minor_version   : 537199360
      compatible_brands: qt  
      timecode        : 00:16:02;15
      Stream #0:0(eng): Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 29.97 fps (default)
      Metadata:
        creation_time   : 2016-12-16 10:23:54
        handler_name    : Apple Alias Data Handler
        timecode        : 00:16:02;15
        encoder         : Lavc57.27.100 libx264
      Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)
      Metadata:
        creation_time   : 2016-12-16 09:39:01
        handler_name    : Apple Alias Data Handler
        encoder         : Lavc57.27.100 aac
  Stream mapping:
    Stream #0:2 -> #0:0 (mpeg2video (native) -> h264 (libx264))
    Stream #0:0 -> #0:1 (pcm_s24le (native) -> aac (native))
  Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
  
  ```
  
  Any clue on what might be going on?
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Great question and I'm surprised ffmpeg doesn't use a default pixel format for the baseline profile like it does with the high444 profile.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-12-23. Score: 6
  
  Forget it. Posting this question made me pay more attention to the log: if anyone is interested the answer is that you have to specify the colour space - "-pix\_fmt yuv420p" in my case. Sorry guys.
  
  > **Comments:**
  > **username_1**: What's the default profile and colour space that's used if you don't specify either `-profile:v` or `-pix_fmt` ?  
  
  ---
  
  ### Answer by username_2 on 2022-03-21. Score: 0
  
  In my case, i did this:
  
  ```
  ffmpeg -loop 1 -i background.jpg -i input.mp3  -y -pix_fmt yuv420p -shortest -c:v libx264 -c:a aac -c:s mov_text -strict experimental -vprofile baseline -level 2  -threads 0 out4.mp4
  
  ```
  
  
  ---
  
  