XU3/XU4 ffmpeg H.264 hardware encoding

This forum is for supported devices using an ARMv7 Samsung SoC.

XU3/XU4 ffmpeg H.264 hardware encoding

Postby alfmel » Sat Feb 02, 2019 3:41 pm

I recently got an Odroid XU4 running Arch Linux ARM. I would like to do H.264 hardware encoding with ffmpeg. According to this post on the Armbian forum, it is now possible.

Does anyone know what packages/modules/kernel/libraries/branches are required to get this working?

I have ffmpeg installed and the encoders list shows support for h264_v4l2m2m. Here is my ffmpeg command and the output.

Command:
$this->bbcode_second_pass_code('', 'ffmpeg -threads 4 -i recording.ts -vf scale=720:480 -vcodec h264_v4l2m2m -crf 18 -acodec copy test.mp4')

ffmpeg output:
$this->bbcode_second_pass_code('', '
ffmpeg version n4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.0 (GCC)
...
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_v4l2m2m))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264_v4l2m2m @ 0x4df750] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
Last message repeated 1 times
[h264_v4l2m2m @ 0x4df750] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x4df750] Using device /dev/video11
[h264_v4l2m2m @ 0x4df750] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x4df750] h264 profile not found
[h264_v4l2m2m @ 0x4df750] Encoder adjusted: qmin (0), qmax (51)
[mp4 @ 0x4df030] track 1: codec frame size is not set
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (h264_v4l2m2m) (avc1 / 0x31637661), yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
Metadata:
encoder : Lavc58.35.100 h264_v4l2m2m
Stream #0:1(eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
Video encoding failed
Conversion failed!
')

I assume the h264 profile not found warning has something to do with it. If I switch the video codec to h264 it encodes the video at 13-14 fps, so I know the rest of my command is correct. Any ideas?

== EDIT ==
I ran the following command which shows H.264 is supported by the /dev/video11 device:

$this->bbcode_second_pass_code('', '
$ v4l2-ctl -d /dev/video11 --list-formats
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar

[0]: 'H264' (H.264, compressed)
[1]: 'MPG4' (MPEG-4 part 2 ES, compressed)
[2]: 'H263' (H.263, compressed)
[3]: 'VP80' (VP8, compressed)
')

I also tried encoding to VP8 and ffmpeg just sits there, not erroring out but not encoding anything either.
alfmel
 
Posts: 4
Joined: Sat Feb 02, 2019 2:54 pm

Return to Samsung

Who is online

Users browsing this forum: No registered users and 5 guests