[FFmpeg-user] Trying to reduce iframes/keyframes in x265
Gaye Gül Bulut
gayegul at gmail.com
Wed Jan 3 02:01:05 EET 2018
Hi all,
I have been trying to find a way to reduce the number of keyframes/iframes
in videos in x265. I successfully did it in x264 but not x265.
Here is a list of what I tried and the result always had the original
number or something bigger and not reduced at all. I would really really
appreciate all the help I can get and sorry if I missed any rules posting
here.
ffmpeg -i input.mp4 -x265-params keyint=infinite -c:a copy output.mp4
ffmpeg -i input.mp4 -x265-params keyint=infinite:min-keyint=infinite -c:a
copy output.mp4
ffmpeg -i input.mp4 -x265-params keyint=-1 -c:a copy output.mp4
ffmpeg -i input.mp4 -x265-params "-I=-1" -c:a copy output.mp4
ffmpeg -i input.mp4 -x265-params "keyint=-1:min-keyint=-1" -c:a copy
output.mp4
ffmpeg -i input.mp4 -x265-params "keyint=1000:min-keyint=1000" -c:a copy
output.mp4
ffmpeg -i input.mp4 -x265-params "keyint=48:min-keyint=48:no-scenecut" -c:a
copy output.mp4 (this was more of an arbitrary number to see if I can get a
different result, result was the same as other results)
My console output looks like this:
ffmpeg version N-89343-g83ecdc9a92 Copyright (c) 2000-2017 the FFmpeg
developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
--enable-libmfx
libavutil 56. 4.100 / 56. 4.100
libavcodec 58. 6.102 / 58. 6.102
libavformat 58. 2.103 / 58. 2.103
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 5.100 / 7. 5.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002a3d5f2a700] overread end of atom '⌐mak' by
2 bytes
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002a3d5f2a700] overread end of atom '⌐swr' by
3 bytes
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'StarWarsBattlefrontII_
SinglePlayer_Cutscene.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2014-01-01T00:03:32.000000Z
make : Atomos
make-eng : Atomos
encoder : ShogunInferno - 8.12
encoder-eng : ShogunInferno - 8.12
timecode : 00:00:00:00
Duration: 00:03:09.71, start: 0.000000, bitrate: 383408 kb/s
Stream #0:0(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
stereo, s32 (24 bit), 2304 kb/s (default)
Metadata:
creation_time : 2014-01-01T00:03:32.000000Z
Stream #0:1(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709,
progressive), 1920x1080, 381097 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94
tbr, 60k tbn, 60k tbc (default)
Metadata:
creation_time : 2014-01-01T00:03:32.000000Z
encoder : Apple ProRes 422 HQ
Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2014-01-01T00:03:32.000000Z
timecode : 00:00:00:00
Stream mapping:
Stream #0:1 -> #0:0 (prores (native) -> hevc (libx265))
Stream #0:0 -> #0:1 (pcm_s24le (native) -> aac (native))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 2.6+5-b1dfa312234e
x265 [info]: build info [Windows][GCC 7.2.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX
FMA3 BMI2 AVX2
x265 [info]: Main 4:2:2 10 profile, Level-4.1 (Main tier)
x265 [info]: Thread pool 0 using 12 threads on numa nodes 0
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : ABR-572 kbps / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp
strong-intra-smoothing
x265 [info]: tools: lslices=6 deblock sao
Output #0, mp4, to 'StarWarsBattlefrontII_SinglePlayer_Cutscene_libx265_
700k_infiniteNoScenecut.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
timecode : 00:00:00:00
make : Atomos
make-eng : Atomos
encoder : Lavf58.2.103
Stream #0:0(eng): Video: hevc (libx265) (hev1 / 0x31766568),
yuv422p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 572 kb/s, 59.94
fps, 60k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2014-01-01T00:03:32.000000Z
encoder : Lavc58.6.102 libx265
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp (24 bit), 128 kb/s (default)
Metadata:
creation_time : 2014-01-01T00:03:32.000000Z
encoder : Lavc58.6.102 aac
frame=11371 fps= 31 q=-0.0 Lsize= 17345kB time=00:03:09.73 bitrate=
748.9kbits/s speed=0.514x
video:14070kB audio:2985kB subtitle:0kB other streams:0kB global
headers:2kB muxing overhead: 1.700105%
x265 [info]: frame I: 58, Avg QP:27.22 kb/s: 15291.83
x265 [info]: frame P: 2773, Avg QP:32.85 kb/s: 1449.80
x265 [info]: frame B: 8540, Avg QP:38.87 kb/s: 231.80
x265 [info]: Weighted P-Frames: Y:1.8% UV:0.1%
x265 [info]: consecutive B-frames: 7.8% 4.4% 8.0% 38.0% 41.8%
encoded 11371 frames in 369.20s (30.80 fps), 605.65 kb/s, Avg QP:37.34
[aac @ 000002a3d71170e0] Qavg: 784.885
Thank you,
Gaye
More information about the ffmpeg-user
mailing list