我正在尝试将从Cisco EX60捕获的原始视频文件转换为有效的MP4文件。 我使用以下命令 ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -r 25 -i input2 -vcodec libx264 output2.mp4
并获取
libpostproc 54. 0.100 / 54. 0.100
[rawvideo @ 0000000000703920] Estimating duration from bitrate, this may be inac
curate
Input #0, rawvideo, from 'input2':
Duration: 00:00:00.20, start: 0.000000, bitrate: 630883 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 622080
kb/s, 25 tbr, 25 tbn, 25 tbc
File 'output2.mp4' already exists. Overwrite ? [y/N] y
[libx264 @ 00000000007115e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 00000000007115e0] profile High, level 4.0
[libx264 @ 00000000007115e0] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output2.mp4':
Metadata:
encoder : Lavf57.18.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1
080, q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc57.15.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[rawvideo @ 00000000007101c0] ****Invalid buffer size, packet size 220075 < expected
frame_size 3110400
Error while decoding stream #0:0: Invalid argument****
frame= 5 fps=2.5 q=-1.0 Lsize= 6514kB time=00:00:00.12 bitrate=444706.9kbi
ts/s
video:6513kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 0.013209%
[libx264 @ 00000000007115e0] frame I:1 Avg QP:35.99 size:1334571
[libx264 @ 00000000007115e0] frame P:4 Avg QP:35.00 size:1333616
[libx264 @ 00000000007115e0] mb I I16..4: 0.0% 0.0% 100.0%
[libx264 @ 00000000007115e0] mb P I16..4: 98.7% 0.0% 1.3% P16..4: 0.0% 0.0
% 0.0% 0.0% 0.0% skip: 0.0%
带
Invalid buffer size, packet size 220075 < expected
frame_size 3110400
Error while decoding stream #0:0: Invalid argument**
内
当我使用时 ffmpeg -f h264 -i input -vcodec copy -r 25 outfile.mp4 它用B帧替换初始IFrame,所以我无法播放它。我可以使用VCL查看它,但不能使用Windows Media Player查看。 命令有什么问题? 谢谢 叶菲姆
答案 0 :(得分:0)
Stream #0:0: Video: h264 (libx264)
这是源视频流,已使用h264编码。所以rawvideo不太可能正常工作。您实际上必须解码流以便再次对其进行编码。
至于为何无法在Windows Media Player中播放,请查看H.264 encoding guide。默认情况下,编码为h264时使用的最高配置文件与每个设备和播放器不兼容。为获得最大兼容性,请添加以下选项:
-profile:v baseline -level 3.0