从MP4压缩到MP4(libx264)时,ffpmeg丢弃最后一帧

时间:2018-10-28 11:48:24

标签: ffmpeg frame encode mp4 libx264

因此,我正在使用此代码压缩* mp4文件。我需要降低质量并降低比特率:

ffmpeg -i input.mp4 -c:v libx264 output.mp4

问题是:ffmpeg压缩后,镜头的最后一帧被丢弃。 屏幕截图在这里:screenshot_ffmpeg_drop frame

我尝试使用所需的完整首选项,但问题是相同的。

ffmpeg -i input.mp4 -c:v libx264 -vf scale=1280:720 -preset fast -crf 29 -r 25 -c:a copy output.mp4
ffmpeg编码期间的

logfile:

  

从'\ input.mp4'输入#0,mov,mp4,m4a,3gp,3g2,mj2:     元数据:       major_brand:mp42       minor_version:0       兼容品牌:mp42mp41       creation_time:2018-10-28T11:06:03.000000Z     持续时间:00:00:12.76,开始:0.000000,比特率:5374 kb / s       流#0:0(eng):视频:h264(高)(avc1 / 0x31637661),yuv420p(tv,bt709),1920x1080 [SAR 1:1 DAR 16:9],5368 kb / s,25 fps,25 tbr ,50k tbn,50 tbc(默认)       元数据:         creation_time:2018-10-28T11:06:03.000000Z         handler_name:别名数据处理程序         编码器:AVC编码

     

流映射:流#0:0->#0:0(h264(native)-> h264   (libx264))按[q]停止,按[?]寻求帮助[libx264 @   使用SAR = 1/1的000002fae8b50780] [libx264 @ 000002fae8b50780]使用cpu   功能:MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @   000002fae8b50780]配置文件高,级别3.1 [libx264 @ 000002fae8b50780]   264-核心155 r2901 7d0ff22-H.264 / MPEG-4 AVC编解码器-Copyleft   2003-2018-http://www.videolan.org/x264.html-选项:cabac = 1 ref = 2   deblock = 1:0:0分析= 0x3:0x113 me =十六进制subme = 6 psy = 1 psy_rd = 1.00:0.00   mixed_ref = 1 me_range = 16 chroma_me = 1格子= 1 8x8dct = 1 cqm = 0   死区= 21,11 fast_pskip = 1 chroma_qp_offset = -2线程= 12   lookahead_threads = 2 sliced_threads = 0 nr = 0抽取= 1隔行扫描= 0   bluray_compat = 0 constrained_intra = 0 bframes = 3 b_pyramid = 2 b_adapt = 1   b_bias = 0直接= 1权重b = 1 open_gop = 0权重p = 1 keyint = 250   keyint_min = 25 scenecut = 40 intra_refresh = 0 rc_lookahead = 30 rc = crf   mbtree = 1 crf = 29.0 qcomp = 0.60 qpmin = 0 qpmax = 69 qpstep = 4 ip_ratio = 1.40   aq = 1:1.00输出#0,mp4,到'\ output.mp4':元数据:       major_brand:mp42       minor_version:0       兼容品牌:mp42mp41       编码器:Lavf58.17.100       流#0:0(eng):视频:h264(libx264)(avc1 / 0x31637661),yuv420p,1280x720 [SAR 1:1 DAR 16:9],q = -1--1、25 fps,12800 tbn,25   tbc(默认)       元数据:         creation_time:2018-10-28T11:06:03.000000Z         handler_name:别名数据处理程序         编码器:Lavc58.19.104 libx264       辅助数据:         cpb:最大/最小/平均比特率:0/0/0缓冲区大小:0 vbv_delay:-1

     

frame = 318 fps = 127 q = -1.0 Lsize = 855kB时间= 00:00:12.60比特率=   556.0kbits / s速度= 5.05x视频:851kB音频:0kB字幕:0kB其他流:0kB全局标头:0kB混合开销:0.534683%[libx264 @   0000015d5cef0500]帧I:2平均QP:26.18大小:67800 [libx264 @   0000015d5cef0500]帧P:80平均QP:27.93大小:5439 [libx264 @   0000015d5cef0500]帧B:236平均QP:32.44大小:1269 [libx264 @   0000015d5cef0500]连续的B帧:0.9%0.0%0.9%98.1%   [libx264 @ 0000015d5cef0500] MB I I16..4:10.6%62.5%26.8%[libx264   @ 0000015d5cef0500] MB P I16..4:0.5%1.0%0.2%P16..4:36.1%   5.1%3.6%0.0%0.0%跳过:53.6%[libx264 @ 0000015d5cef0500] mb B I16..4:0.6%0.5%0.0%B16..8:22.2%0.6%0.0%直接:2.0%   跳过:74.2%L0:44.9%L1:54.5%BI:0.6%[libx264 @ 0000015d5cef0500]   8x8转换内部:55.0%内部:86.2%[libx264 @ 0000015d5cef0500]   编码y,uvDC,uvAC内部:48.1%54.9%27.0%内部:3.2%5.2%0.2%   [libx264 @ 0000015d5cef0500] i16 v,h,dc,p:19%56%10%15%[libx264 @   0000015d5cef0500] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:19%25%18%5%6%   5%8%5%8%[libx264 @ 0000015d5cef0500] i4   v,h,dc,ddl,ddr,vr,hd,vl,hu:27%24%9%5%8%7%7%9%5%7%   [libx264 @ 0000015d5cef0500] i8c dc,h,v,p:60%20%15%4%[libx264 @   0000015d5cef0500]加权P帧:Y:0.0%UV:0.0%[libx264 @   0000015d5cef0500]参考P L0:67.7%32.3%[libx264 @ 0000015d5cef0500]   ref B L0:80.4%19.6%[libx264 @ 0000015d5cef0500] ref B L1:92.1%   7.9%[libx264 @ 0000015d5cef0500] kb / s:547.35

1 个答案:

答案 0 :(得分:0)

使用

ffmpeg -ignore_editlist 1 -i input.mp4 ... output.mp4