gpt4 book ai didi

ffmpeg:无法剪切 avi 电影

转载 作者:行者123 更新时间:2023-12-04 23:31:20 33 4
gpt4 key购买 nike

我正在使用 ffmpeg 剪切视频文件:

ffmpeg -<InputFile> -ss 00:00:00 -t 00:00:30 <OutputFile>

不包括 *.avi 格式的不同文件格式是可以的。对于 avi 电影,ffmpeg 显示视频被截断,但输出文件包含完整视频(不截断)。
有人知道解决问题的可能方法吗?

这里将命令输出转换为 avi 文件:
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 1 2011 02:54:36 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.36. 0 / 50.36. 0
libavcore 0.16. 1 / 0.16. 1
libavcodec 52.108. 0 / 52.108. 0
libavformat 52.93. 0 / 52.93. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1.74. 0 / 1.74. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg4 @ 0x91e7e10] Invalid and inefficient vfw-avi packed B frames detected

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 25.00 (25/1)
Input #0, avi, from '/home/mightymeeting/Videos/tam-19.avi':
Duration: 00:04:43.32, start: 0.000000, bitrate: 564 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 352x208 [PAR 1:1 DAR 22:13], 25 fps, 25 tbr, 25 tbn, 30k tbc
Stream #0.1: Audio: mp3, 32000 Hz, 2 channels, s16, 80 kb/s
[buffer @ 0x91e6ed0] w:352 h:208 pixfmt:yuv420p
Output #0, avi, to 'out.avi':
Metadata:
ISFT : Lavf52.93.0
Stream #0.0: Video: mpeg4, yuv420p, 352x208 [PAR 1:1 DAR 22:13], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream #0.1: Audio: mp2, 32000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg4 @ 0x91e7e10] Invalid and inefficient vfw-avi packed B frames detected
frame= 7082 fps=999 q=2.0 Lsize= 7513kB time=30.02 bitrate=2049.8kbits/s dup=0 drop=1
video:7079kB audio:235kB global headers:0kB muxing overhead 2.718192%

最佳答案

听起来这可能是一个 DivX 文件。尝试

ffmpeg -i INPUT.avi -c copy -ss 00:00:00 -t 00:00:30 -bsf:v mpeg4_unpack_bframes OUTPUT.avi

来自 documentation

DivX-style packed B-frames are not valid MPEG-4 and were only a workaround for the broken Video for Windows subsystem. They use more space, can cause minor AV sync issues, require more CPU power to decode (unless the player has some decoded picture queue to compensate the 2,0,2,0 frame per packet style) and cause trouble if copied into a standard container like mp4 or mpeg-ps/ts, because MPEG-4 decoders may not be able to decode them, since they are not valid MPEG-4.

关于ffmpeg:无法剪切 avi 电影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4850331/

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