ninjaEF
Posts: 13
Joined: Thu Jan 14, 2016 9:06 am

is H264 codec via h/w ?

Tue Apr 04, 2017 1:09 pm

I have spent days researching this and switch off the PC more confused than when I powered it up...sigh!
this was about as close as to an answer I got, but I didn't fully understand.
viewtopic.php?f=63&t=80449

Given that the Pi is supposed to introduce the world of computing to hobbyists with no prior experience, please can someone explain in laymen terms , and answer to the following:-


I am using a Pi3 , as-downloaded OSMC (v2017.03-1) , and an as-downloaded Kodi 17 Krypton - i.e. no more additions other than installing libav. Now, if I use avconv with the h264 codec , is the encoder/decoding making use of HW encoding/decoding and does Kodi play media with this HW acceleration on ? If not, or if unsure, what simple steps can I take to make this happen

thank you all

ghans
Posts: 7714
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 1:14 pm

Kodi under OSMC will use hardware decoding. No need to compile , configure or select anything. That is the point of OSMC.

Kodi on Raspbian is another matter.

AFAIK neither aconv nor ffmpeg will use any hardware encoding or decoding on Raspbian by default.
If you are able to build either ffmpeg or aconv from source you should get access to hardware acceleration
under Raspbian too.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

gkreidl
Posts: 5589
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 2:17 pm

ghans wrote:Kodi under OSMC will use hardware decoding. No need to compile , configure or select anything. That is the point of OSMC.

Kodi on Raspbian is another matter.

AFAIK neither aconv nor ffmpeg will use any hardware encoding or decoding on Raspbian by default.
If you are able to build either ffmpeg or aconv from source you should get access to hardware acceleration
under Raspbian too.

ghans
Not quite true. All kodi versions for the RPi support HW decoding, either using MMAL or omxplayer.
Out of the box omxplayer is the only video player supporting HW decoding, but it is possible to compile versions of other players to support HW decoding (VLC, for example).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

ghans
Posts: 7714
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 2:26 pm

I believe those Kodi versions have been added to the repos recently ? You needed
to use 3rdparty repos previously ..

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

gkreidl
Posts: 5589
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 3:41 pm

ghans wrote:I believe those Kodi versions have been added to the repos recently ? You needed
to use 3rdparty repos previously ..

ghans
Since January 2016 kodi 15 is in the Foundation's repository.
Newer versions are available from the pipplware repository.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
topguy
Posts: 4406
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 4:17 pm

Pressing "o" while watching a video in Kodi also show a lot of detailed codec information together with which "driver/library" is used for video handling and also CPU load on each core. It should be quite obvious if the video you are playing is decoded using GPU or CPU.

ninjaEF
Posts: 13
Joined: Thu Jan 14, 2016 9:06 am

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 4:29 pm

thanks guys

although I'm confused still, a little..

are we saying, for OSMC, that out of the box, the following holds true:

1. omxplayer is the default kodi player for media {does this Include m3u streams in ts format?}

2. kodi decodes using HW

3. no HW encoding in avconv unless avconv recompiled? if so, what libs/options do I need?

thanks

ninjaEF
Posts: 13
Joined: Thu Jan 14, 2016 9:06 am

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 4:30 pm

it is not obvious to me

please share your expertise, how is it obvious!?
topguy wrote:Pressing "o" while watching a video in Kodi also show a lot of detailed codec information together with which "driver/library" is used for video handling and also CPU load on each core. It should be quite obvious if the video you are playing is decoded using GPU or CPU.

User avatar
topguy
Posts: 4406
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: is H264 codec via h/w ?

Tue Apr 04, 2017 11:08 pm

ninjaEF wrote:it is not obvious to me

please share your expertise, how is it obvious!?
topguy wrote:Pressing "o" while watching a video in Kodi also show a lot of detailed codec information together with which "driver/library" is used for video handling and also CPU load on each core. It should be quite obvious if the video you are playing is decoded using GPU or CPU.
http://kodi.wiki/view/codecinfo
See the fourth line in the example where it says ff-h264-vdpau, on Pi I believe you should see something with "omx" in it.
If you are watching a 1080p video with very little load on your CPU cores you are very probably using the GPU.

If your .ts streams does not contain the h264 codec but instead maybe MPEG2 (or VC1), then you can get GPU decoding if you buy the MPEG2 (or VC1) license. ( its disabled in firmware by default to reduce the price of the Pi )

