[Howto] Odroid XU3/4 using the hardware encoder

Test and fix the Kernel 4.14 features
User avatar
rooted
Posts: 6761
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 205 times
Been thanked: 41 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by rooted » Sat Jun 30, 2018 2:29 pm

memeka wrote:
odroid wrote:@memeka,
Great! Can you please share the patches?
We want to update the ffmpeg package in our PPA server.
https://github.com/mihailescu2m/FFmpeg branch v4l2m2m-3.4.2
just clone and dpkg-buildpackage
I get this.

Code: Select all

 
rooted@cloudshell:~/gits/FFmpeg$ dpkg-buildpackage                                                dpkg-buildpackage: info: source package ffmpeg                                                    dpkg-buildpackage: info: source version 7:3.4.2-9                                                 dpkg-buildpackage: info: source distribution unstable                                             dpkg-buildpackage: info: source changed by memeka <mihailescu2m@gmail.com>                        dpkg-buildpackage: info: host architecture armhf                                                   dpkg-source --before-build FFmpeg                                                                dpkg-source: warning: unknown information field 'Rules-Requires-Root' in input data in general section of control info file                                                                          fakeroot debian/rules clean                                                                      dh clean
   dh_testdir
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/home/rooted/gits/FFmpeg'
[ ! -d debian/standard ] || rm -r debian/standard; [ ! -d debian/extra ] || rm -r debian/extra; [ ! -d debian/static ] || rm -r debian/static;
make[1]: Leaving directory '/home/rooted/gits/FFmpeg'
   dh_autoreconf_clean
   dh_clean
 dpkg-source -b FFmpeg
dpkg-source: warning: unknown information field 'Rules-Requires-Root' in input data in general section of control info file
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../ffmpeg_3.4.2.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b FFmpeg gave error exit status 255
 

User avatar
memeka
Posts: 4355
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 1 time
Been thanked: 37 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by memeka » Sat Jun 30, 2018 2:33 pm

try:
DEB_BUILD_OPTIONS="nocheck" dpkg-buildpackage -us -uc -b -j4
be sure to grab a coffee before.
after it's done, do not install the -extra packages, they conflict with the "standard" ones

User avatar
rooted
Posts: 6761
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 205 times
Been thanked: 41 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by rooted » Sat Jun 30, 2018 2:42 pm

It's building now, thanks for the help.

User avatar
odroid
Site Admin
Posts: 32489
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 178 times
Been thanked: 345 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by odroid » Tue Jul 03, 2018 10:34 am

memeka wrote:
odroid wrote:@memeka,
Great! Can you please share the patches?
We want to update the ffmpeg package in our PPA server.
https://github.com/mihailescu2m/FFmpeg branch v4l2m2m-3.4.2
just clone and dpkg-buildpackage
Thank you.
We've released a new ffmpeg package today. :)

Code: Select all

odroid@odroid:~$ ffmpeg
ffmpeg version 3.4.2-2ubuntu4 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=2ubuntu4 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl 
--disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca 
--enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa 
--enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr 
--enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-v4l2_m2m --enable-libdc1394 --enable-libdrm --enable-libiec61883 
--enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

martos
Posts: 85
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by martos » Fri Jul 06, 2018 5:58 pm

