Log in

View Full Version : Encode source Remmux vs Bluray


iKron
8th March 2022, 03:47
i already encoded a file from remux to x264.


here is the encoded x264 media info

General
Unique ID : 279894379662741782831300427478485409881 (0xD291B25B4FF870840B3283494F3FA059)
Complete name : file.mkv
Format : Matroska
Format version : Version 4
File size : 3.28 GiB
Duration : 42 min 27 s
Overall bit rate : 11.0 Mb/s
Encoded date : UTC 2020-03-07 03:14:29
Writing application : mkvmerge v23.0.0 ('The Bride Said No') 64-bit
Writing library : libebml v1.3.6 + libmatroska v1.4.9

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 42 min 27 s
Bit rate : 9 537 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.192
Stream size : 2.83 GiB (86%)
Writing library : x264 core 157 r2969 d4099dd
Encoding settings : cabac=1 / ref=4 / deblock=1:-3:-3 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-4 / threads=18 / lookahead_threads=16 / 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=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=9537 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Default : Yes
Forced : No

Audio
ID : 2
Format : DTS
Format/Info : Digital Theater Systems
Codec ID : A_DTS
Duration : 42 min 27 s
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 458 MiB (14%)
Language : English
Default : No
Forced : No

Text
ID : 3
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Duration : 42 min 3 s
Bit rate : 68 b/s
Count of elements : 624
Stream size : 21.1 KiB (0%)
Default : Yes
Forced : No

Menu
00:00:00.000 : Chapter 01
00:10:20.328 : Chapter 02
00:20:54.711 : Chapter 03
00:31:51.576 : Chapter 04
00:42:00.684 : Chapter 05




and here is the remux media info
General
Unique ID : 201396818656278595491592046803232844027 (0x97839DCAC7FB8F8415E8C08C95C568FB)
Complete name : File.mkv
Format : Matroska
Format version : Version 4
File size : 10.3 GiB
Duration : 42 min 27 s
Overall bit rate mode : Variable
Overall bit rate : 34.7 Mb/s

Encoded date : UTC 2020-09-12 17:27:35
Writing application : mkvmerge v50.0.0 ('Awakenings') 64-bit
Writing library : libebml v1.4.0 + libmatroska v1.6.2
IMDB : tt7612548
TMDB : tv/79340
TVDB : 345831

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 3 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 3 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 42 min 27 s
Bit rate mode : Variable
Bit rate : 32.1 Mb/s
Maximum bit rate : 40.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.646
Stream size : 9.51 GiB (92%)
Writing library : x264 core 148 r2638 7599210
Encoding settings : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=18 / lookahead_threads=1 / sliced_threads=0 / slices=4 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=1 / weightp=1 / keyint=23 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=23 / rc=2pass / mbtree=1 / bitrate=32100 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=40000 / vbv_bufsize=30000 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio
ID : 2
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 42 min 27 s
Bit rate mode : Variable
Bit rate : 2 584 kb/s
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossless
Stream size : 785 MiB (7%)
Title : DTS-HD MA 5.1
Language : English
Default : Yes
Forced : No

Text
ID : 3
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 42 min 3 s
Bit rate : 41.6 kb/s
Count of elements : 1248
Stream size : 12.5 MiB (0%)
Title : English (SDH)
Language : English
Default : No
Forced : No

Menu
00:00:00.000 : en:Chapter 1
00:10:20.703 : en:Chapter 2
00:20:54.879 : en:Chapter 3
00:31:51.368 : en:Chapter 4
00:42:00.518 : en:Chapter 5

======================================

now i want to have a x265 encode in much more smaller file. bitrate will be 4000kb/sec. since the encoded x264 has already has higher bitrate in that case will it be wise to use the encoded x264 file as source file for encode x265.

Asmodian
8th March 2022, 11:21
Every time you reencode you lose quality (unless using mathematically lossless compression). Always use the original source, never a second generation encode.

RanmaCanada
8th March 2022, 16:58
Always use the original source. Don't you remember that Treehouse of Horror episode where Homer's clones started cloning themselves? But seriously, errors and data loss can be introduced with each encode, so you get a worse copy every single time you encode from an encode. Use the OG source unless you don't care about quality. You could convert the audio to OPUS if you want to save space as it is almost transparent in regards to quality.

-QfG-
13th March 2022, 16:15
i would change keyint=250 / keyint_min=24 to - keyint=240 / keyint_min=24 and deblock=1:-3:-3 to deblock=1:-1:-1. Btw don't force deblock, simply use Film or Grain templates from the encoder.

FranceBB
20th March 2022, 00:37
Don't you remember that Treehouse of Horror episode where Homer's clones started cloning themselves?

hahahahaha I do

https://i.ytimg.com/vi/HLITQXRH70M/hqdefault.jpg


Always use the original source.


Yep, both what you and Asmodian described it's called Generational Loss (aka the lossy of the lossy).

@iKron... This is a frame which has encoded up to 2000 times with the same encoding settings which just shows what we mean by that: Link (https://upload.wikimedia.org/wikipedia/commons/9/9a/JPEG_Generation_Loss_rotating_90_%28stitch_of_0%2C100%2C200%2C500%2C900%2C2000_times%29.png) and of course any lossy encoder is subject to that, including x265. What it shows is that when artifacts are included during the first quantization pass, those create sharp edges between a block and the other and once you try to re-encode, the encoder will seek for which blocks need higher bitrate and instead of picking up the ones belonging to the image, it's gonna pick up the ones containing artifacts, hence creating other artifacts and on we go 'till there's nothing left of the original image other than just noise, which is why we should always start from the source ;)