MFC Video codec based on V4L2

Source: Internet
Author: User

Platform: exynos4412 (Ibox)

Kernel:odroid linux-3.8.13.29

Os:ubuntu14.04-armhf

Tool:eclipse-armhf

Refer to Samsung Source: public-apps-00d0905


4412 Eclipse Project


Process:

UVC gets 640X480YUYV data---->memcpy (because the UVC cannot use DMA continuous physical memory, it cannot be enqueued directly into FIMC)--->fimc (yuyv to nv12m)---> Join the way directly into MFC---->MFC---->H264/H263/MPEG1/2/4---> Write files



Encoded video is the original H264 data, can be converted to MP4 video files via Mp4v2, or directly from Gnome MPlayer, or you can try other players



Encoding 640x480 h264 fps 20 o'clock, CPU usage

tasks:155 Total,   2 running, 153 sleeping,   0 stopped,   0 zombie%cpu (s): 12.5 us,  5.9 sy,  0.0 ni, 76.3 i D,  0.0 wa,  0.0 hi,  5.4 si,  0.0 stkib Mem:   1029212 Total,   815784 used,   213428 free,    14032 Bufferskib Swap:        0 Total,        0 used,        0 free.   422128 cached Mem  PID USER      PR  NI    VIRT    RES    SHR S  %cpu%MEM     time+ COMMAND 1992 Odroid   0  815772 163172  23732 S  35.3 15.9   1:49.02 Java 1040 root   0   83028  42332  22792 S  25.5  4.1   2:24.59 Xorg 3495 odroid   0   35968  10036   9964 R  14.7  1.0   0:01.73 mfctest  753 Avahi   0    3740   2264   1068 S   2.9  0.2   4:31.55 Avahi-daemon
When encoding 1920x1080 H264 FPS20, the CPU utilization

tasks:155 Total, 1 running, 154 sleeping, 0 stopped, 0 zombie%cpu (s): 12.3 us, 9.5 sy, 0.0 ni, 71.3 ID, 1.3 wa,         0.0 Hi, 5.6 si, 0.0 stkib mem:1029212 Total, 901360 used, 127852 free, 7908 Bufferskib swap:0 Total,   0 used, 0 free.   462140 cached Mem PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND 3533 odroid 20 0 77696  10036 9964 D 33.4 1.0 0:06.40 mfctest 1992 odroid 0 817128 164240 23760 S 30.5 16.0 2:07.85 Java 1040 Root 0 82916 42352 22820 S 27.5 4.1 2:36.45 Xorg root 0 0 0 0 D 2.9 0   .0 0:09.89 mmcqd/0 1296 odroid 0 275576 11616 8532 S 2.9 1.1 1:41.22 indicator-multi 753 Avahi 20 0 3740 2264 1068 S 2.0 0.2 4:35.56 Avahi-daemon 1079 root 0 0 0 0 S 2.0 0.0 0 : 00.44 flush-179:0      1192 Odroid 0 49048 5100 2800 S 2.0 0.5 0:18.01 Ibus-daemon 3528 root0 5824 1232 848 R 1.0 0.1 0:00.49 Top 


Decoding without modification, directly using the original code, the original data directly decoded output to the LCD, extended to the entire screen


CPU usage when decoding output to 1920x1080 display

tasks:155 Total,   2 running, 153 sleeping,   0 stopped,   0 zombie%cpu (s): 15.8 us, 14.1 sy,  0.0 ni, 66.8 id,< c4/>0.0 wa,  0.0 hi,  3.4 si,  0.0 stkib Mem:   1029212 Total,   859364 used,   169848 free,    19132 Bufferskib Swap:        0 Total,        0 used,        0 free.   485832 cached Mem  PID USER      PR  NI    VIRT    RES    SHR S  %cpu%MEM     time+ COMMAND 1040 Root   0   83028  42332  22792 R  67.5  4.1   1:58.24 Xorg 3441 odroid    20   0  133412  11240  11128 S  45.0  1.1   0:02.50   v4l2_decode 2749 odroid 0  286724  12732   9432 S  22.5  1.2   0:22.79   lxterminal 1192 odroid 0 49048   5092   2800 S   6.8  0.5   0:13.88 ibus-daemon 1296 odroid   0  275576  11616   8532 S   2.9  1.1   1:36.81 Indicator-multi


Share files

Coding:

http://download.csdn.net/detail/liujia2100/8568845

Decoding:

http://download.csdn.net/detail/liujia2100/8568891


You can test the mfc5.1 version of the platform s5pv210 exynos4412.

Currently due to mfc5.1 hardware limitations, the MFC input format can only be nv12m, so if the input image data is another format, you must pass the conversion, here through FIMC the USB camera YUYV data into nv12m and then passed to MFC.

In the EXYNOS5 series processor, MFC can already support the direct input of other format files, so there is no need for FIMC, and the efficiency will increase.


MFC Video codec based on V4L2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.