PS: Also remember that Kodi is never "encoding" anything just "decoding".

ninjaEF
Posts: 13
Joined: Thu Jan 14, 2016 9:06 am

Re: is H264 codec via h/w ?

Wed Apr 05, 2017 6:32 am

thanks @topguy

that is very useful. Im sure when I was watching a .ts stream, there wasn't that much info on the screen. I will look again.

what I am doing now is compiling ffmpeg with omx enabled but I get an error, "OMX IL Headers not found". Can I post this to another forum thread or continue here?... in the event this is still on thread...

I am following this guide...
https://www.bitpi.co/2015/08/19/how-to- ... pberry-pi/

The got the OMX Header error when attempting to make ffmpeg
Will these headers do the job?
https://github.com/raspberrypi/firmware ... include/IL

For this compilation task:

EDIT**
Answer my on question but for the benefit of others..
I Found a working combo:

This:
https://github.com/legotheboss/YouTube- ... celeration

with this:
http://ffmpeg.gusari.org/viewtopic.php?f=8&t=3327

I previously only had h264 codec, now I have h264_omx codec which I use for encoding live ts tream

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: is H264 codec via h/w ?

Wed Apr 05, 2017 10:51 am

I'm not sure if I built it the best way, but I recently compiled FFmpeg on my Pi3B with Raspbian Stretch. Here's what I did:

Code: Select all

# Compile FFmpeg on Raspberry Pi 3 with Raspbian Stretch

pi@raspberrypi:~$ sudo apt install libasound2-dev libx264-dev libopus-dev

pi@raspberrypi:~$ mkdir -p ~/software/source
pi@raspberrypi:~$ cd ~/software/source

pi@raspberrypi:~/software/source$ git clone https://github.com/mstorsjo/fdk-aac.git
pi@raspberrypi:~/software/source$ cd fdk-aac
pi@raspberrypi:~/software/source/fdk-aac$ ./autogen.sh
pi@raspberrypi:~/software/source/fdk-aac$ ./configure --enable-shared --enable-static
pi@raspberrypi:~/software/source/fdk-aac$ make -j3
pi@raspberrypi:~/software/source/fdk-aac$ sudo make install
pi@raspberrypi:~/software/source/fdk-aac$ sudo ldconfig

pi@raspberrypi:~/software/source/fdk-aac$ cd ~/software/source

pi@raspberrypi:~/software/source$ git clone https://github.com/FFmpeg/FFmpeg.git
pi@raspberrypi:~/software/source$ cd FFmpeg
pi@raspberrypi:~/software/source/FFmpeg$ ./configure --arch=armhf --target-os=linux --enable-gpl --enable-nonfree --enable-libx264 --enable-libopus --enable-libfdk-aac --enable-omx --enable-omx-rpi --enable-mmal
install prefix            /usr/local
source path               .
C compiler                gcc
C library                 glibc
ARCH                      arm (armv6)
big-endian                no
runtime cpu detection     yes
ARMv5TE enabled           yes
ARMv6 enabled             yes
ARMv6T2 enabled           yes
VFP enabled               yes
NEON enabled              yes
THUMB enabled             no
debug symbols             yes
strip symbols             yes
optimize for size         no
optimizations             yes
static                    yes
shared                    no
postprocessing support    yes
network support           yes
threading support         pthreads
safe bitstream reader     yes
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          no
makeinfo supports HTML    no

External libraries:
bzlib			   libx264		      libxcb_xfixes		 sdl2
iconv			   libxcb		      lzma			 xlib
libfdk_aac		   libxcb_shape		      sdl			 zlib
libopus			   libxcb_shm

External libraries providing hardware acceleration:
mmal			   omx			      vaapi			 vdpau

Libraries:
avcodec			   avfilter		      avutil			 swresample
avdevice		   avformat		      postproc			 swscale

Programs:
ffmpeg			   ffplay		      ffprobe			 ffserver

