Key frame help

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Key frame help

Steve R. Bennen



I need to encode videos with a very tight keyframe rate so
that fast-action sports can pause and seek forward/previous to those keyframes in an FLV Player.
 What parameter/s are used in FFmpeg for
key frame rate?  What other parameters might
be impacted?   Any solutions and or suggestions?

 

Thanks,

Steve


_________________________________________________________________
Be the filmmaker you always wanted to be—learn how to burn a DVD with Windows®.
http://clk.atdmt.com/MRT/go/108588797/direct/01/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Key frame help

Stefano Sabatini
On date Tuesday 2008-08-19 02:35:34 +0000, Steve R. Bennen encoded:
> I need to encode videos with a very tight keyframe rate so
> that fast-action sports can pause and seek forward/previous to those keyframes in an FLV Player.
>  What parameter/s are used in FFmpeg for
> key frame rate?

-g sets the *maximum* gop size.

> What other parameters might be impacted?  Any solutions and or
> suggestions?

-me_threshold sets a threshold for which an I-frame is forced even
when a certain deal of motion is detected (based on the motion
vectors).

-flags2 +sgop forces the gop to be of the size specified
with -g (not sure about that).

Regards.
--
ffmpeg-user random tip #8
Multimedia related stuff web site promo:
http://wiki.multimedia.cx/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Key frame help

Stefano Sabatini
On date Tuesday 2008-08-19 11:51:59 +0200, Stefano Sabatini encoded:

> On date Tuesday 2008-08-19 02:35:34 +0000, Steve R. Bennen encoded:
> > I need to encode videos with a very tight keyframe rate so
> > that fast-action sports can pause and seek forward/previous to those keyframes in an FLV Player.
> >  What parameter/s are used in FFmpeg for
> > key frame rate?
>
> -g sets the *maximum* gop size.
>
> > What other parameters might be impacted?  Any solutions and or
> > suggestions?
>
> -me_threshold sets a threshold for which an I-frame is forced even
> when a certain deal of motion is detected (based on the motion
> vectors).

I meant -sc_threshold (scene change threshold).
 
> -flags2 +sgop forces the gop to be of the size specified
> with -g (not sure about that).

[...]
--
ffmpeg-user random tip #18
Gmane ffmpeg-user archive:
http://dir.gmane.org/gmane.comp.video.ffmpeg.user
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Key frame help

Steve R. Bennen
In reply to this post by Stefano Sabatini

I can't find sc_threshold in the documentation.  Can you direct me to that parameter?  Also, how does flags2 +sgop work?  

Thanks,
Steve

> Date: Tue, 19 Aug 2008 11:51:59 +0200
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [FFmpeg-user] Key frame help
>
> On date Tuesday 2008-08-19 02:35:34 +0000, Steve R. Bennen encoded:
> > I need to encode videos with a very tight keyframe rate so
> > that fast-action sports can pause and seek forward/previous to those keyframes in an FLV Player.
> >  What parameter/s are used in FFmpeg for
> > key frame rate?
>
> -g sets the *maximum* gop size.
>
> > What other parameters might be impacted?  Any solutions and or
> > suggestions?
>
> -me_threshold sets a threshold for which an I-frame is forced even
> when a certain deal of motion is detected (based on the motion
> vectors).
>
> -flags2 +sgop forces the gop to be of the size specified
> with -g (not sure about that).
>
> Regards.
> --
> ffmpeg-user random tip #8
> Multimedia related stuff web site promo:
> http://wiki.multimedia.cx/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user

_________________________________________________________________
Talk to your Yahoo! Friends via Windows Live Messenger.  Find out how.
http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Key frame help

Stefano Sabatini
On date Friday 2008-08-22 19:54:06 +0000, Steve R. Bennen encoded:
> I can't find sc_threshold in the documentation.  Can you direct me to that parameter?

First of all don't top post.

As I wrote:
-sc_threshold: sets a threshold for which an I-frame is forced even
when a certain deal of motion is detected (based on the motion
vectors).

Default value: 0
Increase it to increase the activation level, decrease it to decrease
the activation level, e.g. use -inf to deactivate the feature.

Relevant code is in libavcodec/utils.c and libavcodec/ratecontrol.c if
C language does some sense to you.

And in my experience it doesn't always work, I wrote a file sometime
ago which I posted here where I delivered my experience with the black
art of the tweaking of the encoding parameters, check the archive.

> Also, how does flags2 +sgop work?  

I suppose you can simply use -flags2 +sgop, and it should force the
set gop size specified with -g.

