FGuerzoni

Members
  • Content Count

    23
  • Joined

  • Last visited

  1. After a fresh new complete rebuild and reinstall following a clean procedure I got the same troubles. Giving up for now until I get some grip on the issue. Currently it's just a black box for me. @jernej Thank you for all your support and patience.
  2. I was not aware of that option. My bad. I only had to left out --enable-libopencv because even if installed it cannot be seen. Don't know why. Anyway, after ffmpeg and mpv rebuilt anything changed. > ffmpeg ffmpeg version n4.0.4-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --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-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-v4l2-request --enable-libudev libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... The reason is here: [vd] Trying hardware decoding via h264_v4l2m2m-v4l2m2m-copy. [vd] Using underlying hw-decoder 'h264_v4l2m2m' [ffmpeg] h264_v4l2m2m: Could not find a valid device [ffmpeg] h264_v4l2m2m: can't configure decoder [vd] Could not open codec. [vd] Falling back to software decoding. Please check the attached log for details mpv_log_201909251312
  3. Thank you, I did a first quick attempt because of little time available, but I was not able to build ffmpeg with so many options. I got troubles installing so many libraries and make them available to ffmpeg. I'll retry later.
  4. After complete rebuild and reinstall of everything it's still not working. It falls back to software decoding with cpu over 350% The file to decode is the standard Big Bucket Bunny at 1080p > whereis libdrm libdrm: /usr/lib/arm-linux-gnueabihf/libdrm.so /usr/include/libdrm /usr/share/libdrm > whereis libudev libudev: /lib/arm-linux-gnueabihf/libudev.so /usr/include/libudev.h /usr/share/man/man3/libudev.3.gz > ls /usr/src/linux-headers-5.3.1-sunxi/ Documentation Makefile arch certs drivers include ipc lib net scripts sound usr Kconfig Module.symvers block crypto fs init kernel mm samples security tools virt and mpv log of > mpv --vo=null --hwdec=auto -v bbb_1080p.mp4 is in the attached file. mpv_log_201909241048
  5. I checked the armbian config-default.conf where the option is empty instead of "yes" INSTALL_HEADERS="" # install kernel headers package Tomorrow I'll rebuild everything and I'll let you know if it's working Thanks and regards
  6. Maybe I have problems on kernel headers. Please confirm me that this is the right way to search for them > whereis libdrm libdrm: /usr/lib/arm-linux-gnueabihf/libdrm.so /usr/include/libdrm /usr/share/libdrm > whereis libudev libudev: /lib/arm-linux-gnueabihf/libudev.so /usr/include/libudev.h /usr/share/man/man3/libudev.3.gz > sudo ls /usr/src/kernels/$(uname -r) ls: cannot access '/usr/src/kernels/5.3.0-sunxi': No such file or directory
  7. You are right, even if I don't understand why because I've explicitly set '--enable-v4l2-request' > ffmpeg ffmpeg version n4.0.4 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) configuration: --enable-v4l2-request --enable-libudev --enable-libdrm libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... > ffmpeg -decoders | grep h264 ffmpeg version n4.0.4 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) configuration: --enable-v4l2-request --enable-libudev --enable-libdrm libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 VFS..D h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 V..... h264_v4l2m2m V4L2 mem2mem H.264 decoder wrapper (codec h264) > ffmpeg -hwaccels ffmpeg version n4.0.4 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) configuration: --enable-v4l2-request --enable-libudev --enable-libdrm libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 Hardware acceleration methods: vdpau vaapi drm
  8. I had some progresses using 'null'. But it's logging that it's using software decoding. From that the fact the cpu is very high. > mpv --vo=null --hwdec=auto -v bbb_1080p.mp4 [cplayer] Command line options: '--vo=null' '--hwdec=auto' '-v' 'bbb_1080p.mp4' [cplayer] mpv 0.28.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects [cplayer] built on Sun Sep 22 11:14:34 UTC 2019 [cplayer] ffmpeg library versions: [cplayer] libavutil 56.14.100 [cplayer] libavcodec 58.18.100 [cplayer] libavformat 58.12.100 [cplayer] libswscale 5.1.100 [cplayer] libavfilter 7.16.100 [cplayer] libswresample 3.1.100 [cplayer] ffmpeg version: n4.0.4 [cplayer] [cplayer] Configuration: ./waf configure [cplayer] List of enabled features: alsa asm atomics build-date cplayer cplugins cuda-hwaccel debug-build drm drmprime egl-drm egl-helpers egl-x11 encoding fchmod ffmpeg gbm gbm.h gl gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv libaf libass libass-osd libav-any libavcodec libavdevice libdl libm librt linux-fstatfs optimize oss-audio posix posix-or-mingw posix-spawn posix-spawn-native pthreads pulse stdatomic vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vt.h x11 xv zlib [cplayer] Reading config file /usr/local/etc/mpv/encoding-profiles.conf [cplayer] Playing: bbb_1080p.mp4 [file] Opening bbb_1080p.mp4 [demux] Trying demuxers for level=normal. [lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048. [demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat) [cplayer] Opening done: bbb_1080p.mp4 [find_files] Loading external files in . [lavf] select track 0 [lavf] select track 1 [cplayer] (+) Video --vid=1 (*) (h264 1920x1080 30.002fps) [cplayer] (+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz) [vd] Container reported FPS: 30.001577 [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper [vd] Opening video decoder h264 [vd] Looking at hwdec h264-vdpau... [vd] Could not create device. [vd] Looking at hwdec h264-vaapi... [vd] Could not create device. [vd] Looking at hwdec h264-vdpau-copy... [vd] Could not create device. [vd] Looking at hwdec h264-vaapi-copy... [vaapi] libva: VA-API version 1.1.0 [vaapi] libva: va_getDriverName() returns -1 [vaapi] libva: va_getDriverName() failed with unknown libva error,driver_name=(null) [vd] Could not create device. [vd] Looking at hwdec h264_v4l2m2m-v4l2m2m-copy... [vd] Trying hardware decoding via h264_v4l2m2m-v4l2m2m-copy. [vd] Using underlying hw-decoder 'h264_v4l2m2m' [ffmpeg] h264_v4l2m2m: driver 'cedrus' on card 'cedrus' [ffmpeg] h264_v4l2m2m: Could not find a valid device [ffmpeg] h264_v4l2m2m: can't configure decoder [vd] Could not open codec. [vd] Falling back to software decoding. [vd] Detected 4 logical cores. [vd] Requesting 5 threads for decoding. [vd] Selected video codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [ad] Codec list: [ad] aac - AAC (Advanced Audio Coding) [ad] aac_fixed (aac) - AAC (Advanced Audio Coding) [ad] Opening audio decoder aac [ad] Requesting 1 threads for decoding. [ad] Selected audio codec: aac (AAC (Advanced Audio Coding)) [cplayer] Starting playback... [af] Audio filter chain: [af] [in] 44100Hz stereo 2ch floatp [af] [out] 44100Hz stereo 2ch floatp [af] [ao] 44100Hz stereo 2ch floatp [ao] Trying audio driver 'pulse' [ao/pulse] requested format: 44100 Hz, stereo channels, floatp [ao/pulse] Library version: 11.1.0 [ao/pulse] Proto: 32 [ao/pulse] Server proto: 4294967295 [ao] Trying audio driver 'alsa' [ao/alsa] requested format: 44100 Hz, stereo channels, floatp [ao/alsa] using ALSA version: 1.1.3 [ao/alsa] opening device 'default' ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default [ao/alsa] Playback open error: No such file or directory [ao] Trying audio driver 'oss' [ao/oss] requested format: 44100 Hz, stereo channels, floatp [ao/oss] using '/dev/mixer' mixer device [ao/oss] using 'pcm' mixer channel [ao/oss] using '/dev/dsp' dsp device [ao/oss] Can't open audio device /dev/dsp: No such file or directory [ao] Failed to initialize audio driver 'oss' [cplayer] Could not open/initialize audio device -> no sound. [ad] Uninit audio decoder. [lavf] deselect track 1 [cplayer] Audio: no audio [vd] Using software decoding. [vd] Decoder format: 1920x1080 yuv420p auto/auto/auto/auto CL=mpeg2/4/h264 (auto 0.000000/0.000000/0.000000) [vd] Using container aspect ratio. [vf] Video filter chain: [vf] [in] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264 [vf] [out] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited SP=1.000000 CL=mpeg2/4/h264 [cplayer] VO: [null] 1920x1080 yuv420p [cplayer] VO: Description: Null video output [cplayer] first video frame after restart shown [cplayer] playback restart complete [statusline] V: 00:05:08 / 00:10:34 (48%) Dropped: 508 [cplayer] EOF code: 6 [vd] Uninit video. [cplayer] finished playback, success (reason 3) [cplayer] [cplayer] [cplayer] Exiting... (Quit) > top - 21:39:21 up 1:33, 2 users, load average: 3.12, 1.37, 0.56 Tasks: 109 total, 1 running, 61 sleeping, 0 stopped, 0 zombie %Cpu(s): 65.7 us, 1.0 sy, 0.0 ni, 33.2 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st KiB Mem : 502912 total, 6120 free, 117948 used, 378844 buff/cache KiB Swap: 251452 total, 250172 free, 1280 used. 373080 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1721 armbi 20 0 179360 74832 11708 S 265.3 14.9 6:05.28 mpv 1439 armbi 20 0 4680 2200 1732 R 0.7 0.4 0:08.04 top 1720 root 20 0 0 0 0 I 0.3 0.0 0:00.05 kworker/0:2-eve
  9. Yes I have /dev/dri/card0 > ls /dev/dri/card0 /dev/dri/card0 but I don't have any monitor connected. NanoPiNeo doesn't have any HDMI output. Sorry, I wasn't aware that the physical monitor is mandatory. So with my device the only way is to dig into ffmpeg and understand why it's apparently not using the hw accels. I'll post results in case I'll get them. Thank you again Regards F
  10. Thank you jernej, there's no desktop environment at all and I'm running command from the command line. I'm using just the standard megous DEV branch patched with the kernel patches you suggested. I'm already able to run on the same device the VAAPI stack, which is quite limited because it's able to correctly decode only the base profile. From previous posts I got the fact that the ffmpeg way could decode any h264 profiles. Is it right? If so I'm very interested to make it work, because I don't have any idea when the VAAPI stack will be fully implemented. Regards F
  11. Digging a bit more Calling v4l2-ctl --log-status I'm getting the same 'Inappropriate ioctl for device' seen before > v4l2-ctl --list-devices --verbose cedrus (platform:cedrus): /dev/video0 VIDIOC_QUERYCAP: ok > v4l2-ctl --log-status --verbose VIDIOC_QUERYCAP: ok VIDIOC_LOG_STATUS: failed: Inappropriate ioctl for device
  12. Sure, thank you. Read below. What is not clear to me is if your patches still use VAAPI. In that case I've not yet installed (because of compilation errors to solve) libva-v4l2-request as suggested by https://linux-sunxi.org/Sunxi-cedrus libva-v4l2-request The main userspace component that supports the Cedrus VPU driver is the libva-v4l2-request VAAPI backend. It is available at: Repository: https://github.com/bootlin/libva-v4l2-request In the very same page it's also suggested for VLC, but could be the same for FFMPEG, to export LIBVA_DRIVER_NAME=v4l2_request Here's the output by MPV: sudo mpv -v --hwdec=auto --vo=drm ipc47_seq01.mp4 [sudo] password for armbi: [cplayer] Command line options: '-v' '--hwdec=auto' '--vo=drm' 'ipc47_seq01.mp4' [cplayer] mpv 0.28.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects [cplayer] built on Sun Sep 22 11:14:34 UTC 2019 [cplayer] ffmpeg library versions: [cplayer] libavutil 56.14.100 [cplayer] libavcodec 58.18.100 [cplayer] libavformat 58.12.100Aout [cplayer] libswscale 5.1.100 [cplayer] libavfilter 7.16.100 [cplayer] libswresample 3.1.100 [cplayer] ffmpeg version: n4.0.4 [cplayer] [cplayer] Configuration: ./waf configure [cplayer] List of enabled features: alsa asm atomics build-date cplayer cplugins cuda-hwaccel debug-build drm drmprime egl-drm egl-helpers egl-x11 encoding fchmod ffmpeg gbm gbm.h gl gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv libaf libass libass-osd libav-any libavcodec libavdevice libdl libm librt linux-fstatfs optimize oss-audio posix posix-or-mingw posix-spawn posix-spawn-native pthreads pulse stdatomic vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vt.h x11 xv zlib [cplayer] Reading config file /usr/local/etc/mpv/encoding-profiles.conf [cplayer] Playing: ipc47_seq01.mp4 [file] Opening ipc47_seq01.mp4 [demux] Trying demuxers for level=normal. [lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048. [demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat) [cplayer] Opening done: ipc47_seq01.mp4 [find_files] Loading external files in . [lavf] select track 0 [cplayer] (+) Video --vid=1 (*) (h264 1920x1088 9.939fps) [vo/drm] VT_GETMODE failed: Inappropriate ioctl for device [vo/drm] Failed to set up VT switcher. Terminal switching will be unavailable. [vo/drm] Cannot retrieve DRM resources: Operation not supported [vo/drm] Failed to create KMS. [cplayer] Error opening/initializing the selected video_out (--vo) device. [lavf] deselect track 0 [cplayer] Video: no video [cplayer] No video or audio streams selected. [cplayer] finished playback, no audio or video data played (reason 4) [cplayer] [cplayer] [cplayer] Exiting... (Errors when loading file) The issue is in 'bool vt_switcher_init(struct vt_switcher *s, struct mp_log *log)' in drm_common.c where: if (ioctl(s->tty_fd, VT_SETMODE, &vt_mode) < 0) { MP_ERR(s, "VT_SETMODE failed: %s\n", mp_strerror(errno)); return false; }
  13. Thank you for quick reply. That was first attempt I made but I got troubles: > mpv --hwdec=auto --vo=drm ipc47_seq01.mp4 Playing: ipc47_seq01.mp4 (+) Video --vid=1 (*) (h264 1920x1088 9.939fps) [vo/drm] VT_GETMODE failed: Inappropriate ioctl for device [vo/drm] Failed to set up VT switcher. Terminal switching will be unavailable. [vo/drm] Cannot retrieve DRM resources: Operation not supported [vo/drm] Failed to create KMS. Error opening/initializing the selected video_out (--vo) device. Video: no video No video or audio streams selected. Exiting... (Errors when loading file)
  14. Thank you jernej for the detailed instructions. I successfully built 5.3 kernel with cedrus driver enabled and the patched ffmpeg 4.0.4 on a NanoPiNeo I'm interested in processing streams from ip cameras on headless devices and I don't require mpv. I tried to directly run ffmpeg to test hardware decoding but it doesn't seem to take advantage of the hardware acceleration. CPU is still very high. I piped the output to a named pipe in order to discard it to remove any writing overhead to SD disk. Have you got any hints to take advantage of the hw accel? > cat outpipe > /dev/null > ffmpeg -i ipc47_seq03.h264 -c:v rawvideo -pix_fmt yuv420p -f rawvideo pipe:1 > outpipe ffmpeg version n4.0.4 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) configuration: --enable-v4l2-request --enable-libudev --enable-libdrm libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 Input #0, h264, from 'ipc47_seq03.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 1200k tbn, 50 tbc Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native)) Press [q] to stop, [?] for help Output #0, rawvideo, to 'pipe:1': 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A Metadata: encoder : Lavf58.12.100 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, q=2-31, 622080 kb/s, 25 fps, 25 tbn, 25 tbc Metadata: encoder : Lavc58.18.100 rawvideo av_interleaved_write_frame(): Broken pipeB time=00:00:53.28 bitrate=605734.1kbits/s speed=0.911x Error writing trailer of pipe:1: Broken pipe frame= 1305 fps= 22 q=-0.0 Lsize= 3960900kB time=00:00:53.60 bitrate=605367.4kbits/s speed=0.911x video:3963938kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown > armbianmonitor -m 11:57:25: 1368MHz 2.62 94% 16% 77% 0% 0% 0% 59.3°C 0/8 11:57:31: 1368MHz 2.73 94% 16% 77% 0% 0% 0% 59.3°C 0/8 11:57:36: 1368MHz 2.75 94% 16% 77% 0% 0% 0% 60.9°C 0/8 > top top - 11:57:01 up 3:49, 3 users, load average: 2.35, 0.96, 0.66 Tasks: 112 total, 2 running, 64 sleeping, 0 stopped, 0 zombie %Cpu(s): 78.7 us, 16.0 sy, 0.0 ni, 5.2 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st KiB Mem : 502912 total, 238052 free, 100316 used, 164544 buff/cache KiB Swap: 251452 total, 238472 free, 12980 used. 391764 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 31161 armbi 20 0 157540 52764 8760 R 350.2 10.5 0:43.71 ffmpeg 31162 armbi 20 0 1548 336 292 S 29.2 0.1 0:03.13 cat 31158 armbi 20 0 4680 2096 1680 R 1.6 0.4 0:00.74 top 373 root -51 0 0 0 0 S 0.3 0.0 0:03.28 irq/54-ths 1009 root 20 0 4680 552 484 S 0.3 0.1 0:00.16 cron
  15. I really have poor experience with libva-v4l2-request library. Maybe you could find useful that Sunxi-Cedrus linux release-2019.03 is a patched version of 5.0.7 kernel release About libva-v4l2-request library, I tried to compile it. And yes I too had to disable version check. And I found that the version from github master was easier to compile (less issues) that the one suggested by the sunxi wiki, which was the release-2019.03