Enabled decoders:
aac			   aura			      ffv1			 motionpixels
aac_fixed		   aura2		      ffvhuff			 movtext
aac_latm		   avrn			      ffwavesynth		 mp1
aasc			   avrp			      fic			 mp1float
ac3			   avs			      flac			 mp2
ac3_fixed		   avui			      flashsv			 mp2float
adpcm_4xm		   ayuv			      flashsv2			 mp3
adpcm_adx		   bethsoftvid		      flic			 mp3adu
adpcm_afc		   bfi			      flv			 mp3adufloat
adpcm_aica		   bink			      fmvc			 mp3float
adpcm_ct		   binkaudio_dct	      fourxm			 mp3on4
adpcm_dtk		   binkaudio_rdft	      fraps			 mp3on4float
adpcm_ea		   bintext		      frwu			 mpc7
adpcm_ea_maxis_xa	   bmp			      g2m			 mpc8
adpcm_ea_r1		   bmv_audio		      g723_1			 mpeg1_vdpau
adpcm_ea_r2		   bmv_video		      g729			 mpeg1video
adpcm_ea_r3		   brender_pix		      gif			 mpeg2_mmal
adpcm_ea_xas		   c93			      gsm			 mpeg2video
adpcm_g722		   cavs			      gsm_ms			 mpeg4
adpcm_g726		   ccaption		      h261			 mpeg4_mmal
adpcm_g726le		   cdgraphics		      h263			 mpeg4_vdpau
adpcm_ima_amv		   cdxl			      h263i			 mpeg_vdpau
adpcm_ima_apc		   cfhd			      h263p			 mpegvideo
adpcm_ima_dat4		   cinepak		      h264			 mpl2
adpcm_ima_dk3		   clearvideo		      h264_mmal			 msa1
adpcm_ima_dk4		   cljr			      h264_vdpau		 msmpeg4v1
adpcm_ima_ea_eacs	   cllc			      hap			 msmpeg4v2
adpcm_ima_ea_sead	   comfortnoise		      hevc			 msmpeg4v3
adpcm_ima_iss		   cook			      hnm4_video		 msrle
adpcm_ima_oki		   cpia			      hq_hqa			 mss1
adpcm_ima_qt		   cscd			      hqx			 mss2
adpcm_ima_rad		   cyuv			      huffyuv			 msvideo1
adpcm_ima_smjpeg	   dca			      iac			 mszh
adpcm_ima_wav		   dds			      idcin			 mts2
adpcm_ima_ws		   dfa			      idf			 mvc1
adpcm_ms		   dirac		      iff_ilbm			 mvc2
adpcm_mtaf		   dnxhd		      imc			 mxpeg
adpcm_psx		   dpx			      indeo2			 nellymoser
adpcm_sbpro_2		   dsd_lsbf		      indeo3			 nuv
adpcm_sbpro_3		   dsd_lsbf_planar	      indeo4			 on2avc
adpcm_sbpro_4		   dsd_msbf		      indeo5			 opus
adpcm_swf		   dsd_msbf_planar	      interplay_acm		 paf_audio
adpcm_thp		   dsicinaudio		      interplay_dpcm		 paf_video
adpcm_thp_le		   dsicinvideo		      interplay_video		 pam
adpcm_vima		   dss_sp		      jacosub			 pbm
adpcm_xa		   dst			      jpeg2000			 pcm_alaw
adpcm_yamaha		   dvaudio		      jpegls			 pcm_bluray
aic			   dvbsub		      jv			 pcm_dvd
alac			   dvdsub		      kgv1			 pcm_f16le
alias_pix		   dvvideo		      kmvc			 pcm_f24le
als			   dxa			      lagarith			 pcm_f32be
amrnb			   dxtory		      libfdk_aac		 pcm_f32le
amrwb			   dxv			      libopus			 pcm_f64be
amv			   eac3			      loco			 pcm_f64le
anm			   eacmv		      m101			 pcm_lxf
ansi			   eamad		      mace3			 pcm_mulaw
ape			   eatgq		      mace6			 pcm_s16be
apng			   eatgv		      magicyuv			 pcm_s16be_planar
ass			   eatqi		      mdec			 pcm_s16le
asv1			   eightbps		      metasound			 pcm_s16le_planar
asv2			   eightsvx_exp		      microdvd			 pcm_s24be
atrac1			   eightsvx_fib		      mimic			 pcm_s24daud
atrac3			   escape124		      mjpeg			 pcm_s24le
atrac3al		   escape130		      mjpegb			 pcm_s24le_planar
atrac3p			   evrc			      mlp			 pcm_s32be
atrac3pal		   exr			      mmvideo			 pcm_s32le
pcm_s32le_planar	   roq			      tdsc			 vp7
pcm_s64be		   roq_dpcm		      text			 vp8
pcm_s64le		   rpza			      theora			 vp9
pcm_s8			   rscc			      thp			 vplayer
pcm_s8_planar		   rv10			      tiertexseqvideo		 vqa
pcm_u16be		   rv20			      tiff			 wavpack
pcm_u16le		   rv30			      tmv			 webp
pcm_u24be		   rv40			      truehd			 webvtt
pcm_u24le		   s302m		      truemotion1		 wmalossless
pcm_u32be		   sami			      truemotion2		 wmapro
pcm_u32le		   sanm			      truemotion2rt		 wmav1
pcm_u8			   scpr			      truespeech		 wmav2
pcm_zork		   screenpresso		      tscc			 wmavoice
pcx			   sdx2_dpcm		      tscc2			 wmv1
pgm			   sgi			      tta			 wmv2
pgmyuv			   sgirle		      twinvq			 wmv3
pgssub			   sheervideo		      txd			 wmv3_vdpau
pictor			   shorten		      ulti			 wmv3image
pixlet			   sipr			      utvideo			 wnv1
pjs			   smackaud		      v210			 ws_snd1
png			   smacker		      v210x			 xan_dpcm
ppm			   smc			      v308			 xan_wc3
prores			   smvjpeg		      v408			 xan_wc4
prores_lgpl		   snow			      v410			 xbin
psd			   sol_dpcm		      vb			 xbm
ptx			   sonic		      vble			 xface
qcelp			   sp5x			      vc1			 xl
qdm2			   speedhq		      vc1_mmal			 xma1
qdmc			   srt			      vc1_vdpau			 xma2
qdraw			   ssa			      vc1image			 xpm
qpeg			   stl			      vcr1			 xsub
qtrle			   subrip		      vmdaudio			 xwd
r10k			   subviewer		      vmdvideo			 y41p
r210			   subviewer1		      vmnc			 ylc
ra_144			   sunrast		      vorbis			 yop
ra_288			   svq1			      vp3			 yuv4
ralf			   svq3			      vp5			 zero12v
rawvideo		   tak			      vp6			 zerocodec
realtext		   targa		      vp6a			 zlib
rl2			   targa_y216		      vp6f			 zmbv

