FFMPEG released with MFC acceleration

Moderators: mdrjr, odroid

Re: FFMPEG released with MFC acceleration

Unread postby rooted » Thu Jul 05, 2018 2:08 am

martos wrote:I don't see h264 files in this link ...
Someone have one ?
https://download.blender.org/durian/movies/Sintel.2010.720p.mkv

This is h264
User avatar
rooted
 
Posts: 5167
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: FFMPEG released with MFC acceleration

Unread postby martos » Thu Jul 05, 2018 3:13 am

Same error

Works with softwre h264

ffmpeg -vcodec h264 -i Sintel.2010.720p.mkv /root/test3.avi
...
frame= 34 fps=0.0 q=2.0 size= 10kB time=00:00:01.75 bitrate= 45.8kbits/sframe= 76 fps= 75 q=1.6 size= 10kB time=00:00:03.48 bitrate= 23.0kbits/sframe= 97 fps= 64 q=18.9 size= 266kB time=00:00:04.53 bitrate= 480.0kbits/frame= 124 fps= 61 q=31.0 size= 522kB time=00:00:05.49 bitrate= 777.7kbits/frame= 151 fps= 60 q=31.0 size= 522kB time=00:00:06.76 bitrate= 631.6kbits/frame= 180 fps= 59 q=31.0 size= 778kB time=00:00:07.87 bitrate= 809.4kbits/frame= 211 fps= 60 q=31.0 size= 778kB time=00:00:09.12 bitrate= 698.6kbits/frame= 234 fps= 60 q=31.0 Lsize= 1086kB time=00:00:10.22 bitrate= 870.1kbi ..

Don't work with v4l2m2m

ffmpeg -vcodec h264_v4l2m2m -i Sintel.2010.720p.mkv /root/test3.avi
...

[h264_v4l2m2m @ 0x51bbc0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
Last message repeated 1 times
[h264_v4l2m2m @ 0x51bbc0] driver 's5p-jpeg' on card 's5p-jpeg decoder'
[h264_v4l2m2m @ 0x51bbc0] driver 's5p-jpeg' on card 's5p-jpeg encoder'
[h264_v4l2m2m @ 0x51bbc0] driver 's5p-jpeg' on card 's5p-jpeg decoder'
[h264_v4l2m2m @ 0x51bbc0] driver 's5p-jpeg' on card 's5p-jpeg encoder'
[h264_v4l2m2m @ 0x51bbc0] Could not find a valid device
[h264_v4l2m2m @ 0x51bbc0] can't configure decoder
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> mpeg4 (native))
Stream #0:1 -> #0:1 (ac3 (native) -> mp3 (libmp3lame))
Error while opening decoder for input stream #0:0 : Invalid argument
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Thu Jul 05, 2018 5:58 am

can we ask to the autor ( andrzej.p @ samsung.com ) or Marek Szyprowski ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Mon Jul 09, 2018 8:55 pm

OK so it's not work since sometime
i think it's not a dev of the drivers ( no change since longtime )
It could be the direct include of ffmpeg project of v4l2 m2m who include s5p
or a kernel trouble.

Can i create a ticket in ffmpeg ( https://trac.ffmpeg.org/ ) ? or someone else manage it ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Mon Jul 09, 2018 9:12 pm

@martos works for me in all combinations:

1. transcode with MFC decoder and MFC encoder: $ ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m transcoded.mkv
Code: Select all
odroid@odroid:~/video$ ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m transcoded.mkv
ffmpeg version 3.4.2-9 Copyright (c) 2000-2018 the FFmpeg developers
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './sintel_trailer-1080p.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    title           : Sintel Trailer
    artist          : Durian Open Movie Team
    encoder         : Lavf52.62.0
    copyright       : (c) copyright Blender Foundation | durian.blender.org
    description     : Trailer for the Sintel open movie project
  Duration: 00:00:52.21, start: 0.000000, bitrate: 2240 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 2108 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
[h264_v4l2m2m @ 0x4cdef0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
    Last message repeated 1 times
[h264_v4l2m2m @ 0x4cdef0] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x4cdef0] driver 's5p-mfc' on card 's5p-mfc-dec'
[h264_v4l2m2m @ 0x4cdef0] Using device /dev/video4
[h264_v4l2m2m @ 0x4cdef0] driver 's5p-mfc' on card 's5p-mfc-dec'
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> h264 (h264_v4l2m2m))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[h264_v4l2m2m @ 0x511780] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
    Last message repeated 1 times
