Fwd: Vaapih264enc and Intra/Key frame request

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Vaapih264enc and Intra/Key frame request

Matteo Valdina
Hi all,

I'm currently using vaapih264enc for a live streaming (RTP) project (1.8.3 for now). I need to generate intra-frame upon an external request (like packet loss indication).

For asking to the encoder to generate the intra-frame, I'm using this code:

GstEvent* event = gst_video_event_new_downstream_force_key_unit (GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, TRUE, 1);
gboolean res = gst_element_send_event(encoder_, event);


I tested and analyzed the output stream generated by x264enc and it works.

But when I use vaapih264enc. I see generate SPS, PPS, SEI and Non-IDR frames.

Does someone try a similar scenario and verify if intra frame is generated as expected?

I'm also surprised that there is no way to disable periodic key frame generation. Documentation states 0 for auto computation, accepted range 1 - 300. When I tried with 0 GLib assert that it is not a valid value.

Is it possible to disable this feature?

Best regards
Matteo Valdina
 
--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Vaapih264enc and Intra/Key frame request

Sreerenj Balachandran


On Wed, Aug 2, 2017 at 7:47 PM, Matteo Valdina <[hidden email]> wrote:
Hi all,

I'm currently using vaapih264enc for a live streaming (RTP) project (1.8.3 for now). I need to generate intra-frame upon an external request (like packet loss indication).

For asking to the encoder to generate the intra-frame, I'm using this code:

GstEvent* event = gst_video_event_new_downstream_force_key_unit (GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, TRUE, 1);
gboolean res = gst_element_send_event(encoder_, event);


I tested and analyzed the output stream generated by x264enc and it works.

But when I use vaapih264enc. I see generate SPS, PPS, SEI and Non-IDR frames.

Does someone try a similar scenario and verify if intra frame is generated as expected?

I'm also surprised that there is no way to disable periodic key frame generation. Documentation states 0 for auto computation, accepted range 1 - 300. When I tried with 0 GLib assert that it is not a valid value.

Is it possible to disable this feature?


Currently vaapiencoders do't have support for dynamic keyframe period setting.
Can you please file a bug against gstreamer-vaapi requesting this feature?

Auto-keyframe insertion is also not supported. Please file a separate bug for this.
This an advanced feature which is beyond the scope of current vaapih264encoder since it requires
scene change  detection. But we will implement this feature once there is Flexible Encoding Infrastructure in place: https://bugzilla.gnome.org/show_bug.cgi?id=784667
 

Best regards
Matteo Valdina
 
--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
Regards,

Sreerenj Balachandran
Intel Open Source Technology Center

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Vaapih264enc and Intra/Key frame request

Hyunjun Ko
In reply to this post by Matteo Valdina
Matteo Valdina wrote
Hi all,

I'm currently using vaapih264enc for a live streaming (RTP) project (1.8.3
for now). I need to generate intra-frame upon an external request (like
packet loss indication).

For asking to the encoder to generate the intra-frame, I'm using this code:

GstEvent* event = gst_video_event_new_downstream_force_key_unit
(GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, TRUE, 1);
gboolean res = gst_element_send_event(encoder_, event);


I tested and analyzed the output stream generated by x264enc and it works.

But when I use vaapih264enc. I see generate SPS, PPS, SEI and Non-IDR
frames.

Does someone try a similar scenario and verify if intra frame is generated
as expected?
This is implemented recently, which is doing that it produces IDR if FORCE_KEY_UNIT.

https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/commit/?id=465d5868d96ec7c839bfdb4a3e17f33a8bae1206

Use gstreamer-vaapi on the master.

Matteo Valdina wrote
I'm also surprised that there is no way to disable periodic key frame
generation. Documentation states 0 for auto computation, accepted range 1 -
300. When I tried with 0 GLib assert that it is not a valid value.

Is it possible to disable this feature?
Currently 0 is disabled but there is logic to calculate based on provided framerate.
We can enable it after verification (file up to bugzilla please)
But I guess you want to disable forever (and produce I-frame when you want), that's not supported for now. You can raise this up to bugzilla as Sree said.

Matteo Valdina wrote
Best regards
Matteo Valdina
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Vaapih264enc and Intra/Key frame request