Enabled encoders:
a64multi		   flv			      pcm_mulaw			 rv20
a64multi5		   g723_1		      pcm_s16be			 s302m
aac			   gif			      pcm_s16be_planar		 sgi
ac3			   h261			      pcm_s16le			 snow
ac3_fixed		   h263			      pcm_s16le_planar		 sonic
adpcm_adx		   h263p		      pcm_s24be			 sonic_ls
adpcm_g722		   h264_omx		      pcm_s24daud		 srt
adpcm_g726		   h264_vaapi		      pcm_s24le			 ssa
adpcm_ima_qt		   hevc_vaapi		      pcm_s24le_planar		 subrip
adpcm_ima_wav		   huffyuv		      pcm_s32be			 sunrast
adpcm_ms		   jpeg2000		      pcm_s32le			 svq1
adpcm_swf		   jpegls		      pcm_s32le_planar		 targa
adpcm_yamaha		   libfdk_aac		      pcm_s64be			 text
alac			   libopus		      pcm_s64le			 tiff
alias_pix		   libx264		      pcm_s8			 truehd
amv			   libx264rgb		      pcm_s8_planar		 tta
apng			   ljpeg		      pcm_u16be			 utvideo
ass			   mjpeg		      pcm_u16le			 v210
asv1			   mjpeg_vaapi		      pcm_u24be			 v308
asv2			   mlp			      pcm_u24le			 v408
avrp			   movtext		      pcm_u32be			 v410
avui			   mp2			      pcm_u32le			 vc2
ayuv			   mp2fixed		      pcm_u8			 vorbis
bmp			   mpeg1video		      pcx			 vp8_vaapi
cinepak			   mpeg2_vaapi		      pgm			 wavpack
cljr			   mpeg2video		      pgmyuv			 webvtt
comfortnoise		   mpeg4		      png			 wmav1
dca			   msmpeg4v2		      ppm			 wmav2
dnxhd			   msmpeg4v3		      prores			 wmv1
dpx			   msvideo1		      prores_aw			 wmv2
dvbsub			   nellymoser		      prores_ks			 wrapped_avframe
dvdsub			   opus			      qtrle			 xbm
dvvideo			   pam			      r10k			 xface
eac3			   pbm			      r210			 xsub
ffv1			   pcm_alaw		      ra_144			 xwd
ffvhuff			   pcm_f32be		      rawvideo			 y41p
flac			   pcm_f32le		      roq			 yuv4
flashsv			   pcm_f64be		      roq_dpcm			 zlib
flashsv2		   pcm_f64le		      rv10			 zmbv

