DAV 到 AVI 转换失败

DAV 到 AVI 转换失败

我想使用以下命令将 DAV 格式视频剪辑从闭路电视录像机转换为 AVI(将 test - 1.dav 转换为 test - 1.avi)

ffmpeg -y -i test\ -\ 1.dav -vcodec copy -movflags +faststart test\ -\ 1.avi

它可以在使用 ffmpeg 版本 2.4.13 的 x86_64 Linux 和使用 ffmpeg 版本 2.0.2 的 Synology 上正常工作。转换后的文件可以在 Windows、Android、iPad 和 Linux 上完全播放。但当我尝试在配备最新版本软件的 Synology 上对其进行转换时,却失败了(ffmpeg 版本 2.7.1)。转换过程的输出如下:

ffmpeg version 2.7.1 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=arm --target-os=linux --cross-prefix=/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --enable-version3 --enable-nonfree --enable-libfaac --enable-encoders --enable-pthreads --disable-bzlib --disable-protocol=rtp --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffserver --disable-ffplay --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-decoder=amrnb --disable-encoder=zmbv --disable-encoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=dca --disable-decoder=eac3 --disable-decoder=truehd --cc=/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc
libavutil      54. 27.100 / 54. 27.100
libavcodec     56. 41.100 / 56. 41.100
libavformat    56. 36.100 / 56. 36.100
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 16.101 /  5. 16.101
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  2.100 /  1.  2.100
libpostproc    53.  3.100 / 53.  3.100
Input #0, h264, from 'test - 1.dav':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p, 704x576, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Output #0, avi, to 'test - 1.avi':
Metadata:
ISFT            : Lavf56.36.100
Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 704x576, q=2-31, 25 fps, 25 tbr, 50 tbn, 50 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[avi @ 0xb0ff0] H.264 bitstream malformed, no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it ('-bsf:v h264_mp4toannexb' option with ffmpeg)
av_interleaved_write_frame(): Invalid data found when processing input
frame=    1 fps=0.0 q=-1.0 Lsize=       6kB time=00:00:00.02 bitrate=2300.0kbits/s    
video:40kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

我必须提到的是,在每种情况下,我都使用相同的输入文件和相同的 ffmpeg 语法进行转换。唯一的区别是 ffmpeg 的版本。最奇怪的是,最新版本却无法正常工作。我犯了什么错误?任何想法?

答案1

ffmpeg版本拒绝将没有起始码的 H.264 编码视频复用为 AVI。您应该-bsf:v h264_mp4toannexb按照输出中的指示使用ffmpeg。这不会重新编码您的视频。

相关内容