gpt4 book ai didi

linux - 在 Ubuntu 中使用 ffmpeg 提取视频的时间

转载 作者:太空宇宙 更新时间:2023-11-04 10:21:18 25 4
gpt4 key购买 nike

我正在使用 Ubuntu 14.04.5 LTS 32 位和 ffmpeg 来提取视频的时间。

在 Windows 10 中,该命令有效:

/usr/bin/ffmpeg -i video.mp4 -vstats 2> & 1

在 Linux 中,ffmpeg 以红色返回错误:

必须至少指定一个输出文件

错误完成在这里:

ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened
--extra-cflags= --extra-cxxflags= --libdir=/usr/lib/i386-linux-gnu --shlibdir=/usr/lib/i386-linux-gnu --incdir=/
usr/include/i386-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample
--enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883
--enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal
--enable-libopencv
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp41isom
creation_time : 2017-01-29 15:42:02
location : -21.6646-46.7394/
location-eng : -21.6646-46.7394/
Duration: 00:01:49.43, start: 0.000000, bitrate: 1171 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], 992 kb/s,
15.01 fps, 15 tbr, 30k tbn, 60 tbc (default)
Metadata:
creation_time : 2017-01-29 15:42:02
handler_name : VideoHandler
encoder : AVC Coding
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 174 kb/s (default)
Metadata:
creation_time : 2017-01-29 15:42:02
handler_name : SoundHandler
At least one output file must be specified

我该如何解决这个问题?

最佳答案

使用

/usr/bin/ffmpeg -i video.mp4 -vstats -map 0:v -f null - 2>&1

或者你可以只使用 ffprobe

ffprobe -show_entries format=duration -of compact=p=0:nk=1 video.mp4 

关于linux - 在 Ubuntu 中使用 ffmpeg 提取视频的时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43763074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com