[h264_v4l2m2m @ 0x511780] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x511780] Using device /dev/video5
[h264_v4l2m2m @ 0x511780] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x511780] h264_v4l2m2m encoder: enabling bit rate control: 200000
[h264_v4l2m2m @ 0x511780] h264 profile not found
[h264_v4l2m2m @ 0x511780] Encoder adjusted: qmin (0), qmax (51)
Output #0, matroska, to 'transcoded.mkv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    description     : Trailer for the Sintel open movie project
    title           : Sintel Trailer
    artist          : Durian Open Movie Team
    copyright       : (c) copyright Blender Foundation | durian.blender.org
    encoder         : Lavf57.83.100
    Stream #0:0(und): Video: h264 (h264_v4l2m2m) (H264 / 0x34363248), nv21, 1920x1080, q=2-31, 200 kb/s, 24 fps, 1k tbn, 24 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.107.100 h264_v4l2m2m
    Stream #0:1(und): Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc57.107.100 libvorbis


2. software decoder + MFC encoder: $ ffmpeg -vcodec h264 -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m transcoded.mkv
Code: Select all
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_v4l2m2m))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[h264_v4l2m2m @ 0x5d4970] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
    Last message repeated 1 times
[h264_v4l2m2m @ 0x5d4970] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x5d4970] Using device /dev/video5
[h264_v4l2m2m @ 0x5d4970] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x5d4970] h264_v4l2m2m encoder: enabling bit rate control: 200000
[h264_v4l2m2m @ 0x5d4970] h264 profile not found
[h264_v4l2m2m @ 0x5d4970] Encoder adjusted: qmin (0), qmax (51)
Output #0, matroska, to 'transcoded.mkv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    description     : Trailer for the Sintel open movie project
    title           : Sintel Trailer
    artist          : Durian Open Movie Team
    copyright       : (c) copyright Blender Foundation | durian.blender.org
    encoder         : Lavf57.83.100
    Stream #0:0(und): Video: h264 (h264_v4l2m2m) (H264 / 0x34363248), nv21, 1920x1080, q=2-31, 200 kb/s, 24 fps, 1k tbn, 24 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.107.100 h264_v4l2m2m
    Stream #0:1(und): Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc57.107.100 libvorbis
frame=   52 fps= 17 q=-0.0 Lsize=     115kB time=00:00:02.29 bitrate= 411.8kbits/s speed=0.763x   


3. MFC decoder + software encoder: $ ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec libx264 transcoded.mkv
Code: Select all
h264_v4l2m2m @ 0x550ef0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
    Last message repeated 1 times
[h264_v4l2m2m @ 0x550ef0] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x550ef0] driver 's5p-mfc' on card 's5p-mfc-dec'
[h264_v4l2m2m @ 0x550ef0] Using device /dev/video4
[h264_v4l2m2m @ 0x550ef0] driver 's5p-mfc' on card 's5p-mfc-dec'
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[libx264 @ 0x594780] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x594780] profile High, level 4.0
[libx264 @ 0x594780] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'transcoded.mkv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    description     : Trailer for the Sintel open movie project
    title           : Sintel Trailer
    artist          : Durian Open Movie Team
    copyright       : (c) copyright Blender Foundation | durian.blender.org
    encoder         : Lavf57.83.100
    Stream #0:0(und): Video: h264 (libx264) (H264 / 0x34363248), nv21, 1920x1080, q=-1--1, 24 fps, 1k tbn, 24 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.107.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc57.107.100 libvorbis
^Came=   27 fps=9.9 q=0.0 size=       0kB time=00:00:01.16 bitrate=   0.0kbits/s speed=0.427x   
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Mon Jul 09, 2018 10:37 pm

So something is bad in my config :

