[FFmpeg-user] Error with parameterization using h264 with profiles

S. John john at dimis.fim.uni-passau.de
Thu Dec 4 13:22:12 CET 2014


Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:

> Complete, uncut console output missing.
>
> Carl Eugen

I'm sorry, I thought I'd just post the IMO relevant part. But since I
messed up the mail format anyway, I'll give it a second try.

I'm struggling with a simple task. Converting an .avi containing a
single cvid video stream with rgb24 color model to an mp4 with h264
encoding.

For some reason, ffmpeg won't let me use any other h264 profile other
than high444 for the conversion. Example output:

####################
D:\Archiv\Mediafiles\Videos>ffmpeg -i input.avi -vcodec libx264 -vprofil
e main out.mp4
ffmpeg version N-58970-g7f39352 Copyright (c) 2000-2013 the FFmpeg devel
opers
   built on Dec 11 2013 13:33:27 with gcc 4.8.1 (GCC)
   configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/joh
n/Downloads/CrossCompile/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --
pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth --
enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --ena
ble-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --en
able-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --
enable-libopus --disable-w32threads --enable-frei0r --enable-filter=frei
0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --extra-cflags=
-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopencore-amrwb
  --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enab
le-libilbc --prefix=/home/john/Downloads/CrossCompile/sandbox/mingw-w64-
i686/i686-w64-mingw32 --enable-static --disable-shared --enable-libsoxr
--enable-fontconfig --enable-libass --enable-libutvideo --enable-libblur
ay --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC
  --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lst
dc++ --extra-libs=-lpng --enable-libvidstab --extra-cflags= --extra-cfla
gs= --enable-nonfree --enable-libfdk-aac --enable-libfaac --enable-runti
me-cpudetect
   libavutil      52. 58.100 / 52. 58.100
   libavcodec     55. 45.100 / 55. 45.100
   libavformat    55. 22.100 / 55. 22.100
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     3. 92.100 /  3. 92.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
Input #0, avi, from 'input.avi':
   Duration: 00:00:30.00, start: 0.000000, bitrate: 1864 kb/s
     Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 320x240, 15
tbr, 15 tbn, 15 tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
x264 [error]: main profile doesn't support 4:4:4
[libx264 @ 0033d500] Error setting profile main.
[libx264 @ 0033d500] Possible profiles: baseline main high high10 high42
2 high444
Output #0, mp4, to 'out.mp4':
     Stream #0:0: Video: h264, yuv444p, 320x240, q=-1--1, 90k tbn, 15 tbc

Stream mapping:
   Stream #0:0 -> #0:0 (cinepak -> libx264)
Error while opening encoder for output stream #0:0 - maybe incorrect par
ameters such as bit_rate, rate, width or height
####################


With every profile I use, the encoder seems to use yuv444p pixel format
(which is only allowed in high444). I can circumvent the problem by
manually specifying the correct pixel format:

ffmpeg -i input.avi -vcodec libx264 -vprofile main -pix_fmt yuv420p out.mp4

Is this an intended behavior? For what I read in the documentation, I
expected ffmpeg to automatically choose parameters in accordance to the
selected profile.
Or is the profile selection more like an assert, just telling me
whenever I'm not in accordance with the constraints of a selected profile?

Thank you for any information on this topic!
Stefan




More information about the ffmpeg-user mailing list