And since I'm not sure about these parameters and I'm lazy and I don't
want to leave you without nothing to do, you should double check that
their use correspond to the description which I gave (I wrote a small
utility ffprobe that you can find on sourceforge which should help
testing such things).

> Thanks,

Regards.
--
ffmpeg-user random tip #16
Patches are welcome!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Key frame help

Steve R. Bennen



> Date: Sat, 23 Aug 2008 10:14:10 +0200
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [FFmpeg-user] Key frame help
>
> On date Friday 2008-08-22 19:54:06 +0000, Steve R. Bennen encoded:
> > I can't find sc_threshold in the documentation.  Can you direct me to that parameter?
>
> First of all don't top post.
>
> As I wrote:
> -sc_threshold: sets a threshold for which an I-frame is forced even
> when a certain deal of motion is detected (based on the motion
> vectors).
>
> Default value: 0
> Increase it to increase the activation level, decrease it to decrease
> the activation level, e.g. use -inf to deactivate the feature.

Ok, that makes sense, but what if -g is set to 1 or 2?  Forcing I-frames doesn't matter, correct?

> Relevant code is in libavcodec/utils.c and libavcodec/ratecontrol.c if
> C language does some sense to you.

No, C doesn't help, but...
 
> And in my experience it doesn't always work, I wrote a file sometime
> ago which I posted here where I delivered my experience with the black
> art of the tweaking of the encoding parameters, check the archive.

This would help.  I could study this (and other parameters), but I can't find the place in the archive. I've searched by author (your name) and can't find the reference.  Can you give me a specific  URL?

> > Also, how does flags2 +sgop work?  
>
> I suppose you can simply use -flags2 +sgop, and it should force the
> set gop size specified with -g.
>
> And since I'm not sure about these parameters and I'm lazy and I don't
> want to leave you without nothing to do, you should double check that
> their use correspond to the description which I gave (I wrote a small
> utility ffprobe that you can find on sourceforge which should help
> testing such things).
>
> > Thanks,
>
> Regards.

Thanks.

> ffmpeg-user random tip #16
> Patches are welcome!
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user

_________________________________________________________________
Talk to your Yahoo! Friends via Windows Live Messenger.  Find out how.
http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Key frame help

Stefano Sabatini
On date Saturday 2008-08-23 19:23:06 +0000, Steve R. Bennen encoded:

> > Date: Sat, 23 Aug 2008 10:14:10 +0200
> > From: [hidden email]
> > To: [hidden email]
> > Subject: Re: [FFmpeg-user] Key frame help
> >
> > On date Friday 2008-08-22 19:54:06 +0000, Steve R. Bennen encoded:
> > > I can't find sc_threshold in the documentation.  Can you direct me to that parameter?
> >
> > First of all don't top post.
> >
> > As I wrote:
> > -sc_threshold: sets a threshold for which an I-frame is forced even
> > when a certain deal of motion is detected (based on the motion
> > vectors).
> >
> > Default value: 0
> > Increase it to increase the activation level, decrease it to decrease
> > the activation level, e.g. use -inf to deactivate the feature.
>
> Ok, that makes sense, but what if -g is set to 1 or 2?  Forcing I-frames doesn't matter, correct?

Why not?

ffmpeg -i ~/test.flv -g 2 test-gop2.avi
ffprobe -show_frames test-gop2.avi 2>/dev/null | grep pict_type | head -n 20
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P
pict_type=I
pict_type=P

> > Relevant code is in libavcodec/utils.c and libavcodec/ratecontrol.c if
> > C language does some sense to you.
>
> No, C doesn't help, but...
>  
> > And in my experience it doesn't always work, I wrote a file sometime
> > ago which I posted here where I delivered my experience with the black
> > art of the tweaking of the encoding parameters, check the archive.
>
> This would help.  I could study this (and other parameters), but I
> can't find the place in the archive. I've searched by author (your
> name) and can't find the reference.  Can you give me a specific URL?

http://thread.gmane.org/gmane.comp.video.ffmpeg.user/16235/focus=16283

The big disclaimer about the potential inaccuracy of its content still
applies.

> > > Also, how does flags2 +sgop work?  
> >
> > I suppose you can simply use -flags2 +sgop, and it should force the
> > set gop size specified with -g.
> >
> > And since I'm not sure about these parameters and I'm lazy and I don't
> > want to leave you without nothing to do, you should double check that
> > their use correspond to the description which I gave (I wrote a small
> > utility ffprobe that you can find on sourceforge which should help
> > testing such things).
[...]
> Thanks.

Regards.
--
ffmpeg-user random tip #6
Please follow netiquette rules while posting to ffmpeg-user:
http://linux.sgms-centre.com/misc/netiquette.php
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user