View Full Version : Fixed length GOP using x264?
zambelli
22nd August 2008, 23:58
Is there a way to produce GOPs of fixed length using x264? I am assuming that setting --keyint to the same number as --min-keyint should have that effect, but I have no way of verifying if that's true or not.
Also, is there a way to disable I-frame insertion on scene changes? Would setting --scenecut 0 accomplish that?
Dark Shikari
23rd August 2008, 00:03
--scenecut -1 disables scenecut (which of course results in a static gop).
zambelli
23rd August 2008, 00:24
--scenecut -1 disables scenecut (which of course results in a static gop).
Ah, excellent. So if I did this:
--keyint 60 --min-keyint 60 --scenecut -1
Would that create a static 60-frame long GOP, with I-frames only inserted periodically every 60 frames?
CruNcher
23rd August 2008, 00:27
yep ready for Broadcast ;)
Dark Shikari
23rd August 2008, 01:06
Ah, excellent. So if I did this:
--keyint 60 --min-keyint 60 --scenecut -1
Would that create a static 60-frame long GOP, with I-frames only inserted periodically every 60 frames?Technically you don't even have to do --min-keyint.
Gabriel_Bouvigne
25th August 2008, 08:42
Ah, excellent. So if I did this:
--keyint 60 --min-keyint 60 --scenecut -1
Would that create a static 60-frame long GOP, with I-frames only inserted periodically every 60 frames?
I think that this creates 60-frames GOPs, with IDR only at gop boundaries, but does not prevent the use of non IDR I frames within gops. (I might be wrong, I have not checked it)
Sagittaire
25th August 2008, 14:16
I think that this creates 60-frames GOPs, with IDR only at gop boundaries, but does not prevent the use of non IDR I frames within gops. (I might be wrong, I have not checked it)
I don' think if you desactive scenecut ...
kemuri-_9
25th August 2008, 15:28
from my understanding now,
x264 only naturally produces i frames when scenecut triggers and it hasn't yet reached the min-keyint value since the last IDR frame.
so if you disable scenecut, this triggering will not happen and will in turn generate a static GOP of the max-keyint value.
DS has already mentioned this several posts ago....
Sagekilla
25th August 2008, 15:37
Forgive me if this is a bit OT, but how fast is scene cut detection anyway? From what I understand there's very little speed (but there is an increase) to be gained from turning it off, or am I wrong on this?
Ranguvar
25th August 2008, 16:23
Correct, IIRC. But you get a lot of advantages by keeping it on, and get very little speed with it off.
Shinigami-Sama
25th August 2008, 22:45
Forgive me if this is a bit OT, but how fast is scene cut detection anyway? From what I understand there's very little speed (but there is an increase) to be gained from turning it off, or am I wrong on this?
theres other reasons to turn it off though
like offline editing
rebkell
25th August 2008, 23:08
theres other reasons to turn it off though
like offline editing
From my tinkering with trying to cut commercials, you definitely want scenecut enabled, I usually run min-keyint=1 and keyint=120(approx 5 seconds on 24/1001 or 4 seconds on 30FPS). I mainly don't want to limit when IDR can happen, if there are three in a row, so be it, I want all the cutting entry points I can get. I'm hitting about 90%+ on smooth transitions with this method using h264ts_cutter.
Sagekilla
26th August 2008, 02:27
Offline editing I would simply use a lossless codec like Lagarith though. Rebkell has a very good point though -- If the scenecut works well and it cuts on a commercial, that'd be great.
zambelli
30th August 2008, 02:46
So are I-frames that get inserted by scenecut considered IDR frames or not? In other words, do they reset the GOP length count?
rebkell
30th August 2008, 03:00
So are I-frames that get inserted by scenecut considered IDR frames or not? In other words, do they reset the GOP length count?
My guess(and it's definitely a guess) is that it would depend on whether you had reached the min-keyint number of frames since the last IDR, if you had I would expect it to generate an IDR, otherwise I would expect just an I frame w/no IDR.
kemuri-_9
30th August 2008, 04:31
So are I-frames that get inserted by scenecut considered IDR frames or not? In other words, do they reset the GOP length count?
ok, let's go over an example, since the point isn't making it across still....
say min-keyint is 50, (max-)keyint is 500 + some scenecut:
chugging along on some video, the last IDR frame was at 300.
scenecut triggers for keyframe at 330.
because 330-300 < 50, it'll be an I-frame instead of an IDR frame.
continuing along, scenecut triggers again at 400.
400-330 >= 50, so it'll be an IDR frame.
if you disabled scenecut, none of this would happen.
akupenguin
30th August 2008, 04:54
400-330 >= 50, so it'll be an idr frame.
400-300
kemuri-_9
30th August 2008, 04:58
400-300
ah yes, sorry.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.