Could tou try again : ( it's on the begining of the post )
ffmpeg -i Sintel.2010.720p.mkv -acodec aac -vcodec h264 -b:v 2M -pix_fmt nv21 sintel-encoded.mp4 -loglevel trace

For me it's fail ...
[h264_v4l2m2m @ 0x571a00] probing device /dev/video21
[h264_v4l2m2m @ 0x571a00] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
[h264_v4l2m2m @ 0x571a00] v4l2 output format not supported
[h264_v4l2m2m @ 0x571a00] probing device /dev/video20
[h264_v4l2m2m @ 0x571a00] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
[h264_v4l2m2m @ 0x571a00] v4l2 output format not supported
[h264_v4l2m2m @ 0x571a00] probing device /dev/video11
[h264_v4l2m2m @ 0x571a00] probing device /dev/video10
[h264_v4l2m2m @ 0x571a00] probing device /dev/video33
[h264_v4l2m2m @ 0x571a00] driver 's5p-jpeg' on card 's5p-jpeg decoder'
[h264_v4l2m2m @ 0x571a00] v4l2 output format not supported
[h264_v4l2m2m @ 0x571a00] probing device /dev/video32
[h264_v4l2m2m @ 0x571a00] driver 's5p-jpeg' on card 's5p-jpeg encoder'
[h264_v4l2m2m @ 0x571a00] v4l2 output format not supported
[h264_v4l2m2m @ 0x571a00] probing device /dev/video31
[h264_v4l2m2m @ 0x571a00] driver 's5p-jpeg' on card 's5p-jpeg decoder'
[h264_v4l2m2m @ 0x571a00] v4l2 output format not supported
[h264_v4l2m2m @ 0x571a00] probing device /dev/video30
[h264_v4l2m2m @ 0x571a00] driver 's5p-jpeg' on card 's5p-jpeg encoder'
[h264_v4l2m2m @ 0x571a00] v4l2 output format not supported
[h264_v4l2m2m @ 0x571a00] Could not find a valid device
[h264_v4l2m2m @ 0x571a00] can't configure decoder
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> h264 (libx264))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Error while opening decoder for input stream #0:0 : Invalid argument
[AVIOContext @ 0x595370] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x549180] Statistics: 32768 bytes read, 0 seeks

HeWhoWas
Posts: 5
Joined: Mon Mar 18, 2013 11:25 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by HeWhoWas » Sat Jul 14, 2018 2:36 pm

I'm seeing the same issue as Martos with ffmpeg installed from meveric repository.

On a side note - is there any way we could produce a static binary for ffmpeg? I've done a bit of digging around the debian/rules file and can see references to a static flavor, and static libraries are produced but no ffmpeg binary.

Cheers.

User avatar
memeka
Posts: 4355
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 1 time
Been thanked: 37 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by memeka » Sat Jul 14, 2018 3:06 pm

HeWhoWas wrote:I'm seeing the same issue as Martos with ffmpeg installed from meveric repository.

On a side note - is there any way we could produce a static binary for ffmpeg? I've done a bit of digging around the debian/rules file and can see references to a static flavor, and static libraries are produced but no ffmpeg binary.

Cheers.
viewtopic.php?f=146&t=24366&start=150#p227356
don't know what version @meveric has.

HeWhoWas
Posts: 5
Joined: Mon Mar 18, 2013 11:25 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by HeWhoWas » Sat Jul 14, 2018 3:41 pm

Memeka - I had originally tried that after installing the default ffmpeg from official repos, which led to the problems I experienced. Cleaning the installation of all libav* and ffmpeg* packages, then reinstalling the compiled debs worked fine, thanks!

I don't suppose you know if there is an relatively simple way to produce a static build?

Edit - Looks like I spoke too soon. It's still not using the HW acceleration - I'll grab a BBB video and see if i can get some useful log output.

User avatar
memeka
Posts: 4355
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 1 time
Been thanked: 37 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by memeka » Sat Jul 14, 2018 3:44 pm

download the sources from the repo above, compile it yourself with static flags...

HeWhoWas
Posts: 5
Joined: Mon Mar 18, 2013 11:25 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by HeWhoWas » Sat Jul 14, 2018 4:13 pm

I've uploaded the logs here: https://paste.ee/p/8KPab

Long story short, when I specify the -vcodec h264_v4l2m2m manually, it exhibits the same problem martos above reported. -vcodec h264 works, but uses the CPU for encoding.

HeWhoWas
Posts: 5
Joined: Mon Mar 18, 2013 11:25 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by HeWhoWas » Sat Jul 14, 2018 4:25 pm

Fixed the issue - the default debian installation doesn't include the

Code: Select all

firmware-samsung
package - identified by checking dmesg output.

Installing that has resolved the issues with HW encoding.

sidewinderdude
Posts: 3
Joined: Thu Oct 25, 2018 3:46 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by sidewinderdude » Thu Oct 25, 2018 9:08 am

Hi all,

I'm trying to get the h264 encoder working on my XU4 using gstreamer. Here is the simplest pipeline I can come up with:

Code: Select all

gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=2097152" ! fakesink
When I run this I get this output from gst:

Code: Select all

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0: Could not get/set settings from/on resource.
Additional debug info:
gstv4l2object.c(3225): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0:
Device is in streaming mode
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
The "could not get/set settings" error is worrying but I'm not sure if it is important or not.
I don't understand why I get that error about the pipeline not wanting to preroll..

I'm running the "vanilla" Ubuntu 18.04 from the ODROID website. I haven't done a custom kernel or built a custom gstreamer. Is the custom gstreamer from memeka still necessary?

I have tried many things but just can't seem to get this to work. Any help would be met with extreme gratitude. :D

Max56
Posts: 31
Joined: Fri Aug 17, 2018 7:28 pm
languages_spoken: english / french
ODROIDs: C2/XU4
Has thanked: 0
Been thanked: 2 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by Max56 » Tue May 07, 2019 11:07 pm

Hello

I have the same issue

Code: Select all

GST_DEBUG=2 gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=2097152" ! fakesink
Setting pipeline to PAUSED ...
0:00:00.127580296 32209   0x636380 ERROR                   v4l2 gstv4l2object.c:1914:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.127657879 32209   0x636380 ERROR                   v4l2 gstv4l2object.c:1914:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.127797546 32209   0x636380 ERROR                   v4l2 gstv4l2object.c:1914:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.127828505 32209   0x636380 ERROR                   v4l2 gstv4l2object.c:1914:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.128056130 32209   0x636380 ERROR                   v4l2 gstv4l2object.c:1914:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.128084297 32209   0x636380 ERROR                   v4l2 gstv4l2object.c:1914:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

Pipeline is PREROLLING ...
Redistribute latency...
0:00:00.160134132 32209   0x62ac00 WARN          v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:<v4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:00.166746899 32209   0x62ac00 ERROR         v4l2bufferpool gstv4l2bufferpool.c:677:gst_v4l2_buffer_pool_streamon:<v4l2h264enc0:pool:src> error with STREAMON 105 (No buffer space available)
0:00:00.166779233 32209   0x62ac00 ERROR             bufferpool gstbufferpool.c:564:gst_buffer_pool_set_active:<v4l2h264enc0:pool:src> start failed
0:00:00.166814108 32209   0x62ac00 WARN            v4l2videoenc gstv4l2videoenc.c:344:gst_v4l2_video_enc_set_format:<v4l2h264enc0> Could not activate capture buffer pool.
0:00:00.166884275 32209   0x62ac00 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<v4l2h264enc0> rejected caps video/x-raw, format=(string)NV21, width=(int)640, height=(int)480, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
0:00:00.167324651 32209   0x62ac00 WARN                    v4l2 gstv4l2object.c:3225:gst_v4l2_object_set_format_full:<v4l2h264enc0> error: Device is in streaming mode
0:00:00.167471151 32209   0x62ac00 WARN            videoencoder gstvideoencoder.c:1798:gst_video_encoder_negotiate_default:<v4l2h264enc0> Subclass failed to decide allocation
0:00:00.167537110 32209   0x62ac00 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<v4l2h264enc0> rejected caps video/x-raw, format=(string)NV21, width=(int)640, height=(int)480, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
0:00:00.167573401 32209   0x62ac00 WARN                GST_PADS gstpad.c:4224:gst_pad_peer_query:<capsfilter0:src> could not send sticky events
ERROR: from element /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0: Could not get/set settings from/on resource.
Additional debug info:
gstv4l2object.c(3225): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0:
Device is in streaming mode
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
I'm trying to record the screen on a file with h264 encoding (viewtopic.php?f=95&t=32739&p=238170#p238170)

Did you get a solution ?

Thanks

hansan
Posts: 5
Joined: Fri Jan 03, 2014 6:47 am
languages_spoken: English, Dutch, German, Japanese
ODROIDs: ODROID-U3
2x ODROID-HC1
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by hansan » Sun Aug 25, 2019 2:00 am

Hello

I am also struggling with the hardware decoder / encoder.

I am using a armbian image with a 4.14.127 kernel and the ffmpeg from git https://github.com/mihailescu2m/FFmpeg.git branch v4l2m2m-3.4.2

