lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
543 stars 24 forks source link

Colour shift when encoding a video to x.265 from x.265 in MPEG-4 #107

Closed EthernalVoid closed 3 years ago

EthernalVoid commented 3 years ago

Command used: other-transcode --x265 %FileName https://imgur.com/a/3YLUN1G I am unsure if I'm missing something or is the tool at fault, handbrake produces an expected video look with no colour shift. Encoding in 10 bit or 8 bit makes no difference. I have tried encoding from multiple x.265 videos all with the same red-colour shift issue. Handbrake settings were matroska 1080p30 default, Main-10, EL=4, bitrate 3600 H.265 10bit (regular H.265 makes no difference)

I'm aware of the difference in the bitrate-starved video vs the encoding bitrate, the idea is to clip a part of the video.

lisamelton commented 3 years ago

@EthernalVoid Since I assume you're using the other-transcode tool, it's based on ffmpeg and not HandBrakeCLI so I don't know what you mean. Are you comparing the output from other-transcode with the output from some different transcode that you've done with HandBrake? There's just too much missing information here to make a guess as to what's going on.

In what format is your original video? Is it H.265? And, if so, is 8-bit or 10-bit HDR?

Please give me a clearer, more detailed description of your inputs and outputs and I'll see what I can do to help. Thanks.

EthernalVoid commented 3 years ago

This is from the MediaInfo tool, regarding the aforementioned video.

Description Info
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/mp41)
File size : 2.06 GiB
Duration : 2 h 12 min
Overall bit rate : 2 231 kb/s
Movie name : Die.Hard.1988.1080p.BluRay.x265
Writing application : Lavf58.20.100
Comment : Die.Hard.1988.1080p.BluRay.x265
Video Description Info
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : hev1
Codec ID/Info : High Efficiency Video Coding
Duration : 2 h 12 min
Bit rate : 2 001 kb/s
Width : 1 920 pixels
Height : 812 pixels
Display aspect ratio : 2.35:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.054
Stream size : 1.85 GiB (90%)
Writing library : x265 3.3+4-30eb4de83092:[Linux][GCC 8.3.1][64 bit] 10bit
Encoding settings : frame-threads=4 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x812 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=3 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / no-sao / no-sao-non-deblock / rd=4 / selective-sao=0 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=2000 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / no-scenecut-aware-qpconformance-window-offsets / right=0 / bottom=0
Codec configuration box : hvcC

I tried clipping a part of the video with other-transcode, with the result being that the generated video is red colour shifted. (by adding [--position 972 --duration 15]) I mentioned that handbrake does not have this issue when clipping a part of the video. I'm testing various video formats and tools to make sure I buy the correct version of BluRay for my setup.

lisamelton commented 3 years ago

@EthernalVoid I still don't understand. Is this media information about the input file that you're passing to other-transcode? And, if so, why are you trying to re-transcode this?

EthernalVoid commented 3 years ago

It is the info of the video file that I'm passing to other-transcode , the idea is to reduce the size by transcoding it, or to generate a short clip from a scene from the movie. Is there a better way to do that?

lisamelton commented 3 years ago

@EthernalVoid I would not re-transcode it since its video bitrate is already so small. That would be a waste of time. Instead, you can use mkvextract or ffmpeg directly to copy portions of it to a different file.

Is a "clip" file all you need?

lisamelton commented 3 years ago

@EthernalVoid Were you able to extract your clip or did you need some help with that?

EthernalVoid commented 3 years ago

I was able to extract the clip using the method provided, thank you for your support :)