06-01-2020, 07:44 AM
Thank You again for Your help @xmixahlx ! Hardware decoding is now working nicely, following the steps You outlined above. Using ffmpeg and null output:
So I am already half way there. Now I only need to get video rendering working properly, because the output with mpv is still dropping frames. I did rebuild against patched ffmpeg, but running mpv with drm option for decoding and video output gives me errors and mpv does not play the video:
Leaving off the "--gpu-context=drm" option will allow the file to play, but as I said output is dropping frames.
Do You happen to know what the issue here is? From Your posts I gather, You do not use mpv Yourself, but maybe You have come across something... In any case thank You very much again, this is already way better, than what I had working before!
Code:
> ffmpeg -hwaccel drm -i bbb_sunflower_1080p_60fps_normal.mp4 -f null -
ffmpeg version 4.2.3-Kodi Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Debian 9.3.0-13)
configuration: --prefix=/usr/local --libdir=/usr/local/lib/aarch64-linux-gnu --shlibdir=/usr/local/lib/aarch64-linux-gnu --enable-shared --enable-pic --enable-v4l2-request --enable-libdrm --enable-libudev --enable-openssl
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bbb_sunflower_1080p_60fps_normal.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
creation_time : 2013-12-16T17:59:32.000000Z
title : Big Buck Bunny, Sunflower version
artist : Blender Foundation 2008, Janus Bager Kristensen 2013
comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
genre : Animation
composer : Sacha Goedegebure
Duration: 00:10:34.53, start: 0.000000, bitrate: 4486 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 4001 kb/s, 60 fps, 60 tbr, 60k tbn, 120 tbc (default)
Metadata:
creation_time : 2013-12-16T17:59:32.000000Z
handler_name : GPAC ISO Video Handler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
creation_time : 2013-12-16T17:59:37.000000Z
handler_name : GPAC ISO Audio Handler
Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
Metadata:
creation_time : 2013-12-16T17:59:37.000000Z
handler_name : GPAC ISO Audio Handler
Side data:
audio service type: main
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Stream #0:2 -> #0:1 (ac3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[h264 @ 0xaaaaeaa94de0] v4l2_request_probe_video_device: missing required mem2mem capability
Last message repeated 1 times
[h264 @ 0xaaaaeaa94de0] v4l2_request_try_format: pixelformat 875967059 not supported for type 10
[h264 @ 0xaaaaeaa94de0] v4l2_request_probe_video_device: try output format failed
[h264 @ 0xaaaaeaa94de0] v4l2_request_try_format: pixelformat 875967059 not supported for type 10
[h264 @ 0xaaaaeaa94de0] v4l2_request_probe_video_device: try output format failed
frame= 10 fps=0.0 q=0.0 size=N/A time=-577014:32:22.77 bitrate=N/A speed=N/A
Output #0, null, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
composer : Sacha Goedegebure
title : Big Buck Bunny, Sunflower version
artist : Blender Foundation 2008, Janus Bager Kristensen 2013
comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
genre : Animation
encoder : Lavf58.29.100
Stream #0:0(und): Video: wrapped_avframe, nv12(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 60 fps, 60 tbn, 60 tbc (default)
Metadata:
creation_time : 2013-12-16T17:59:32.000000Z
handler_name : GPAC ISO Video Handler
encoder : Lavc58.54.100 wrapped_avframe
Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1(side), s16, 4608 kb/s (default)
Metadata:
creation_time : 2013-12-16T17:59:37.000000Z
handler_name : GPAC ISO Audio Handler
encoder : Lavc58.54.100 pcm_s16le
Side data:
audio service type: main
frame= 52 fps= 52 q=-0.0 size=N/A time=00:00:00.90 bitrate=N/A speed=0.899x
frame= 97 fps= 64 q=-0.0 size=N/A time=00:00:01.65 bitrate=N/A speed=1.09x
frame= 141 fps= 70 q=-0.0 size=N/A time=00:00:02.40 bitrate=N/A speed=1.19x
frame= 187 fps= 74 q=-0.0 size=N/A time=00:00:03.15 bitrate=N/A speed=1.24x
frame= 233 fps= 77 q=-0.0 size=N/A time=00:00:03.91 bitrate=N/A speed=1.29x
frame= 283 fps= 80 q=-0.0 size=N/A time=00:00:04.75 bitrate=N/A speed=1.34x
frame= 331 fps= 82 q=-0.0 size=N/A time=00:00:05.55 bitrate=N/A speed=1.37x
frame= 378 fps= 83 q=-0.0 size=N/A time=00:00:06.33 bitrate=N/A speed=1.39x
frame= 406 fps= 83 q=-0.0 Lsize=N/A time=00:00:06.80 bitrate=N/A speed= 1.4x
video:213kB audio:3780kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.
So I am already half way there. Now I only need to get video rendering working properly, because the output with mpv is still dropping frames. I did rebuild against patched ffmpeg, but running mpv with drm option for decoding and video output gives me errors and mpv does not play the video:
Code:
$> ~/mpv-build/mpv/build/mpv --hwdec=drm --vo=gpu --gpu-context=drm bbb_sunflower_1080p_60fps_normal.mp4
(+) Video --vid=1 (*) (h264 1920x1080 60.000fps)
(+) Audio --aid=1 (*) (mp3 2ch 48000Hz)
Audio --aid=2 (*) (ac3 6ch 48000Hz)
File tags:
Artist: Blender Foundation 2008, Janus Bager Kristensen 2013
Comment: Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
Composer: Sacha Goedegebure
Genre: Animation
Title: Big Buck Bunny, Sunflower version
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu] Failed to commit ModeSetting atomic request (-13)
[vo/gpu/opengl] Failed to set CRTC for connector 49: Permission denied
[vo/gpu] Failed initializing any suitable GPU context!
Error opening/initializing the selected video_out (--vo) device.
Video: no video
Exiting... (Errors when loading file)
Leaving off the "--gpu-context=drm" option will allow the file to play, but as I said output is dropping frames.
Do You happen to know what the issue here is? From Your posts I gather, You do not use mpv Yourself, but maybe You have come across something... In any case thank You very much again, this is already way better, than what I had working before!