Firefly Open Source Community

   Login   |   Register   |
New_Topic
12
New Topic

Using Gstreamer to decode 4K video to 1080p

66

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
66
Posted at 7/28/2017 20:45:31     
Hello,

I have tried both the Firefly Ubuntu image and also making my own following the guide at http://rockchip.wikidot.com/linux-user-guide , but I am not able to use vpudec in Gstreamer.
Doing ls /dev I can find vpu_service and rkvdec.
In the build script for rockchip-linux it also installs rockchip_mpp libraries(https://github.com/rockchip-linu ... er/mk-rootfs.sh#L69).
How can I enable the VPU to do the 4K decoding? And how can I enable 1080p h264 encoder?
Reply

Use props Report

8

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
8
Posted at 7/29/2017 00:27:30     
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?
Reply

Use props Report

66

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
66
Posted at 7/29/2017 19:18:42     
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.
Reply

Use props Report

66

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
66
Posted at 8/7/2017 18:21:30     
If I specify with --gst-plugin-path=/usr/local/lib/gstreamer-1.0/ I get the following message:

(gst-plugin-scanner:18102): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstrockchipmpp.so': /usr/local/lib/gstreamer-1.0/libgstrockchipmpp.so: undefined symbol: gst_pad_get_task_state

How can I fix this?
Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 8/14/2017 10:19:44     
How about use Firefly Ubuntu image ?
Reply

Use props Report

66

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
66
Posted at 8/14/2017 15:14:39     
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.
Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 8/15/2017 09:32:54     
Last edited by isle In 8/15/2017 09:43 Editor

Hi, if you want modify our firmware, do like this:
1 unpack the firmware : http://wiki.t-firefly.com/index. ... android_firmware/en
    then get the rootfs image.
2 mount and choot :
   
  1. mkdir temp
  2. sudo mount linuxroot.img temp
  3. sudo chroot temp
Copy the code

3 do what you want,
4 make your rootfs : http://wiki.t-firefly.com/index. ... /en#make_the_rootfs
Reply

Use props Report

66

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
66
Posted at 8/15/2017 16:28:17     
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.
Reply

Use props Report

66

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
66
Posted at 8/15/2017 20:31:13     
By the way, are you able to provide an Ubuntu image with working mppvideodec and mpph264enc in Gstreamer?
Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 8/17/2017 10:38:27     
arnstein Posted at 8/15/2017 16:28
Thank you,
this works, but it is not a satisfactory solution for me. I want to be able to automate ...

https://github.com/rockchip-linux/rk-rootfs-build
Reply

Use props Report

Return to List
12
You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list