Enabled hwaccels:
h263_vaapi		   hevc_vdpau		      mpeg4_mmal		 vc1_vdpau
h264_mmal		   mpeg1_vdpau		      mpeg4_vaapi		 vp9_vaapi
h264_vaapi		   mpeg2_mmal		      mpeg4_vdpau		 wmv3_vaapi
h264_vdpau		   mpeg2_vaapi		      vc1_mmal			 wmv3_vdpau
hevc_vaapi		   mpeg2_vdpau		      vc1_vaapi

Enabled parsers:
aac			   dpx			      h264			 rv30
aac_latm		   dvaudio		      hevc			 rv40
ac3			   dvbsub		      mjpeg			 sipr
adx			   dvd_nav		      mlp			 tak
bmp			   dvdsub		      mpeg4video		 vc1
cavsvideo		   flac			      mpegaudio			 vorbis
cook			   g729			      mpegvideo			 vp3
dca			   gsm			      opus			 vp8
dirac			   h261			      png			 vp9
dnxhd			   h263			      pnm			 xma

Enabled demuxers:
aa			   flic			      mgsts			 rm
aac			   flv			      microdvd			 roq
ac3			   fourxm		      mjpeg			 rpl
acm			   frm			      mjpeg_2000		 rsd
act			   fsb			      mlp			 rso
adf			   g722			      mlv			 rtp
adp			   g723_1		      mm			 rtsp
ads			   g729			      mmf			 sami
adx			   genh			      mov			 sap
aea			   gif			      mp3			 sbg
afc			   gsm			      mpc			 scc
aiff			   gxf			      mpc8			 sdp
aix			   h261			      mpegps			 sdr2
amr			   h263			      mpegts			 sds
anm			   h264			      mpegtsraw			 sdx
apc			   hevc			      mpegvideo			 segafilm
ape			   hls			      mpjpeg			 shorten
apng			   hnm			      mpl2			 siff
aqtitle			   ico			      mpsub			 sln
asf			   idcin		      msf			 smacker
asf_o			   idf			      msnwc_tcp			 smjpeg
ass			   iff			      mtaf			 smush
ast			   ilbc			      mtv			 sol
au			   image2		      musx			 sox
avi			   image2_alias_pix	      mv			 spdif
avr			   image2_brender_pix	      mvi			 srt
avs			   image2pipe		      mxf			 stl
bethsoftvid		   image_bmp_pipe	      mxg			 str
bfi			   image_dds_pipe	      nc			 subviewer
bfstm			   image_dpx_pipe	      nistsphere		 subviewer1
bink			   image_exr_pipe	      nsv			 sup
bintext			   image_j2k_pipe	      nut			 svag
bit			   image_jpeg_pipe	      nuv			 swf
bmv			   image_jpegls_pipe	      ogg			 tak
boa			   image_pam_pipe	      oma			 tedcaptions
brstm			   image_pbm_pipe	      paf			 thp
c93			   image_pcx_pipe	      pcm_alaw			 threedostr
caf			   image_pgm_pipe	      pcm_f32be			 tiertexseq
cavsvideo		   image_pgmyuv_pipe	      pcm_f32le			 tmv
cdg			   image_pictor_pipe	      pcm_f64be			 truehd
cdxl			   image_png_pipe	      pcm_f64le			 tta
cine			   image_ppm_pipe	      pcm_mulaw			 tty
concat			   image_psd_pipe	      pcm_s16be			 txd
data			   image_qdraw_pipe	      pcm_s16le			 v210
daud			   image_sgi_pipe	      pcm_s24be			 v210x
dcstr			   image_sunrast_pipe	      pcm_s24le			 vag
dfa			   image_tiff_pipe	      pcm_s32be			 vc1
dirac			   image_webp_pipe	      pcm_s32le			 vc1t
dnxhd			   image_xpm_pipe	      pcm_s8			 vivo
dsf			   ingenient		      pcm_u16be			 vmd
dsicin			   ipmovie		      pcm_u16le			 vobsub
dss			   ircam		      pcm_u24be			 voc
dts			   iss			      pcm_u24le			 vpk
dtshd			   iv8			      pcm_u32be			 vplayer
dv			   ivf			      pcm_u32le			 vqf
dvbsub			   ivr			      pcm_u8			 w64
dvbtxt			   jacosub		      pjs			 wav
dxa			   jv			      pmp			 wc3
ea			   live_flv		      pva			 webm_dash_manifest
ea_cdata		   lmlm4		      pvf			 webvtt
eac3			   loas			      qcp			 wsaud
epaf			   lrc			      r3d			 wsd
ffm			   lvf			      rawvideo			 wsvqa
ffmetadata		   lxf			      realtext			 wtv
filmstrip		   m4v			      redspark			 wv
flac			   matroska		      rl2			 wve
xa			   xmv			      xwma			 yuv4mpegpipe
xbin			   xvag			      yop

