网络摄像头捕获的 mp4 文件有问题。
我使用网络摄像头捕捉视频甚高频. 捕获的文件在甚高频, 但乘用车无法播放音频流。(ffmpeg也无法识别音频编解码器)我该如何解决这些问题?
日志:
$ vlc --version
VLC media player 2.2.5.1 Umbrella (revision 2.2.5.1~ppa)
$ ffmpeg -i test.mp4 -vn -acodec mp3 -ab 320k -ar 44100 -ac 2 output.mp3
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --disable-ffserver --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc --enable-libzimg
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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37cae40] Could not find codec parameters for stream 0 (Audio: none (mp3 / 0x2033706D), 44100 Hz, 1 channels, 128 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: mp41avc1
creation_time : 2021-01-19T11:39:31.000000Z
playback_requirements: QuickTime 6.0 or greater
playback_requirements-eng: QuickTime 6.0 or greater
encoder : vlc 2.2.5.1 stream output
encoder-eng : vlc 2.2.5.1 stream output
Duration: 00:00:12.79, start: 0.000000, bitrate: 1882 kb/s
Stream #0:0(eng): Audio: none (mp3 / 0x2033706D), 44100 Hz, mono, 128 kb/s (default)
Metadata:
creation_time : 2021-01-19T11:39:31.000000Z
handler_name : SoundHandler
Stream #0:1(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 864x480 [SAR 1:1 DAR 9:5], 1746 kb/s, 24 fps, 24 tbr, 1000k tbn, 24 tbc (default)
Metadata:
creation_time : 2021-01-19T11:39:31.000000Z
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (? (?) -> mp3 (libmp3lame))
Decoder (codec none) not found for input stream #0:0
$ mpv test.mp4
Playing: test.mp4
(+) Video --vid=1 (*) (mpeg4 24.000fps)
(+) Audio --aid=1 --alang=eng (*) ( 1ch 44100Hz)
Failed to initialize a decoder for codec ''.
Audio: no audio
VO: [gpu] 864x480 yuv420p
V: 00:00:01 / 00:00:12 (11%)
Exiting... (Quit)
示例视频 http://transfer.sh/OZHYo/test.mp4
4.4.0-142-通用#168~14.04.1-Ubuntu SMP x86_64 GNU/Linux
答案1
对我有用。升级您的 ffmpeg 和 mpv。