When I encode big_bug_bunny or Sentinel as shown in the example in the first post, are things working. That is I get an MP4 file which I can play on my normal computer with Totem (vlc doesn't show anything.)

But when I try to encode an mpeg2 transport stream to h264 is ffmpeg hanging after about 23 seconds.

Output ffmpeg:

Code: Select all

ffmpeg -y -i Television_recording.mkv -codec:v h264 -b:v 2M -pix_fmt nv21 -vf 'yadif, scale=trunc(iw/64)*64:trunc(ih/64)*64' -acodec copy test3.mp4 
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: 
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
Input #0, matroska,webm, from 'Television_recording.mkv':
  Metadata:
    title           : XXXXXXXXX
    encoder         : Tvheadend Matroska muxer
    DATE_BROADCASTED: 2018-04-07 09:40:00
    ORIGINAL_MEDIA_TYPE: TV
    COMMENT         : Auto recording: Created from EPG query
  Duration: 00:31:00.04, start: 0.002000, bitrate: 6215 kb/s
    Chapter #0:0: start 0.000000, end 24.880000
    Chapter #0:1: start 24.880000, end 1492.720000
    Chapter #0:2: start 1492.720000, end 1860.042000
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
    Stream #0:1(ger): Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s (default)
    Stream #0:2(mis): Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s (default)
    Stream #0:3(mul): Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s (default)
    Stream #0:4(ger): Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default)
    Stream #0:5(ger): Subtitle: dvb_subtitle (default)
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 @ 0x190b410] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
    Last message repeated 1 times
[h264_v4l2m2m @ 0x190b410] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x190b410] Using device /dev/video11
[h264_v4l2m2m @ 0x190b410] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x190b410] h264_v4l2m2m encoder: enabling bit rate control: 2000000
[h264_v4l2m2m @ 0x190b410] h264 profile not found
[h264_v4l2m2m @ 0x190b410] Encoder adjusted: qmin (0), qmax (51)
Output #0, mp4, to 'test3.mp4':
  Metadata:
    DATE_BROADCASTED: 2018-04-07 09:40:00
    ORIGINAL_MEDIA_TYPE: TV
    CONTENT_TYPE    : Children's / Youth programs
    COMMENT         : Auto recording: Created from EPG query
    encoder         : Lavf57.83.100
    Chapter #0:0: start 0.000000, end 24.878000
    Chapter #0:1: start 24.878000, end 1492.718000
    Chapter #0:2: start 1492.718000, end 1860.040000
    Stream #0:0(eng): Video: h264 (h264_v4l2m2m) (avc1 / 0x31637661), nv21, 704x576 [SAR 16:11 DAR 16:9], q=2-31, 2000 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc57.107.100 h264_v4l2m2m
    Stream #0:1(ger): Audio: mp2 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 256 kb/s (default)
[mp4 @ 0x190ccc0] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output file.
frame=  596 fps= 25 q=-0.0 size=    5632kB time=00:00:23.76 bitrate=1941.8kbits/s dup=3 drop=0 speed=0.995x    
Here the encoding stops and ffmpeg hangs. Is this due to the "chapter" or is there a buffer full?

dmesg does not give much information either:

Code: Select all

[418564.559296] vidioc_try_fmt:1070: failed to try output format
[418564.559313] vidioc_try_fmt:1070: failed to try output format
Has someone experience how I can overcome this?

User avatar
mad_ady
Posts: 6780
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 215 times
Been thanked: 163 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by mad_ady » Sun Aug 25, 2019 3:44 am

Are the 23 seconds playable after encoding? I too tried to use it to transcode mpeg2ts but failed because slight errors/macroblocks in the stream would cause the encoder to hang. C2 on the other hand has a more robust encoder and could get the job done.

hansan
Posts: 5
Joined: Fri Jan 03, 2014 6:47 am
languages_spoken: English, Dutch, German, Japanese
ODROIDs: ODROID-U3
2x ODROID-HC1
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by hansan » Sun Aug 25, 2019 4:45 am

I forgot to mention. The 23 seconds of encoding creates a file of about 6MB (6029360bytes) but this is not a video file according to totem or ffprobe

Code: Select all

ffprobe test3.mp4
ffprobe version 3.4.2 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: 
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x18819a0] moov atom not found
test2.mp4: Invalid data found when processing input

