[FFmpeg-user] How do I encode in H264 Baseline but change the GOP?

Carl Partridge cpp at fatattitude.com
Fri May 27 17:02:26 CEST 2011

Hi everyone, I've just joined the mailing list, so thank you in advance for
having me.

I am trying to encode to H264/MP3, mux'd into Mpeg1-TS.  It's for HTTP Live
Streaming, but the decoder only supports baseline profile.

After some time spent looking at the options, I realised that I could just

     ffmpeg -profile baseline -i input.avi -y -async 1 -f mpegts -vcodec
libx264 -b 1200k -bt 100k -r 25 -acodec libmp3lame -ab 64k -ar 48000 -ac 2

....to generate my stream.  (then segment with an appropriate app)

Unfortunately, this is no good for segmenting, since I have no control over
the GOP length.  Ideally I would like an IDR (index) frame at the beginning
of each 10-second segment.  I tried:

     -g 10     (before AND after the -profile parameter)

...unfortunately it seems to be ignored, presumably because the default
settings that "-profile baseline" applies wipe out everything else.

Is there any way to specify a GOP interval while forcing everything else to
constrained baseline, or will I have to manually specify all the various
X264 flags.  I tried doing this, but wasted hours, since I couldn't find out
the exact ones that corresponded to constrained baseline profile, and
something kept bumping the decoder.

Thanks in advance,


PS: This is all for 'SilverLive', an HTTP Live Streaming client I have
developed for MS Silverlight.

*Carl Partridge*
FatAttitude Ltd
www.fatattitude.com | follow on twitter <http://www.twitter.com/fatattitude>

More information about the ffmpeg-user mailing list