root@odroid:/home# ls
sintel_trailer-1080p.mp4
root@odroid:/home# ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m transcoded.mkv
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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './sintel_trailer-1080p.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
title : Sintel Trailer
artist : Durian Open Movie Team
encoder : Lavf52.62.0
copyright : (c) copyright Blender Foundation | durian.blender.org
description : Trailer for the Sintel open movie project
Duration: 00:00:52.21, start: 0.000000, bitrate: 2240 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 2108 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
[h264_v4l2m2m @ 0x474a20] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
Last message repeated 1 times
[h264_v4l2m2m @ 0x474a20] driver 's5p-jpeg' on card 's5p-jpeg decoder'
[h264_v4l2m2m @ 0x474a20] driver 's5p-jpeg' on card 's5p-jpeg encoder'
[h264_v4l2m2m @ 0x474a20] driver 's5p-jpeg' on card 's5p-jpeg decoder'
[h264_v4l2m2m @ 0x474a20] driver 's5p-jpeg' on card 's5p-jpeg encoder'
[h264_v4l2m2m @ 0x474a20] Could not find a valid device
[h264_v4l2m2m @ 0x474a20] can't configure decoder
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> h264 (h264_v4l2m2m))
Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Error while opening decoder for input stream #0:0 : Invalid argument
root@odroid:/home#

What i could check with your config ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Mon Jul 09, 2018 10:55 pm

To be sure could you post your sintel_trailer-1080p.mp4
because
you have ffmpeg version 3.4.2-9 ffmpeg version 3.4.2-2 ( but i try with ffmpeg v4 with same result )
Your drivers use s5p-mfc-enc and s5p-mfc-enc
Me s5p-jpeg decoder and s5p-jpeg encoder ...
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Mon Jul 09, 2018 11:51 pm

ok find !
i go to https://oph.mdrjr.net/memeka/ffmpeg/
check all .deb if i have the packet install , i install what it miss , make pudate and upgrade and shutdown -r now and it's works with it's file !

So i test my dvb t2 source , now it use s5p-mfc-dec and s5p-mfc-enc but i have an error :

[h264_v4l2m2m @ 0x54f910] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
Last message repeated 1 times
[h264_v4l2m2m @ 0x54f910] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x54f910] driver 's5p-mfc' on card 's5p-mfc-dec'
[h264_v4l2m2m @ 0x54f910] Using device /dev/video10
[h264_v4l2m2m @ 0x54f910] driver 's5p-mfc' on card 's5p-mfc-dec'
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> h264 (h264_v4l2m2m))
Stream #0:1 -> #0:1 (eac3 (native) -> aac (native))
Press [q] to stop, [?] for help
Error while decoding stream #0:0: Input/output error
Last message repeated 60 times
Error while decoding stream #0:0: Input/output error2.77 bitrate=N/A speed=N/A
Last message repeated 55 times
Error while decoding stream #0:0: Input/output error2.77 bitrate=N/A speed=N/A
Last message repeated 26 times
Too many packets buffered for output stream 0:1.
[aac @ 0x5932f0] Qavg: 478.587
[aac @ 0x5932f0] 2 frames left in the queue on closing
Conversion failed!

I try to use only encoder ( force software decoder h264 and use encoder h264_v4l2m2m )
Sound but not video ...
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Mon Jul 09, 2018 11:56 pm

in loglevel trace i have : ( for source in dvb t2 HD)

Error while decoding stream #0:0: Input/output error
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 9 times
Error while decoding stream #0:0: Input/output error
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 8 times
Error while decoding stream #0:0: Input/output error
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 12:29 am

ok i have the same error
The driver use
's5p-jpeg'

i reboot ( shutdown -r now )

and retry ...
it use
s5p-mfc-dec'

i try to find how we can make this error again ...
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 1:05 am

with software encoded :
ffmpeg -vcodec h264 -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264 transcoded.m3u8
works
ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m transcoded.m3u8
works

