How to encode (x264) several videos to a target capacity with the same quality
Posted: 03 Jul 2020 17:40
Perhaps there is somebody who understands 2-pass encoding. It is possible to encode one video to a target size. Is it possible to achieve a target capacity (DVD) with several video files (series episodes) encoded individually but with the same quality? If all videos have the same duration (or not), but they contain different contents (scenes), the sizes must be different.
{1.mkv, 2.mkv, ...} 10 GB => 4.5 GB?
I could run 1st-pass only to generate stats+mbtree files for all sources. Could I use one the same value of target bitrate parameter for all videos just for this 1st-pass purpose?
Then is it possbile to calculate individual target bitrates from all merged stats files? Or is it possible to calculate one average CRF factor I could use for all individual sources?
One stats contents example:
{1.mkv, 2.mkv, ...} 10 GB => 4.5 GB?
I could run 1st-pass only to generate stats+mbtree files for all sources. Could I use one the same value of target bitrate parameter for all videos just for this 1st-pass purpose?
Then is it possbile to calculate individual target bitrates from all merged stats files? Or is it possible to calculate one average CRF factor I could use for all individual sources?
One stats contents example:
Code: Select all
#options: 720x300 fps=24000/1001 timebase=1001/24000 bitdepth=8 cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=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=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=399 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
in:0 out:0 type:I dur:2 cpbdur:2 q:34.99 aq:16.00 tex:193 mv:391 misc:96 imb:855 pmb:0 smb:0 d:- ref:;
in:4 out:1 type:P dur:2 cpbdur:2 q:34.89 aq:15.00 tex:0 mv:0 misc:144 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:2 out:2 type:B dur:2 cpbdur:2 q:34.89 aq:19.00 tex:0 mv:0 misc:128 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:1 out:3 type:b dur:2 cpbdur:2 q:34.89 aq:20.00 tex:0 mv:0 misc:120 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:3 out:4 type:b dur:2 cpbdur:2 q:34.89 aq:20.00 tex:0 mv:0 misc:120 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:8 out:5 type:P dur:2 cpbdur:2 q:26.89 aq:7.00 tex:0 mv:0 misc:160 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:6 out:6 type:B dur:2 cpbdur:2 q:30.89 aq:15.00 tex:0 mv:0 misc:144 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:5 out:7 type:b dur:2 cpbdur:2 q:32.89 aq:18.00 tex:0 mv:0 misc:128 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:7 out:8 type:b dur:2 cpbdur:2 q:28.89 aq:14.00 tex:0 mv:0 misc:128 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:12 out:9 type:P dur:2 cpbdur:2 q:18.89 aq:0.00 tex:0 mv:0 misc:168 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:10 out:10 type:B dur:2 cpbdur:2 q:22.89 aq:7.00 tex:0 mv:0 misc:152 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:9 out:11 type:b dur:2 cpbdur:2 q:24.89 aq:10.00 tex:0 mv:0 misc:128 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:11 out:12 type:b dur:2 cpbdur:2 q:20.89 aq:6.00 tex:0 mv:0 misc:136 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:16 out:13 type:P dur:2 cpbdur:2 q:11.66 aq:0.00 tex:0 mv:0 misc:168 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:14 out:14 type:B dur:2 cpbdur:2 q:15.27 aq:0.00 tex:0 mv:0 misc:152 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:13 out:15 type:b dur:2 cpbdur:2 q:17.08 aq:2.00 tex:0 mv:0 misc:136 imb:0 pmb:0 smb:855 d:- ref:0 ;
in:15 out:16 type:b dur:2 cpbdur:2 q:13.47 aq:0.00 tex:0 mv:0 misc:136 imb:0 pmb:0 smb:855 d:- ref:0 ;