[FFmpeg-user] how to include h264 support for ffserver (Unknown VideoCodec: h264)

Michael Ludwig milu71 at gmx.de
Thu Mar 21 11:23:56 CET 2013

Soho Soho123 schrieb am 21.03.2013 um 12:20 (+0800):

> >> I can see h264 has been include, but it still can not work.
> >
> > You cannot encode to H264 without libx264. I'm going to keep saying
> > variants of this throughout the email, you have been told it several
> > times, but it doesn't seem to sink in.

> > So your "h264" codec supports decoding of video, and can decode lossy
> > and lossless. It does not support encoding of video to H264. This is
> > because you have not built ffmpeg with libx264.
> My question is:
> even h264 has included , but when I set "VideoCodec h264" in
> ffserver.conf. ffserver says "Unknown VideoCodec: h264",
> Why?
> Do you have idea?

The error message might be more properly worded:
»No encoder found/present/registered for codec h264.«

I think you need to advance your understanding of »included«, probably
by understanding the difference between *codec* and *encoder*, or
*method* and *implementation*.

The flags you supplied to configure:

 --disable-encoders --enable-encoder=h264 …

Yes, you told it to enable h264 encoders, but then you didn't supply any
h264 encoder implementations. So … the configure flag you're missing:


The flag --enable-encoder=h264 does not seem to automatically pull
libx264 into the build. I think this is because there might be other
H.264 encoders on the build.

You went on to instruct the build as follows:

 --disable-decoders … --enable-decoder=h264 …

This will indeed enable the resulting binary to decode h264. No libx264
is needed for that. The relevant code is, I think, native to FFmpeg.
If you google »libx264« you'll see the first entry reads:

VideoLAN - x264, the best H.264/AVC encoder

Note it says »encoder«, not »decoder«. How to decode x264 is, I think,
laid out in the standard, while it is left unspecified how to go about
encoding video data into x264 (properly named H.264 / AVC / MPEG-4 AVC /
MPEG-4 part 10, as copied from the output of ffmpeg -codecs).

(Hope this is about accurate; not entirely sure.)
Michael Ludwig

More information about the ffmpeg-user mailing list