Enabled muxers:
a64			   gif			      mpeg2svcd			 rm
ac3			   gsm			      mpeg2video		 roq
adts			   gxf			      mpeg2vob			 rso
adx			   h261			      mpegts			 rtp
aiff			   h263			      mpjpeg			 rtp_mpegts
amr			   h264			      mxf			 rtsp
apng			   hash			      mxf_d10			 sap
asf			   hds			      mxf_opatom		 scc
asf_stream		   hevc			      null			 segment
ass			   hls			      nut			 singlejpeg
ast			   ico			      oga			 smjpeg
au			   ilbc			      ogg			 smoothstreaming
avi			   image2		      ogv			 sox
avm2			   image2pipe		      oma			 spdif
bit			   ipod			      opus			 spx
caf			   ircam		      pcm_alaw			 srt
cavsvideo		   ismv			      pcm_f32be			 stream_segment
crc			   ivf			      pcm_f32le			 swf
dash			   jacosub		      pcm_f64be			 tee
data			   latm			      pcm_f64le			 tg2
daud			   lrc			      pcm_mulaw			 tgp
dirac			   m4v			      pcm_s16be			 truehd
dnxhd			   matroska		      pcm_s16le			 tta
dts			   matroska_audio	      pcm_s24be			 uncodedframecrc
dv			   md5			      pcm_s24le			 vc1
eac3			   microdvd		      pcm_s32be			 vc1t
f4v			   mjpeg		      pcm_s32le			 voc
ffm			   mkvtimestamp_v2	      pcm_s8			 w64
ffmetadata		   mlp			      pcm_u16be			 wav
fifo			   mmf			      pcm_u16le			 webm
filmstrip		   mov			      pcm_u24be			 webm_chunk
flac			   mp2			      pcm_u24le			 webm_dash_manifest
flv			   mp3			      pcm_u32be			 webp
framecrc		   mp4			      pcm_u32le			 webvtt
framehash		   mpeg1system		      pcm_u8			 wtv
framemd5		   mpeg1vcd		      psp			 wv
g722			   mpeg1video		      rawvideo			 yuv4mpegpipe
g723_1			   mpeg2dvd

Enabled protocols:
async			   ftp			      mmsh			 srtp
cache			   gopher		      mmst			 subfile
concat			   hls			      pipe			 tcp
crypto			   http			      prompeg			 tee
data			   httpproxy		      rtmp			 udp
ffrtmphttp		   icecast		      rtmpt			 udplite
file			   md5			      rtp			 unix

