Hello,
I was able to use the hardware decoder and encoder through rockchip-gstreamer plugin. It adds mppvideodec decoder and mpph264enc encoder to gstreamer. Both the encoder and the decoder worked, but the encoded video had really bad quality. I searched in the gstreamer-rockchip sources and I managed to get the hardware encoder working in gstreamer with good video quality. The only way I was able to set video quality was by changing hardcoded values in gstreamer-rockchip source code and then recompiling the rockchip gsteamer plugin.
This way I can set the QP and control the video quality, but I cannot directly control the bitrate, because changing the bitrate in source code seems to have no effect. If low QP is set the encoded video has good quality, but the bit rate is really high. 1080p encoded video with similar quality as the original 1080p video has bitrate 28Mb/s compared to 4Mb/s original video.
In a nutshell, I am able to use the hardware encoder and decoder, but the encoded video bitrate is really high and I haven’t figured out yet how to fix this.
Does anyone know how to fix the problem with high bitrate?
I am able to compile the mpp and rkximage part of the rockchip-gstreamer plugin, however, after it is done I do not find mppvideodec and mpph264enc available in Gstreamer when doing gst-inspect.
It is important for me to be able to choose which software etc. to flash on the image. That’s why I choose to use the rockchip-linux rootfs script. Can you provide a similar script to generate your Firefly Ubuntu image? That way I can add the software and settings I need in my script.
Thank you,
this works, but it is not a satisfactory solution for me. I want to be able to automate building several images with different settings (for example different SSIDs on wifi). With this method I would have to do this for each image separately.
It took a while, but I managed to compile mpp & gstreamer-rockchip on a fresh version of gstreamer. The trick on ubuntu was to track down all of the dependencies for gstreamer1.0 and its plugins, install those separately, then do everything from git source. However, I’m completely new to gstreamer, which seems far more complex than ffmpeg. Does anyone know how to use streamer for say transcoding to h.264 from an mpeg-2 transport stream? I’d appreciate any pointers.
-Karl
I managed to construct a gst-launch-1.0 pipeline to test the mpph264enc plugin to gstreamer, but unfortunately hit a wall. Perhaps something is wrong in the kernel? Any suggestions?
xxxxxxxx@firefly:/mnt/dvr/tmp$ gst-launch-1.0 videotestsrc ! mpph264enc ! h264parse ! mp4mux ! filesink location=test.mp4 -e
Setting pipeline to PAUSED …
mpi: mpp version: 1a795b0 author: Herman Chen [mpp_dec]: Fix mpp_frame memory leak on reset
hal_h264e_api: vcodec type 00000000 can not find H.264 encoder device
mpp_hal: mpp_hal_init hal h264e_rkvenc init failed ret -1
mpp_hal: mpp_hal_init could not found coding type 7
mpp_enc: mpp_enc_init could not init hal
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: error found on mpp initialization
Pipeline is PREROLLING …
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913328
mpp: command 320005 param 0x7f9a4291d0 ret -3
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913264
mpp: command 320005 param 0x7f9a429210 ret -3
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913184
mpp: command 320005 param 0x7f9a429260 ret -3
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913344
mpp: command 320005 param 0x7f9a4291c0 ret -3
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913184
mpp: command 320005 param 0x7f9a429260 ret -3
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913408
mpp: command 320005 param 0x7f9a429180 ret -3
mpp: Assertion mEnc failed at control_enc:756
mpp_enc: mpp_enc_control found NULL input enc (nil) cmd 320005 param -1706913408
mpp: command 320005 param 0x7f9a429180 ret -3
Freeing pipeline …
hal_h264e_api: vcodec type 00000000 can not find H.264 encoder device
Are there any kernel requirements? This is what I’m running:
mitchekl@firefly:~$ cat /proc/version
Linux version 4.4.16 (firefly@tchip-server) (gcc version 4.9.x-google 20140827 (prerelease) (GCC) ) #20 SMP PREEMPT Sat Mar 18 15:19:16 CST 2017
Your article is simply remarkable, thank you for sharing! Strengthen your IT expertise with free 1Y0-204 online lab simulation. Good luck and best wishes!
This article is truly inspiring, and it has given me a new understanding of the related topic. It’s nearly time for my MCE-Dev-201 pdf files exam – wish me all the best!
The article provided me with so much to ponder. We offer you access to the rich content of CSPAI reliable study questions ppt for free, hoping it benefits you.