How do I encode in H264 Baseline but change the GOP?
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 do: 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 output.ts ....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, Carl 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>
Apologies, I meant -g 250 in the middle of my question. On 27 May 2011 16:02, Carl Partridge <cpp@fatattitude.com> wrote:
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 do:
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 output.ts
....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,
Carl
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>
-- ________________________________ *Carl Partridge* FatAttitude Ltd www.fatattitude.com | follow on twitter <http://www.twitter.com/fatattitude>
On Fri, May 27, 2011 at 04:02:26PM +0100, Carl Partridge wrote:
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 do:
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 output.ts
....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,
Currently broken. You can use -x264opts for most options, for your option it's keyint=... With what you said, I think you also need -flags -cgop
Carl
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> _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
On 27 May 2011 16:21, Etienne Buira <etienne.buira.lists@free.fr> wrote:
With what you said, I think you also need -flags -cgop
Oops, I meant -flags +cgop
Thanks Etienne, if I specify "-flags +cgop" and "-x264opts keyint=100" will this override the baseline profile defaults enforced by "-profile baseline" ? Carl
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
-- ________________________________ *Carl Partridge* FatAttitude Ltd www.fatattitude.com | follow on twitter <http://www.twitter.com/fatattitude>
On Fri, May 27, 2011 at 10:04:07PM +0100, Carl Partridge wrote:
On 27 May 2011 16:21, Etienne Buira <etienne.buira.lists@free.fr> wrote:
With what you said, I think you also need -flags -cgop
Oops, I meant -flags +cgop
Thanks Etienne, if I specify "-flags +cgop" and "-x264opts keyint=100" will this override the baseline profile defaults enforced by "-profile baseline" ?
Yes, at least on a recent enough version to support -x264opts. You can check with the summary line x264 gives at the beginning of an encode. +cgop leads to open_gop=0, and keyint to keyint.
participants (2)
-
Carl Partridge -
Etienne Buira