Enabled filters:
abench			   blend		      framestep			 pixdesctest
abitscope		   boxblur		      fspp			 pp
acompressor		   bwdif		      gblur			 pp7
acrossfade		   cellauto		      geq			 premultiply
acrusher		   channelmap		      gradfun			 prewitt
adelay			   channelsplit		      haldclut			 psnr
adrawgraph		   chorus		      haldclutsrc		 pullup
aecho			   chromakey		      hdcd			 qp
aemphasis		   ciescope		      hflip			 random
aeval			   codecview		      highpass			 readeia608
aevalsrc		   color		      histeq			 readvitc
afade			   colorbalance		      histogram			 realtime
afftfilt		   colorchannelmixer	      hqdn3d			 remap
aformat			   colorkey		      hqx			 removegrain
agate			   colorlevels		      hstack			 removelogo
ahistogram		   colormatrix		      hue			 repeatfields
ainterleave		   colorspace		      hwdownload		 replaygain
alimiter		   compand		      hwmap			 reverse
allpass			   compensationdelay	      hwupload			 rgbtestsrc
allrgb			   concat		      hysteresis		 rotate
allyuv			   convolution		      idet			 sab
aloop			   copy			      il			 scale
alphaextract		   cover_rect		      inflate			 scale2ref
alphamerge		   crop			      interlace			 scale_vaapi
amerge			   cropdetect		      interleave		 select
ametadata		   crystalizer		      join			 selectivecolor
amix			   curves		      kerndeint			 sendcmd
amovie			   datascope		      lenscorrection		 separatefields
anequalizer		   dcshift		      life			 setdar
anoisesrc		   dctdnoiz		      loop			 setfield
anull			   deband		      loudnorm			 setpts
anullsink		   decimate		      lowpass			 setsar
anullsrc		   deflate		      lut			 settb
apad			   deinterlace_vaapi	      lut2			 showcqt
aperms			   dejudder		      lut3d			 showfreqs
aphasemeter		   delogo		      lutrgb			 showinfo
aphaser			   deshake		      lutyuv			 showpalette
apulsator		   detelecine		      mandelbrot		 showspectrum
arealtime		   dilation		      maskedclamp		 showspectrumpic
aresample		   displace		      maskedmerge		 showvolume
areverse		   drawbox		      mcdeint			 showwaves
aselect			   drawgraph		      mergeplanes		 showwavespic
asendcmd		   drawgrid		      mestimate			 shuffleframes
asetnsamples		   dynaudnorm		      metadata			 shuffleplanes
asetpts			   earwax		      midequalizer		 sidechaincompress
asetrate		   ebur128		      minterpolate		 sidechaingate
asettb			   edgedetect		      movie			 sidedata
ashowinfo		   elbg			      mpdecimate		 signalstats
asidedata		   eq			      mptestsrc			 signature
asplit			   equalizer		      negate			 silencedetect
astats			   erosion		      nlmeans			 silenceremove
astreamselect		   extractplanes	      nnedi			 sine
atadenoise		   extrastereo		      noformat			 smartblur
atempo			   fade			      noise			 smptebars
atrim			   fftfilt		      null			 smptehdbars
avectorscope		   field		      nullsink			 sobel
avgblur			   fieldhint		      nullsrc			 spectrumsynth
bandpass		   fieldmatch		      overlay			 split
bandreject		   fieldorder		      owdenoise			 spp
bass			   find_rect		      pad			 ssim
bbox			   firequalizer		      palettegen		 stereo3d
bench			   flanger		      paletteuse		 stereotools
biquad			   format		      pan			 stereowiden
bitplanenoise		   fps			      perms			 streamselect
blackdetect		   framepack		      perspective		 super2xsai
blackframe		   framerate		      phase			 swaprect
swapuv			   tinterlace		      vectorscope		 w3fdif
tblend			   transpose		      vflip			 waveform
telecine		   treble		      vibrato			 weave
testsrc			   tremolo		      vignette			 xbr
testsrc2		   trim			      volume			 yadif
threshold		   unsharp		      volumedetect		 yuvtestsrc
thumbnail		   uspp			      vstack			 zoompan
tile			   vaguedenoiser

Enabled bsfs:
aac_adtstoasc		   h264_mp4toannexb	      mjpega_dump_header	 noise
chomp			   hevc_mp4toannexb	      mov2textsub		 remove_extradata
dca_core		   imx_dump_header	      mp3_header_decompress	 text2movsub
dump_extradata		   mjpeg2jpeg		      mpeg4_unpack_bframes	 vp9_superframe
extract_extradata

Enabled indevs:
alsa			   jack			      oss			 v4l2
dv1394			   lavfi		      sndio			 xcbgrab
fbdev

Enabled outdevs:
alsa			   oss			      sndio			 xv
fbdev			   sdl2			      v4l2

License: nonfree and unredistributable
Creating configuration files ...

pi@raspberrypi:~/software/source/FFmpeg$ make -j3
pi@raspberrypi:~/software/source/FFmpeg$ sudo make install
pi@raspberrypi:~/software/source/FFmpeg$ sudo ldconfig

ninjaEF
Posts: 13
Joined: Thu Jan 14, 2016 9:06 am

Re: is H264 codec via h/w ?

Wed Apr 05, 2017 1:08 pm