hansan
Posts: 5
Joined: Fri Jan 03, 2014 6:47 am
languages_spoken: English, Dutch, German, Japanese
ODROIDs: ODROID-U3
2x ODROID-HC1
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by hansan » Sun Aug 25, 2019 5:28 am

I got a bit further with this topic.

When I use the official minimal ubuntu 18.04 image (https://wiki.odroid.com/odroid-xu4/os_i ... buntu_4.14) then I am able to use ffmpeg. The same command that I use in the post above is not make ffmpeg stop and produces correct output files.

I will have to investigate this a bit more, I believe I use the same kernel source. But I have to check this and verify the source of ffmpeg.

I need to think a bit if I really want to move my tvheadend server from an armbian based distribution to this new ubuntu based distribution.

User avatar
mad_ady
Posts: 6780
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 215 times
Been thanked: 163 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by mad_ady » Sun Aug 25, 2019 1:50 pm

There is a ffmpeg option for mp4 streaming that moves the moov segment at the beginning. Most likely it wasn't written because ffmpeg crashed.

CoBrA2168
Posts: 30
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by CoBrA2168 » Sat Oct 26, 2019 10:54 am

Sorry to bump a slightly older topic, but I’m trying to find how I can install a hardware-accelerated version of ffmpeg for my Odroid XU4 on Ubuntu 16.04 LTS (minimal). As far as I’m aware, it’s not included in the official repos. Can someone point me to the latest compiled version? Thanks!

User avatar
mad_ady
Posts: 6780
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 215 times
Been thanked: 163 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by mad_ady » Sat Oct 26, 2019 2:30 pm

You're right, it's not in the repo for 16.04. You can get the latest version compiled by me from here: http://www.mediafire.com/?l39zeyy4r172m

CoBrA2168
Posts: 30
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by CoBrA2168 » Sat Oct 26, 2019 7:16 pm

mad_ady wrote:
Sat Oct 26, 2019 2:30 pm
You're right, it's not in the repo for 16.04. You can get the latest version compiled by me from here: http://www.mediafire.com/?l39zeyy4r172m
Wow, thank you. Is this 3.x or 4.x? I’m a bit confused as to which is the latest version compiled with the correct hardware acceleration for our platform.

User avatar
mad_ady
Posts: 6780
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 215 times
Been thanked: 163 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by mad_ady » Sat Oct 26, 2019 8:46 pm

I have 3.0.2. Not sure how well 4.x works on 16.04. You can try - memeka has a branch with the source I think. See the first post.

CoBrA2168
Posts: 30
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by CoBrA2168 » Sat Oct 26, 2019 10:32 pm

mad_ady wrote:
Sat Oct 26, 2019 8:46 pm
I have 3.0.2. Not sure how well 4.x works on 16.04. You can try - memeka has a branch with the source I think. See the first post.
Will do, thank you again!

CoBrA2168
Posts: 30
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by CoBrA2168 » Sun Oct 27, 2019 11:27 pm

mad_ady wrote:
Sat Oct 26, 2019 8:46 pm
I have 3.0.2. Not sure how well 4.x works on 16.04. You can try - memeka has a branch with the source I think. See the first post.
Still struggling with FFmpeg versioning :? It's just a bit confusing. The 3.3.3-5 version I have actually is from the odroid repo. I'm just confused as to whether this is a confirmed, working version with hardware acceleration enabled. Or if I should be using 3.0.2 (that you linked above), 3.4.2 (from "meveric" repo, which I cannot seem to find for 16.04 anymore), or another version all together.

I think ideally the ODroid sources would be updated with the 3.4.2 version, since it's sounding like that's the best version for users still on 16.04 wanting hardware acceleration.

User avatar
mad_ady
Posts: 6780
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 215 times
Been thanked: 163 times
Contact:

Re: [Howto] Odroid XU3/4 using the hardware encoder

Unread post by mad_ady » Sun Oct 27, 2019 11:52 pm

As far as I know HK compiled in hardware support in ffmpeg only in 18.04, so I don't ghink their version had it enabled. Try 3.0.2 first and if you hsve problems, try to compile a newer version.

Post Reply

Return to “Linux Kernel 4.14 Debugging Party”

Who is online

Users browsing this forum: No registered users and 1 guest