ffprobe: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No

异常消息
[root@localhost video_list]# ffprobe
ffprobe: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory

[root@localhost video_list]# ffprobe
ffprobe: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory

解决(方式一):

[root@localhost video_list]# whereis ffprobe
ffprobe: /usr/bin/ffprobe /usr/local/bin/ffprobe

查找到ffprobe安装在/usr/bin/ffprobe
则执行命令获取视频信息

/usr/bin/ffprobe   -select_streams v -show_entries format=duration,size,bit_rate,filename  -show_streams -v quiet  -of json -i   /video_list/IMG_0837.MOV

执行成功后:

[root@localhost video_list]# /usr/bin/ffprobe   -select_streams v -show_entries format=duration,size,bit_rate,filename  -show_streams -v quiet  -of json -i   /video_list/IMG_0837.MOV
{
    "streams": [
        {
            "index": 0,
            "codec_name": "hevc",
            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
            "profile": "Main",
            "codec_type": "video",
            "codec_time_base": "8177/490800",
            "codec_tag_string": "hvc1",
            "codec_tag": "0x31637668",
            "width": 3840,
            "height": 2160,
            "coded_width": 3840,
            "coded_height": 2160,
            "closed_captions": 0,
            "has_b_frames": 2,
            "pix_fmt": "yuv420p",
            "level": 153,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "refs": 1,
            "r_frame_rate": "60/1",
            "avg_frame_rate": "490800/8177",
            "time_base": "1/600",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 8177,
            "duration": "13.628333",
            "bit_rate": "50336483",
            "nb_frames": "818",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "creation_time": "2020-11-26T05:12:48.000000Z",
                "language": "und",
                "handler_name": "Core Media Video",
                "encoder": "HEVC"
            }
        }
    ],
    "format": {
        "filename": "/video_list/IMG_0837.MOV",
        "duration": "13.628333",
        "size": "86244581",
        "bit_rate": "50626635"
    }
}
[root@localhost video_list]# /usr/bin/ffprobe
ffprobe version 4.3.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] [INPUT_FILE]

You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.

解决方式二(推荐)

查找libavdevice.so.58在哪个目录下,发现在/usr/local/lib下面,则需要将/usr/local/lib添加到
文件/etc/ld.so.conf末尾中
查找命令
whereis libavdevice.so.58

[root@localhost lib]# whereis  libavdevice.so.58
libavdevice.so: /usr/local/lib/libavdevice.so.58 /usr/local/lib/libavdevice.so

#编辑/etc/ld.so.conf
sudo vi /etc/ld.so.conf

#在文件/etc/ld.so.conf末尾追加/usr/local/lib

[root@localhost lib]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib

#保存后,更新环境变量
sudo ldconfig

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王焜棟琦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值