Open main menu

DAVE Developer's Wiki β

Changes

XUELK-AN-006: Video playing on i.MX6UL-based platforms

6,193 bytes added, 10:36, 30 December 2020
no edit summary
{{InfoBoxTop}}
{{AppliesToAXELULite}}
{{AppliesToAXEL ULite AN}}
{{AppliesToSBCLynx}}
{{AppliesTo SBC Lynx AN}}
{{InfoBoxBottom}}
{{WarningMessage|text=This application note was validated against specific versions of the kit only. It may not work with other versions. Supported versions are listed in the ''History'' section.}}
== History ==
{| class="wikitable" border="1"
!Version
!Xuelk version
!Date
!Notes
|-
|1.0.0
|1.1.3
|May 2017
|First release
|-
|}
 
==Introduction==
As known, i.MX6UL SoC is not designed to implement rich complex user interfaces (UI), even though it integrates an LCD controller. However, even simple UIs might require playing some sort of small, low-resolution videos.  This application note describes some tests that were performed on an AXELULite-based platform to evaluate the capabilities and the performances of the i.MXUL when it comes to playing such videos. The test bed was based on Debian Jessie distribution, as described [[XUELK-AN-002:_Running_Debian_distribution|here]]. ==gstreamer==Starting from original Debian root file system provided [https://mirror.dave.eu/lynx/debian/20170403/20170403-sbclynx-debian-8-usd.zip here], more packages need to be added for using the well known multimedia framework [https://gstreamer.freedesktop.org gstreamer] More info about gstreamer can be found [https://gstreamer.freedesktop.org here] and on Github [https://github.com/GStreamer gstreamer] server  We assume that network interface has been already configured as described on [[XUELK-AN-002:_Running_Debian_distribution|XUELK-AN-002: Running Debian distribution]]. ===Adding gstreamer packages=== It is possibile to install the complete '''gstreamer 1.0''' suite (easy way to have the richest rfs configuration for gstreamer usage) <pre class="board-terminal">root@arm:~# apt-get install gstreamer1.0Reading package lists... DoneBuilding dependency treeReading state information... Done...The following NEW packages will be installed:... gstreamer1.0-clutter gstreamer1.0-doc gstreamer1.0-fluendo-mp3 gstreamer1.0-gnonlin gstreamer1.0-gnonlin-dbg gstreamer1.0-gnonlin-doc gstreamer1.0-libav gstreamer1.0-libav-dbg gstreamer1.0-nice gstreamer1.0-packagekit gstreamer1.0-plugins-bad gstreamer1.0-plugins-bad-dbg gstreamer1.0-plugins-bad-doc gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-base-dbg gstreamer1.0-plugins-base-doc gstreamer1.0-plugins-good gstreamer1.0-plugins-good-dbg gstreamer1.0-plugins-good-doc gstreamer1.0-plugins-ugly gstreamer1.0-plugins-ugly-dbg gstreamer1.0-plugins-ugly-doc... usb-modeswitch usb-modeswitch-data usbmuxd va-driver-all x11-common x11-utils xkb-data0 upgraded, 517 newly installed, 0 to remove and 32 not upgraded.Need to get 252 MB of archives.After this operation, 713 MB of additional disk space will be used.Do you want to continue? [Y/n] Y</pre> as it's shown on installation log, apt-get asks for installing 713MB of additional packages. In case you are looking for a reduced space installation, you may need to select the minimum required packages for video decoding. Tipically, it is enough to install: <pre>gstreamer1.0-toolsgstreamer1.0-plugins-basegstreamer1.0-plugins-goodgstreamer1.0-plugins-badgstreamer1.0-plugins-uglygstreamer1.0-videosink</pre> but required packages are strictly related to the gstreamer pipeline invoked and what kind of video/audio stream want to be decoded. ===gstreamer pipeline=== The pipeline used is the easiest one for decoding a local file on rfs  gst-launch-1.0 -vvv playbin uri=file:///root/''<local_filename>'' video-sink=fbdevsink ==Test bed==* iMX6UL cpu has 3 scaling frequencies availables requested by cpu load<pre class="board-terminal">root@arm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorinteractiveroot@arm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 198000 396000 528000</pre>* iMX6UL cpu is running at 528MHz when decoding<pre class="board-terminal">root@arm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq528000</pre>* system DRAM is 256MB* lcd panel is 800x480 ==Results=====Use case #1: MPEG4 640x360@24fps===* file: BigBuckBunny_640x360.mp4* video: MPEG-4 video 4:2:0 @ 640x360 resolution* pipeline: <pre class="board-terminal">gst-launch-1.0 -vvv playbin uri=file:///root/video/BigBuckBunny_640x360.mp4 video-sink=fbdevsink</pre>* top process shows that cpu is running at 99% <pre class="board-terminal">top - 08:24:14 up 1:28, 2 users, load average: 0.19, 0.18, 0.38Tasks: 60 total, 1 running, 59 sleeping, 0 stopped, 0 zombie%Cpu(s): 98.4 us, 1.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 stKiB Mem: 247172 total, 244012 used, 3160 free, 30660 buffersKiB Swap: 0 total, 0 used, 0 free. 123020 cached Mem  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND11998 root 20 0 121480 18880 6180 S 99.4 7.6 0:09.77 gst-launch-1.011997 root 20 0 2980 1068 756 R 0.7 0.4 0:00.20 top 1 root 20 0 25840 2972 1880 S 0.0 1.2 0:14.17 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd...</pre> This is the reasonable ''maximum video resolution'' that can be fully decoded in software (this is due to iMX6UL absence of 3D hardware accelerator) ===Use case #2: MPEG4 320x180@24fps===This use case is similar to the previous one, but the same video file has been scaled to 1/4 the original dimension (0.5 horizontal and 0.5 vertical) * file: BigBuckBunny_320x180.mp4* video: MPEG-4 video 4:2:0 @ 320x180 resolution<pre class="board-terminal">gst-launch-1.0 -vvv playbin uri=file:///root/video/BigBuckBunny_320x180.mp4 video-sink=fbdevsink</pre>* top process shows that cpu is running at 42% <pre class="board-terminal">top - 08:26:59 up 1:31, 2 users, load average: 1.21, 0.68, 0.54Tasks: 60 total, 1 running, 59 sleeping, 0 stopped, 0 zombie%Cpu(s): 41.1 us, 1.7 sy, 0.0 ni, 57.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stKiB Mem: 247172 total, 243736 used, 3436 free, 30796 buffersKiB Swap: 0 total, 0 used, 0 free. 125184 cached Mem
TBD indicare caratteristiche del test bed PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND12004 root 20 0 121068 17116 6372 S 42.4 6.9 0:10.00 gst-launch-1.011997 root 20 0 2980 1068 756 R 0.7 0.4 0:01.29 top 30 root rt 0 0 0 0 S 0.3 0.0 0:03.86 cfinteractive11610 root 20 0 0 0 0 S 0.3 0.0 0:02.05 kworker/0:0...</pre> This can be a more ''real use case'' where the cpu is partially devoted to video decoding and can perform the other usual tasks (frquenzagraphics, user interaction, RAMperipherals controls, risoluzione pannello eccetc.)without major impacts. ==Demo on youtube== {| class="wikitable" | width="100%"| {{#ev:youtube|AsgtEc1jwVY|500|center|Video MPEG and QT5.9 running on i.MX6 UL |frame}}|}
dave_user, Administrators
5,190
edits