Matteo Valdina-2
Thanks Hyunjun and Sree

I was confised because when I give a look to the encoder I found your patch and assume that was there for awhile.

I'll try version from master.

About the second question, yes I would like to disable periodic IDR or have higher range.
300 in my scenario (60 fps) is 5 seconds.

Best
Matteo Valdina


On Aug 3, 2017 01:38, "Hyunjun Ko" <[hidden email]> wrote:
Matteo Valdina wrote
> Hi all,
>
> I'm currently using vaapih264enc for a live streaming (RTP) project (1.8.3
> for now). I need to generate intra-frame upon an external request (like
> packet loss indication).
>
> For asking to the encoder to generate the intra-frame, I'm using this
> code:
>
> GstEvent* event = gst_video_event_new_downstream_force_key_unit
> (GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, TRUE, 1);
> gboolean res = gst_element_send_event(encoder_, event);
>
>
> I tested and analyzed the output stream generated by x264enc and it works.
>
> But when I use vaapih264enc. I see generate SPS, PPS, SEI and Non-IDR
> frames.
>
> Does someone try a similar scenario and verify if intra frame is generated
> as expected?

This is implemented recently, which is doing that it produces IDR if
FORCE_KEY_UNIT.

https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/commit/?id=465d5868d96ec7c839bfdb4a3e17f33a8bae1206

Use gstreamer-vaapi on the master.


Matteo Valdina wrote
> I'm also surprised that there is no way to disable periodic key frame
> generation. Documentation states 0 for auto computation, accepted range 1
> -
> 300. When I tried with 0 GLib assert that it is not a valid value.
>
> Is it possible to disable this feature?

Currently 0 is disabled but there is logic to calculate based on provided
framerate.
We can enable it after verification (file up to bugzilla please)
But I guess you want to disable forever (and produce I-frame when you want),
that's not supported for now. You can raise this up to bugzilla as Sree
said.


Matteo Valdina wrote
> Best regards
> Matteo Valdina





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Fwd-Vaapih264enc-and-Intra-Key-frame-request-tp4684076p4684080.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Vaapih264enc and Intra/Key frame request

Sreerenj Balachandran
In reply to this post by Hyunjun Ko


On Wed, Aug 2, 2017 at 11:37 PM, Hyunjun Ko <[hidden email]> wrote:
Matteo Valdina wrote
> Hi all,
>
> I'm currently using vaapih264enc for a live streaming (RTP) project (1.8.3
> for now). I need to generate intra-frame upon an external request (like
> packet loss indication).
>
> For asking to the encoder to generate the intra-frame, I'm using this
> code:
>
> GstEvent* event = gst_video_event_new_downstream_force_key_unit
> (GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE, TRUE, 1);
> gboolean res = gst_element_send_event(encoder_, event);
>
>
> I tested and analyzed the output stream generated by x264enc and it works.
>
> But when I use vaapih264enc. I see generate SPS, PPS, SEI and Non-IDR
> frames.
>
> Does someone try a similar scenario and verify if intra frame is generated
> as expected?

This is implemented recently, which is doing that it produces IDR if
FORCE_KEY_UNIT.


Okay, so this one is already landed in master, thanks Hyunjun :)

https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/commit/?id=465d5868d96ec7c839bfdb4a3e17f33a8bae1206

Use gstreamer-vaapi on the master.


Matteo Valdina wrote
> I'm also surprised that there is no way to disable periodic key frame
> generation. Documentation states 0 for auto computation, accepted range 1
> -
> 300. When I tried with 0 GLib assert that it is not a valid value.
>
> Is it possible to disable this feature?

Currently 0 is disabled but there is logic to calculate based on provided
framerate.
We can enable it after verification (file up to bugzilla please)
But I guess you want to disable forever (and produce I-frame when you want),
that's not supported for now. You can raise this up to bugzilla as Sree
said.


Matteo Valdina wrote
> Best regards
> Matteo Valdina





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Fwd-Vaapih264enc-and-Intra-Key-frame-request-tp4684076p4684080.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
Regards,

Sreerenj Balachandran
Intel Open Source Technology Center

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Loading...