我想在 Debian 9 上播放 mp4 视频。
首先,我尝试使用 ffplay 播放视频。我使用该命令ffplay test.mp4
,但它无法播放,并显示许多相同的错误Receive_frame and send_packet both returned EAGAIN, which is an API violation.
。有详细的日志。
$ffplay test.mp4
ffplay version n3.4.1-1-g84bbe2b650-1 Copyright (c) 2003-2017 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --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-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-version3 --enable-rkmpp --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --cross-prefix=aarch64-linux-gnu- --arch=arm64 --target-os=linux --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 'test.mp4':q= 0B f=0/0
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
artist : 陈奕迅
comment : 163 key(Don't modify):clknHbeu87C/TSIpwWw5+/XVNX46iNc6ZUUI/NNBEnGJkB4J9X28bm/OzW54+zpI0NB1+t6V7QGaqmB68bMFun4XNP4wNmDOIp4WWeRm39qy/b0byW/uCuwv/MCWns8cctlzaCGCgZ1BwPvgwiafBMYcHpKHd1o0LSoaK+04tV2kClpKQTalNso32/6iLaRha+HEQqp6uyHtqsB8zoqnbIwint4Dni3AwFID6Y4aN
title : 梦想天空分外蓝
encoder : Lavf57.71.100
Duration: 00:03:20.45, start: 0.000000, bitrate: 834 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 700 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandler
mpi: mpp version: 073ceeb author: Jacob Chen DEBIAN: update rules for release_20171218
mpp_log: can not found match soc name: rockchip,rp px30 linux rockchip,px30
hal_h264d_api: hal_h264d_init mpp_buffer_group_get_internal used ion In
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
[h264_rkmpp @ 0x7f7003a000] Decoder noticed an info change (854x480), format=0
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
[h264_rkmpp @ 0x7f7003a000] Receive_frame and send_packet both returned EAGAIN, which is an API violation.
然后,我尝试使用 mpv 播放视频。我使用命令mpv test.mp4
,它成功播放了视频。有详细的日志。
$mpv test.mp4
Playing: test.mp4
(+) Video --vid=1 (*) (h264 854x480 25.000fps)
(+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz)
File tags:
Artist: 陈奕迅
Comment: 163 key(Don't modify):clknHbeu87C/TSIpwWw5+/XVNX46iNc6ZUUI/NNBEnGJkB4J9X28bm/OzW54+zpI0NB1+t6V7QGaqmB68bMFun4XNP4wNmDOIp4WWeRm39qy/b0byW/uCuwv/MCWns8cctlzaCGCgZ1BwPvgwiafBMYcHpKHd1o0LSoaK+04tV2kClpKQTalNso32/6iLaRha+HEQqp6uyHtqsB8zoqnbIwint4Dni3AwFID6Y4aNZYwtXYGiF6L7DDWSezw0ICX
Title: 梦想天空分外蓝
ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x860 r2p0 status range [0..15], but none of the GPUs matched:
/dev/mali0 detected as 0x7093 r0p0 status 0
[vo/x11] Warning: this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.
AO: [alsa] 44100Hz stereo 2ch float
VO: [x11] 854x480 yuv420p
[ffmpeg] swscaler: No accelerated colorspace conversion found from yuv420p to bgra.
[ffmpeg] swscaler: No accelerated colorspace conversion found from yuv420p to bgra.
[ffmpeg] swscaler: No accelerated colorspace conversion found from yuv420p to bgra.
AV: 00:00:03 / 00:03:20 (1%) A-V: 0.000
我对视频编码和解码了解不多。mpv 和 ffplay 都使用 ffmpeg 进行视频解码,但是为什么结果不一样呢?提前致谢。
有我系统的信息。
$uname -a
Linux linaro-alip 4.4.189 #24 SMP Tue Jul 21 17:01:59 CST 2020 aarch64 GNU/Linux
$cat /proc/version
Linux version 4.4.189 (rpdzkj@rpdzkj) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #24 SMP Tue Jul 21 17:01:59 CST 2020
$lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch