This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Linux
Hello,
I used the pipeline to capture a picture:
gst-launch-1.0 -e v4l2src device=/dev/video2 num-buffers=1 io-mode=4 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=10000 intra-interval=1 ! filesink location=./testjpegenc.jpeg
and the testjpegenc.jpeg was only 18.1Kb.
and I set the bitrate of the plugin ducatijpegenc 100000.And the picture was still 18.1Kb.
So what should I do to improve the quality of the picture.
Hello,
I recompile the plugin with this MACHINE=am57xx-evm bitbake gstreamer1.0-plugins-ducati --force -c compile.
And I did not find any .libs under tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-ducati/git-r2.24/git/src
Do you mean that I should put the lib*.lo to sd card?
Hello,
hsg said:Do you mean that I should put the lib*.lo to sd card?
No, no you need the .so file.
Please press <ctrl>+<h> and you will see .libs folder.
In this folder you could find libgstducati.so file.
BR
Margarita
Hello,
hsg said:params->rateControlParams.qpMaxI = 24;51
params->rateControlParams.qpMinI = 1;
params->rateControlParams.qpI = -1;//-1
But you link it.
Please also check chapter 11 of the guide:
"qpI – This parameter gives the initial QP for rate control module to start with. Range is -1 to 51
When qpI is set to -1, codec internally decides which QP to start with; Otherwise user given
QP is used. If qpI = 51, then highest compression can be seen i.e. low bitrate.
qpMaxI – Maximum QP value. Care should be taken to set this vaue > 24 when qpI = -1 as codec
chosen initial QP when qpI = -1 is 24. Range 0 to 51.
qpMinI – Minimum QP value. This value should be less than qpI and qpMaxI. Range 0 to 51."
I would recommend you go through the guide very careful.
BR
Margarita
BR
Margarita
Hello,
The binary of this demo is under /usr/bin.
You could build it by using this command:
MACHINE=am57xx-evm bitbake omapdrmtest
BR
Margarita
Hello,
But your command is wrong.
You must run this one for example:
videnc2test 1280 720 1000 jpeg.nv12 out.mjpeg 30 10000 jpeg null 0 OMAPDRM
where:
1280 720 is resolution;
1000 is frame to write;
jpeg.nv12 out.mjpeg input output file;
30 fps;
10000 bitrate;
jpeg is the codec;
null 0 OMAPDRM is baseline/high level buffertype.
The source code could be found here:
/tisdk/build/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/omapdrmtest/1.0.0-r22/git
videnc2test.c
You could try to increase the qualityFactor.
hsg said:Could u tried on your side?
Yes, meanwhile you could try to adjust the params also.
BR
Margarita
Hello,
I tried on my side here is the results:
1. Videnc2test:
videnc2test 1280 720 1000 jpeg.nv12 out.mjpeg 30 10000 jpeg null 0 OMAPDRM
videnc2test 1280 720 1000 jpeg.nv12 out1.mjpeg 30 1000 jpeg null 0 OMAPDRM
-rw-r--r-- 1 root root 41751179 Dec 23 13:47 out.mjpeg
-rw-r--r-- 1 root root 15819768 Dec 23 13:48 out1.mjpeg
In this case please comment this line:
// params->rateControlPreset = 4;
and rebuild the demo.
2 Gstreamer:
gst-launch-1.0 -e videotestsrc num-buffers=1000 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=10000 ! filesink location=testjpegenc.jpeg
gst-launch-1.0 -e videotestsrc num-buffers=1000 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=1000 ! filesink location=testjpegenc1.jpeg
-rw-r--r-- 1 root root 41751179 Dec 23 13:48 testjpegenc.jpeg
-rw-r--r-- 1 root root 15819768 Dec 23 13:48 testjpegenc1.jpeg
In this case please comment:
//videnc->params->rateControlPreset = 4;
and change this:
{
return GST_DUCATIVIDENC_CLASS (parent_class)->allocate_params (videnc,
// sizeof (IVIDENC2_Params), sizeof (IVIDENC2_DynamicParams),
sizeof (IJPEGVENC_Params), sizeof (IVIDENC2_DynamicParams),
sizeof (IVIDENC2_Status), sizeof (IVIDENC2_InArgs),
sizeof (IVIDENC2_OutArgs));
}
Rebuild the ducati lib.
Hope this helps.
Please if this answer your question click on "This resolved my issue" button so the thread could be close.
If you have new questions/issues you could open new topics.
BR
Margarita
Hello,
Sorry I forgot to point you the files that you must change.
Case 1 : videnc2test.c
Case 2 : gstducatijpegenc.c
BR
Margarita
Hello,
hsg said:Could u tell me how to rebuild the Videnc2test demo.
The same way as you rebuilt it previous time when you changed the qp values.
MACHINE=am57xx-evm bitbake omapdrmtest --force -c compile
hsg said:After that I used the same pipeline,the encode file was still around 20k even if I changed the bitrate.
Try when the num-buffers=1000 for example and make sure that the changes are applied.
BR
Margarita
Hello,
I followed your instructions but the encode picture was still around 20KB
Did u succeed on your side in this way?
I mean that you can improve the quality of the picture in this way.
Best regards!
hsg
Hello,
This is the result on my side:
"1. Videnc2test:
videnc2test 1280 720 1000 jpeg.nv12 out.mjpeg 30 10000 jpeg null 0 OMAPDRM
videnc2test 1280 720 1000 jpeg.nv12 out1.mjpeg 30 1000 jpeg null 0 OMAPDRM
-rw-r--r-- 1 root root 41751179 Dec 23 13:47 out.mjpeg
-rw-r--r-- 1 root root 15819768 Dec 23 13:48 out1.mjpeg
In this case please comment this line:
// params->rateControlPreset = 4;
and rebuild the demo.
2 Gstreamer:
gst-launch-1.0 -e videotestsrc num-buffers=1000 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=10000 ! filesink location=testjpegenc.jpeg
gst-launch-1.0 -e videotestsrc num-buffers=1000 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=1000 ! filesink location=testjpegenc1.jpeg
-rw-r--r-- 1 root root 41751179 Dec 23 13:48 testjpegenc.jpeg
-rw-r--r-- 1 root root 15819768 Dec 23 13:48 testjpegenc1.jpeg
In this case please comment:
//videnc->params->rateControlPreset = 4;
and change this:
{
return GST_DUCATIVIDENC_CLASS (parent_class)->allocate_params (videnc,
// sizeof (IVIDENC2_Params), sizeof (IVIDENC2_DynamicParams),
sizeof (IJPEGVENC_Params), sizeof (IVIDENC2_DynamicParams),
sizeof (IVIDENC2_Status), sizeof (IVIDENC2_InArgs),
sizeof (IVIDENC2_OutArgs));
}
Rebuild the ducati lib. "
Please try the same pipelines on your side and let me know do you observe the same. If not, probably you have not apply the changes or cp the new lib or else.
If you are executing Videnc2test make sure that you execute the rebuilt demo not the default one.
As you could see the results of Videnc2test demo and gstreamer are the same.
First file is in case when bitrate is 10 000. Second one the bitrate is 1000.
BR
Margarita
Hello,
You used the pipeline:
gst-launch-1.0 -e videotestsrc num-buffers=1000 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=10000 ! filesink location=testjpegenc.jpeg
gst-launch-1.0 -e videotestsrc num-buffers=1000 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe ! ducatijpegenc bitrate=1000 ! filesink location=testjpegenc1.jpeg
-rw-r--r-- 1 root root 41751179 Dec 23 13:48 testjpegenc.jpeg
-rw-r--r-- 1 root root 15819768 Dec 23 13:48 testjpegenc1.jpeg
However, I want to capture one frame.You captured 1000 buffers ,and its output was around 41MB.
So one frame was aroud 40kB. Its quality of the picture could not meet the needs.
Do u understand me?