All of lore.kernel.org
 help / color / mirror / Atom feed
* Coda : QP rate control encoding
@ 2015-05-07 13:53 Jean-Michel Hautbois
  2015-05-12 16:38 ` Jean-Michel Hautbois
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Michel Hautbois @ 2015-05-07 13:53 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Philipp Zabel, Fabio Estevam, Steve Longerbeam, Robert Schwebel

Hi,

I am playing a bit with the coda encoder on i.MX6 and try to get the
most quality out of it. So, I am trying to use the controls of the
driver, in particular h264_i_frame_qp_value and h264_p_frame_qp_value.

I can get something with the following pipeline :
gst-launch-1.0 -evvv v4l2src num-buffers=2000
device=/dev/v4l/by-path/ipu1-capture io-mode=dmabuf !
"video/x-raw,width=1280,height=720,framerate=25/1,format=YUY2" !
v4l2convert device=/dev/v4l/by-path/ipu1-scaler capture-io-mode=dmabuf
output-io-mode=dmabuf-import !
'video/x-raw,width=640,height=360,format=NV12' ! v4l2video0h264enc
output-io-mode=dmabuf-import
extra-controls="controls,h264_i_frame_qp_value=24,h264_p_frame_qp_value=30,video_gop_size=32"
! queue ! progressreport name=p2 ! h264parse ! matroskamux ! filesink
location=/data/test_encode_360p.mkv

With those values, I get ~800kbps for a 360p converted frame. This is nice :).
The same video as an input with only the "bitrate" parameter set is
not visually similar.

But, when trying to encode a 720p video with the same QP parameters,
it is not working (the first keyframe is not ok, seems to be a P frame
instead of I, as it is 2000 bits and should be ~40000). I am keeping
the videoscaler in this second case, as it should be used as a color
converter.

Philipp, did you do some tests like this one ? Did you observe that
the encoder can maybe be too long to get a frame encoded when desired
quality is "high" ?
Maybe do you have some ideas about this ?

Thanks,
JM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Coda : QP rate control encoding
  2015-05-07 13:53 Coda : QP rate control encoding Jean-Michel Hautbois
@ 2015-05-12 16:38 ` Jean-Michel Hautbois
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Michel Hautbois @ 2015-05-12 16:38 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Philipp Zabel, Fabio Estevam, Steve Longerbeam, Robert Schwebel,
	Nicolas Dufresne

Hi !

2015-05-07 15:53 GMT+02:00 Jean-Michel Hautbois
<jean-michel.hautbois@veo-labs.com>:
>
> Hi,
>
> I am playing a bit with the coda encoder on i.MX6 and try to get the
> most quality out of it. So, I am trying to use the controls of the
> driver, in particular h264_i_frame_qp_value and h264_p_frame_qp_value.
>
> I can get something with the following pipeline :
> gst-launch-1.0 -evvv v4l2src num-buffers=2000
> device=/dev/v4l/by-path/ipu1-capture io-mode=dmabuf !
> "video/x-raw,width=1280,height=720,framerate=25/1,format=YUY2" !
> v4l2convert device=/dev/v4l/by-path/ipu1-scaler capture-io-mode=dmabuf
> output-io-mode=dmabuf-import !
> 'video/x-raw,width=640,height=360,format=NV12' ! v4l2video0h264enc
> output-io-mode=dmabuf-import
> extra-controls="controls,h264_i_frame_qp_value=24,h264_p_frame_qp_value=30,video_gop_size=32"
> ! queue ! progressreport name=p2 ! h264parse ! matroskamux ! filesink
> location=/data/test_encode_360p.mkv
>
> With those values, I get ~800kbps for a 360p converted frame. This is nice :).
> The same video as an input with only the "bitrate" parameter set is
> not visually similar.
>
> But, when trying to encode a 720p video with the same QP parameters,
> it is not working (the first keyframe is not ok, seems to be a P frame
> instead of I, as it is 2000 bits and should be ~40000). I am keeping
> the videoscaler in this second case, as it should be used as a color
> converter.
>
> Philipp, did you do some tests like this one ? Did you observe that
> the encoder can maybe be too long to get a frame encoded when desired
> quality is "high" ?

I have done more tests, and it seems to be related to the bitrate we
asked, and the input resolution...
Right now, I have a 360p@5Mbps, which works perfectly, and the same
source, in 720p with a bitrate up to 3Mbps is ok. But when I go
higher, I miss the I frames on some GOPs (very frequently the second
one).

I don't know if there is some limitations to what the CODA can do, but
1080p30 seems impossible @4Mbps at least... ?

Thanks for your advices !
JM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-12 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 13:53 Coda : QP rate control encoding Jean-Michel Hautbois
2015-05-12 16:38 ` Jean-Michel Hautbois

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.