with software encoded :
ffmpeg -vcodec h264 -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264 -s 320x240 -ac 1 -ar 22050 -sn transcoded.m3u8
with mfc :
ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m -s 320x240 -ac 1 -ar 22050 -sn transcoded.m3u8
stop
Output #0, hls, to 'transcoded.m3u8':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
description : Trailer for the Sintel open movie project
title : Sintel Trailer
artist : Durian Open Movie Team
copyright : (c) copyright Blender Foundation | durian.blender.org
encoder : Lavf57.83.100
Stream #0:0(und), 0, 1/90000: Video: h264 (h264_v4l2m2m), 1 reference frame, nv21(left), 320x240, 0/1, q=2-31, 200 kb/s, 24 fps, 90k tbn, 24 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc57.107.100 h264_v4l2m2m
Stream #0:1(und), 0, 1/90000: Audio: aac (LC), 22050 Hz, mono, fltp, delay 1024, 69 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
encoder : Lavc57.107.100 aac
Clipping frame in rate conversion by 0.000008

so the extension .avi .m3u8 .mp4 don't work with mfc but work with software h264 codec.

Could you have a look ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 1:27 am

ffmpeg -vcodec h264_v4l2m2m -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264_v4l2m2m -s 320x240 -vf fps=21 -ac 1 -ar 22050 -sn transcoded.mkv
crash at the end

More quick and work whith codec h264
ffmpeg -vcodec h264 -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264 -s 320x240 -vf fps=21 -ac 1 -ar 22050 -sn transcoded.mkv
And finish ok

Could you have a look ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Tue Jul 10, 2018 10:02 am

if you change the resolution, it will be slow because it's using software scaler.
also using both MFC decoder and encoder is not very efficient, because currently ffmpeg is using only MMAP buffers when using MFC => it will be a buffer copy to swscaler, then buffer copy to encoder.
with ffmpeg, the best solution I've seen is to use software decoding + MFC encoder. But you need to set manually the bitrate and test with different values, because the hardware encoder has bad quality at low bitrates. So you need to use higher bitrate.

but the best software at the moment for transcoding is gstreamer. this is because gstreamer can use dma buffer sharing, so there is no buffer copy. also gstreamer can use the hardware scaler and converter, so changing resolution will not be done in software. the performance is much better than ffmpeg.
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 3:54 pm

Thnak's a lot for the explain , i will try gstreamer
thank's.
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 4:02 pm

Could you give the same command ffmpeg -vcodec h264 -i ./sintel_trailer-1080p.mp4 -pix_fmt nv21 -vcodec h264 -s 320x240 -vf fps=21 -ac 1 -ar 22050 -sn transcoded.mkv but with gstreamer ?
And if my source is http://127.0.0.1:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0: ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Tue Jul 10, 2018 4:03 pm

What kind of source is that?
Rtsp, rtmp? What streaming protocol?
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 4:05 pm

and my destination is /var/www/http/stream/file.m3u8
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 5:11 pm

So
Source = DVB in web ( mpeg2 / mpeg4 / h264 )
Destination = stream http with m3u8
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Tue Jul 10, 2018 5:36 pm

martos wrote:So
Source = DVB in web ( mpeg2 / mpeg4 / h264 )
Destination = stream http with m3u8


Can you please provide the protocols used for streaming?
For source and destination? Is destination HLS?
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 6:12 pm

I find old test from the same streaming(codec hw raspberry pi) :
gst-launch-1.0 souphttpsrc location=http://192.168.1.120...56:300000:0:0:0: is-live=true ! decodebin name=demux demux. ! queue ! audioresample ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! avenc_aac compliance=experimental ! mux. mpegtsmux name=mux ! hlssink max-files=5 location=/var/www/stream/stream%05d.ts playlist-location=/var/www/stream/ystream.m3u8 target-duration=10 demux. ! queue ! videoconvert ! videoscale ! omxh264enc target-bitrate=5000000 control-rate=variable inline-header=true periodicty-idr=1 interval-intraframes=5 ! video/x-h264,profile=high,width=420,height=336 ! h264parse config-interval=1 ! mux.