well, what you have done there, it would seem to me, is

compiled libx264 which is the GPL version of OMX h264

As I understand it, Broadcom do not licence the distribution of binaries and you have to build using OMX IL headers + libraries

So your procedure above will give you a .264 codec that will not use the PIs GPU for acceleration

Compiling using OMX IL headers and libs will give you the h264_omx codec which DOES use the GPU

So you are in fact, using S/W encoding on x264

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: is H264 codec via h/w ?

Wed Apr 05, 2017 1:27 pm

ninjaEF wrote:well, what you have done there, it would seem to me, is

compiled libx264 which is the GPL version of OMX h264

As I understand it, Broadcom do not licence the distribution of binaries and you have to build using OMX IL headers + libraries

So your procedure above will give you a .264 codec that will not use the PIs GPU for acceleration

Compiling using OMX IL headers and libs will give you the h264_omx codec which DOES use the GPU

So you are in fact, using S/W encoding on x264
Interesting. You may be correct. I am aware that libx264 provides software encoding. I was assuming that configuring the way I did would give me both options:

Code: Select all

./configure --arch=armhf --target-os=linux --enable-gpl --enable-nonfree --enable-libx264 --enable-libopus --enable-libfdk-aac --enable-omx --enable-omx-rpi --enable-mmal
Perhaps I really should be using --disable-libx264 or leaving out the libx264 option altogether. I haven't really tested performance yet, but I certainly will now. Thank you.

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: is H264 codec via h/w ?

Wed Apr 05, 2017 6:30 pm

Does this look like it's working? The resulting video file seems to play well enough.

Code: Select all

pi@raspberrypi:~$ ffmpeg -c:v h264_mmal -i /home/pi/Videos/video-h264.mkv -c:v h264_omx -c:a copy -b:v 1500k -s 640x480 /home/pi/video-h264.mkv
ffmpeg version N-85266-g12290077d1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-10+rpi1) 20170321
  configuration: --arch=armhf --target-os=linux --enable-gpl --enable-nonfree --enable-libx264 --enable-libopus --enable-libfdk-aac --enable-omx --enable-omx-rpi --enable-mmal
  libavutil      55. 59.100 / 55. 59.100
  libavcodec     57. 90.100 / 57. 90.100
  libavformat    57. 72.100 / 57. 72.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 83.100 /  6. 83.100
  libswscale      4.  7.100 /  4.  7.100
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, matroska,webm, from '/home/pi/Videos/video-h264.mkv':
  Metadata:
    ENCODER         : Lavf55.12.0
  Duration: 00:00:16.17, start: 0.104000, bitrate: 4061 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1920x960 [SAR 1:1 DAR 2:1], 24 fps, 24 tbr, 1k tbn, 180k tbc (default)
    Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Stereo
      LANGUAGE        : eng
File '/home/pi/video-h264.mkv' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_mmal) -> h264 (h264_omx))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264_omx @ 0x19a4bd0] Using OMX.broadcom.video_encode
Output #0, matroska, to '/home/pi/video-h264.mkv':
  Metadata:
    encoder         : Lavf57.72.100
    Stream #0:0: Video: h264 (h264_omx) (H264 / 0x34363248), yuv420p, 640x480 [SAR 3:2 DAR 2:1], q=2-31, 1500 kb/s, 24 fps, 1k tbn, 24 tbc (default)
    Metadata:
      encoder         : Lavc57.90.100 h264_omx
    Stream #0:1(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Stereo
      LANGUAGE        : eng
frame=  384 fps= 23 q=-0.0 Lsize=    2906kB time=00:00:16.04 bitrate=1483.9kbits/s speed=0.941x    
video:2641kB audio:255kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.344313%

ninjaEF
Posts: 13
Joined: Thu Jan 14, 2016 9:06 am

Re: is H264 codec via h/w ?

Wed Apr 05, 2017 8:30 pm

yes, you have the h264_omx encoder in there for sure

you should see less CPU loading too, using the 'top' command, ffmpeg should be lower down then before

well done

User avatar
topguy
Posts: 4406
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: is H264 codec via h/w ?

Thu Apr 06, 2017 1:24 pm

TIP: There is a command called "time" that you can add to the front of you commandline that will show how much time a command takes. If you need to measure performance with different options.

Return to “Debian”

Who is online

Users browsing this forum: No registered users and 3 guests