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?

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.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.