and this :
souphttpsrc location=http://192.168.1.120...0:1680000:0:0:0: is-live=true ! decodebin name=demux demux.src_1 ! queue ! audioresample ! audioconvert dithering=0 ! audio/x-raw,channels=2 ! avenc_aac compliance=experimental ! mux. mpegtsmux name=mux ! hlssink max-files=4 location=/var/www/stream/stream%05d.ts playlist-location=/var/www/stream/ystream.m3u8 target-duration=10 demux. ! queue ! deinterlace method=greedyl ! videoscale method=1 ! videorate !
videoconvert ! omxh264enc target-bitrate=3000000 control-rate=variable inline-header=true periodicty-idr=1 interval-intraframes=50 ! video/x-h264,framerate=24/1,profile=high,width=400,height=224 ! h264parse config-interval=5 ! mux.

Protocol is : HTTP Live Streaming ( m3u8 )
source is OpenWebif ( https://dream.reichholf.net/wiki/Enigma2:WebInterface )
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Tue Jul 10, 2018 6:18 pm

Oupss source is (MPEG TS mpeg4 or mpeg2 or h264)
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 1:23 am

find other more simple :
h264 mit ac3:
gst-launch-0.10 souphttpsrc location=http://<dreambox>:8001/<sref> ! mpegtsdemux name=dmx dmx. ! queue ! ffdec_h264 ! xvimagesink dmx. ! queue ! a52dec ! audioconvert ! alsasink

mpeg mit mp3:
gst-launch-0.10 souphttpsrc location=http://<dreambox>:8001/<sref> ! mpegtsdemux name=dmx dmx. ! queue ! mpeg2dec ! xvimagesink dmx. ! queue ! mad ! audioconvert ! alsasink
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Wed Jul 11, 2018 2:00 am

have you tried something like:
Code: Select all
gst-launch-0.10 souphttpsrc location="http://127.0.0.1:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! matroskamux ! filesink location=transcoded.mkv


if you want to make it smaller:

Code: Select all
gst-launch-0.10 souphttpsrc location="http://127.0.0.1:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! v4l2video20convert ! video/x-raw, width=320, height=240 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=4000000" ! h264parse ! matroskamux ! filesink location=transcoded.mkv


if you want to enable dmabuf, you need to add "capture-io-mode=4" to the first v4l2 element, and "output-io-mode=5" to the second. For example v4l2h264dec capture-io-mode=4 ! v4l2video20convert output-io-mode=5
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 5:45 am

memeka, i don't know where you live but i give you a good beer if you come in the north of the french ...

ok i try now ( before i can't because i am french and my family is from Belgium ...so i can touch at the TV ... )
I come back with the result. ( of gstream for the rest Frecnh 1 Belgium 0 )
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 7:15 am

i install gst-launch-1.0 because don't find 0.10
zap ( i am at the hotel) to a mpeg4 channel ssh on my receiver and wget -q -O - http://127.0.0.1/web/zap?sRef=1:0:19:41 ... 0000:0:0:0:


ssh on my odroid

test with ffmpeg to be sure

ffmpeg -vcodec h264 -i http://192.168.1.50:8001/+1:0:19:416:4: ... 0000:0:0:0: /root/test2.mp4

Metadata:
encoder : Lavf57.83.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(fra): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 341 kb/s
Metadata:
encoder : Lavc57.107.100 aac
...
works

gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! matroskamux ! filesink location=/root/transcoded.mkv

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context, session=(SoupSession)NULL, force=(boolean)false;
Missing element: DVB subtitles decoder
Missing element: DVB subtitles decoder
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 ...

Could you give me firts the software codec after we try try hw codec ?
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 5:37 pm

martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Wed Jul 11, 2018 6:05 pm

@martos : it's easier if you find me on freenode IRC #odroid channel...
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 6:21 pm

i try:


gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" is-live=true ! decodebin name=demux demux. ! queue ! audioresample ! audioconvert dithering=0 ! "audio/x-raw,channels=1" ! flacenc ! mux. matroskamux name=mux streamable=true ! tcpserversink host=127.0.0.1 port=5000 demux. ! queue ! videoconvert ! x264enc ! "video/x-h264,profile=high" ! h264parse ! mux.

It seem works : ( top)
8544 root 20 0 1331908 816540 28812 S 625.2 40.0 3:49.10 gst-launch

Could you change " tcpserversink host=127.0.0.1 port=5000 demux. " to a file /var/www/html/stream/ystream.m3u8 ? ( i don't find the command )
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 6:26 pm

ok

i try to connect to freenode IRC #odroid channel...

(must find how i can connect )
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 6:30 pm

martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 9:01 pm

for resume :

gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! videoscale ! video/x-raw, width=320, height=240 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! mpegtsmux ! hlssink max-files=5 playlist-root="http://127.0.0.1/hls/" playlist-location="/var/www/html/hls/stream0.m3u8" location="/var/www/html/hls/fragment%06d.ts" target-duration=5

Works !
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 9:08 pm

gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! videoscale ! video/x-raw, width=320, height=240 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! matroskamux ! filesink location=transcoded.mkv

In a file.
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Wed Jul 11, 2018 9:12 pm

gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:416:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! videoscale ! video/x-raw, width=320, height=240 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! queue ! rtph264pay ! udpsink host=127.0.0.1 port=5001

in rtp stream
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Thu Jul 12, 2018 6:41 am

crash of the odroid when i make the test, so i reboot it tomorrow and continue the test after.
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Sat Jul 14, 2018 7:02 pm

Escuse me , my mc1 have trouble with dhcp, i must power off power on a lot of time to have on ip ...

i try this :

gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:401:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! videoscale ! video/x-raw, width=320, height=240 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! matroskamux ! filesink location=transcoded.mkv

an check the file.

1 - No sound
2 - size is 320*240 BUT with the same octet of the 1920*1080 ( not encoded but size reduce)

gst-launch-1.0 souphttpsrc location="http://192.168.1.50:8001/+1:0:19:401:4:20FA:EEEE0000:0:0:0:" ! parsebin ! v4l2h264dec ! videoscale ! video/x-raw, width=320, height=240 ! v4l2h264enc extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=10000000" ! h264parse ! mpegtsmux ! hlssink max-files=5 playlist-root="http://127.0.0.1/hls/" playlist-location="/var/www/html/hls/stream0.m3u8" location="/var/www/html/hls/fragment%06d.ts" target-duration=5

Vlc detec something but can't read .
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Sat Jul 14, 2018 7:53 pm

1. yes there is no sound there, you need to modify the pipeline to add sound too
2. i don't understand
3. it worked for me ....
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Sat Jul 14, 2018 8:16 pm

1 OK
2
download :
https://transfer.sh/rhkTw/trancoded.mkv
open with vlc
go to tools
codec information
statistics
3000 k to 4000 k /s

I make a video without resize ( so 1920*1080) and i have the same statistic


with ffmpeg max 500 k /s
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby memeka » Sat Jul 14, 2018 8:22 pm

martos wrote:1 OK
2
download :
https://transfer.sh/rhkTw/trancoded.mkv
open with vlc
go to tools
codec information
statistics
3000 k to 4000 k /s

I make a video without resize ( so 1920*1080) and i have the same statistic


with ffmpeg max 500 k /s


That is the video bitrate.
frame_level_rate_control_enable=1,video_bitrate=10000000" => here you say to enable a bitrate of max 10mb/s. make it less if you want, 500000 (you will also get lower quality).
try different numbers until you get good quality and low size...
User avatar
memeka
 
Posts: 3955
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: FFMPEG released with MFC acceleration

Unread postby martos » Sat Jul 14, 2018 8:29 pm

For compare the same with ffmpag

https://transfer.sh/RksV6/trancoded2.mkv
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Sat Jul 14, 2018 8:30 pm

escuse me i see you post after ...
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Re: FFMPEG released with MFC acceleration

Unread postby martos » Sat Jul 14, 2018 8:55 pm

i retry but i have the begining of the file but nothing else

-rw-r--r-- 1 root root 492 Jul 14 11:43 transcoded4.mkv

relaunch the same command 5 secondes after and it works ...

sometimes it stop .

Could i have a log to understand ( and if you can give pipeline for the sound mono 22050 Khz )
martos
 
Posts: 57
Joined: Fri Jun 29, 2018 12:42 am
languages_spoken: english
ODROIDs: MC1

Previous

Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 3 guests